Index: base/trace_event/process_memory_maps_dump_provider.cc |
diff --git a/base/trace_event/process_memory_maps_dump_provider.cc b/base/trace_event/process_memory_maps_dump_provider.cc |
index 19f8d891618c10be3ae1d7a65d088b7aecacfb42..929a5090bcc009691ea7138dafb2a713895a15c8 100644 |
--- a/base/trace_event/process_memory_maps_dump_provider.cc |
+++ b/base/trace_event/process_memory_maps_dump_provider.cc |
@@ -4,7 +4,6 @@ |
#include "base/trace_event/process_memory_maps_dump_provider.h" |
-#include "base/files/scoped_file.h" |
#include "base/format_macros.h" |
#include "base/logging.h" |
#include "base/strings/string_util.h" |
@@ -141,11 +140,9 @@ ProcessMemoryMapsDumpProvider* ProcessMemoryMapsDumpProvider::GetInstance() { |
LeakySingletonTraits<ProcessMemoryMapsDumpProvider>>::get(); |
} |
-ProcessMemoryMapsDumpProvider::ProcessMemoryMapsDumpProvider() { |
-} |
+ProcessMemoryMapsDumpProvider::ProcessMemoryMapsDumpProvider() {} |
-ProcessMemoryMapsDumpProvider::~ProcessMemoryMapsDumpProvider() { |
-} |
+ProcessMemoryMapsDumpProvider::~ProcessMemoryMapsDumpProvider() {} |
// Called at trace dump point time. Creates a snapshot of the memory maps for |
// the current process. |
@@ -158,9 +155,11 @@ bool ProcessMemoryMapsDumpProvider::OnMemoryDump(const MemoryDumpArgs& args, |
uint32 res = 0; |
if (UNLIKELY(proc_smaps_for_testing)) { |
res = ReadLinuxProcSmapsFile(proc_smaps_for_testing, pmd->process_mmaps()); |
+ } else if (smaps_file_) { |
+ res = ReadLinuxProcSmapsFile(smaps_file_.get(), pmd->process_mmaps()); |
} else { |
- ScopedFILE smaps_file(fopen("/proc/self/smaps", "r")); |
- res = ReadLinuxProcSmapsFile(smaps_file.get(), pmd->process_mmaps()); |
+ ScopedFILE file(fopen("/proc/self/smaps", "r")); |
+ res = ReadLinuxProcSmapsFile(file.get(), pmd->process_mmaps()); |
} |
if (res > 0) { |