$OpenBSD: patch-components_tracing_common_process_metrics_memory_dump_provider_cc,v 1.1 2017/04/28 22:22:36 robert Exp $
--- components/tracing/common/process_metrics_memory_dump_provider.cc.orig.port	Fri Apr 28 09:45:24 2017
+++ components/tracing/common/process_metrics_memory_dump_provider.cc	Fri Apr 28 09:46:17 2017
@@ -56,7 +56,7 @@ base::LazyInstance<
              std::unique_ptr<ProcessMetricsMemoryDumpProvider>>>::Leaky
     g_dump_providers_map = LAZY_INSTANCE_INITIALIZER;
 
-#if defined(OS_LINUX) || defined(OS_ANDROID)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
 const char kClearPeakRssCommand[] = "5";
 
 const uint32_t kMaxLineSize = 4096;
@@ -196,7 +196,7 @@ std::unique_ptr<base::ProcessMetrics> CreateProcessMet
     base::ProcessId process) {
   if (process == base::kNullProcessId)
     return base::ProcessMetrics::CreateCurrentProcessMetrics();
-#if defined(OS_LINUX) || defined(OS_ANDROID)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
   // Just pass ProcessId instead of handle since they are the same in linux and
   // android.
   return base::ProcessMetrics::CreateProcessMetrics(process);
@@ -217,7 +217,7 @@ uint64_t ProcessMetricsMemoryDumpProvider::rss_bytes_f
 ProcessMetricsMemoryDumpProvider::FactoryFunction
     ProcessMetricsMemoryDumpProvider::factory_for_testing = nullptr;
 
-#if defined(OS_LINUX) || defined(OS_ANDROID)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
 
 // static
 FILE* ProcessMetricsMemoryDumpProvider::proc_smaps_for_testing = nullptr;
@@ -620,7 +620,7 @@ bool ProcessMetricsMemoryDumpProvider::DumpProcessTota
 
 #if !defined(OS_IOS)
   peak_rss_bytes = process_metrics_->GetPeakWorkingSetSize();
-#if defined(OS_LINUX) || defined(OS_ANDROID)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
   if (is_rss_peak_resettable_) {
     std::string clear_refs_file =
         "/proc/" +
@@ -670,7 +670,7 @@ bool ProcessMetricsMemoryDumpProvider::DumpProcessTota
 void ProcessMetricsMemoryDumpProvider::PollFastMemoryTotal(
     uint64_t* memory_total) {
   *memory_total = 0;
-#if defined(OS_LINUX) || defined(OS_ANDROID)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
   int statm_fd = fast_polling_statm_fd_for_testing;
   if (statm_fd == -1) {
     if (!fast_polling_statm_fd_.is_valid()) {
@@ -698,7 +698,7 @@ void ProcessMetricsMemoryDumpProvider::PollFastMemoryT
 }
 
 void ProcessMetricsMemoryDumpProvider::SuspendFastMemoryPolling() {
-#if defined(OS_LINUX) || defined(OS_ANDROID)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
   fast_polling_statm_fd_.reset();
 #endif
 }
