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; |