Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(678)

Unified Diff: components/tracing/common/process_metrics_memory_dump_provider.h

Issue 2753723003: Fix crash in InvokeOnMemoryDump when tracing (Closed)
Patch Set: dont run test on mac or windows Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/tracing/common/process_metrics_memory_dump_provider.h
diff --git a/components/tracing/common/process_metrics_memory_dump_provider.h b/components/tracing/common/process_metrics_memory_dump_provider.h
index 6534f18bf43d8f0afb04e4e8ee02f9bffaa06223..730a9be97d24bb5efaa1d2ce2b8487fe50c8382b 100644
--- a/components/tracing/common/process_metrics_memory_dump_provider.h
+++ b/components/tracing/common/process_metrics_memory_dump_provider.h
@@ -37,7 +37,13 @@ class TRACING_EXPORT ProcessMetricsMemoryDumpProvider
void PollFastMemoryTotal(uint64_t* memory_total) override;
void SuspendFastMemoryPolling() override;
+ protected:
+ ProcessMetricsMemoryDumpProvider(base::ProcessId process);
+
private:
+ using FactoryFunction =
+ std::unique_ptr<ProcessMetricsMemoryDumpProvider> (*)(base::ProcessId);
+
FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest,
ParseProcSmaps);
FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest, DumpRSS);
@@ -51,16 +57,18 @@ class TRACING_EXPORT ProcessMetricsMemoryDumpProvider
#elif defined(OS_WIN)
FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest,
TestWinModuleReading);
+#elif defined(OS_LINUX) || defined(OS_ANDROID)
+ FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest,
+ DoubleRegister);
#endif
- ProcessMetricsMemoryDumpProvider(base::ProcessId process);
-
bool DumpProcessTotals(const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* pmd);
bool DumpProcessMemoryMaps(const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* pmd);
static uint64_t rss_bytes_for_testing;
+ static FactoryFunction factory_for_testing;
#if defined(OS_LINUX) || defined(OS_ANDROID)
static FILE* proc_smaps_for_testing;
« no previous file with comments | « base/trace_event/memory_dump_manager.cc ('k') | components/tracing/common/process_metrics_memory_dump_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698