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

Unified Diff: base/trace_event/process_memory_totals_dump_provider.h

Issue 1417003003: [tracing] Dump child processes' memory metrics in browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web_cache2_base
Patch Set: Nits. Created 5 years, 1 month 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: base/trace_event/process_memory_totals_dump_provider.h
diff --git a/base/trace_event/process_memory_totals_dump_provider.h b/base/trace_event/process_memory_totals_dump_provider.h
index 66d4f9956dd5b9144f2352f55209a249e8742017..094bef37da08feb2b13e036275e509173c89e414 100644
--- a/base/trace_event/process_memory_totals_dump_provider.h
+++ b/base/trace_event/process_memory_totals_dump_provider.h
@@ -19,7 +19,13 @@ namespace trace_event {
// Dump provider which collects process-wide memory stats.
class BASE_EXPORT ProcessMemoryTotalsDumpProvider : public MemoryDumpProvider {
public:
- static ProcessMemoryTotalsDumpProvider* GetInstance();
+ // Creates a dump provider for a child process with |process_id|.
+ // Note: Current Process should be able to access process metrics of the
+ // process, else this method returns empty ptr.
+ static scoped_ptr<ProcessMemoryTotalsDumpProvider> CreateForProcess(
+ ProcessHandle process);
+
+ ~ProcessMemoryTotalsDumpProvider() override;
// MemoryDumpProvider implementation.
bool OnMemoryDump(const MemoryDumpArgs& args,
@@ -31,9 +37,9 @@ class BASE_EXPORT ProcessMemoryTotalsDumpProvider : public MemoryDumpProvider {
static uint64 rss_bytes_for_testing;
- ProcessMemoryTotalsDumpProvider();
- ~ProcessMemoryTotalsDumpProvider() override;
+ ProcessMemoryTotalsDumpProvider(ProcessHandle process);
+ ProcessHandle process_;
scoped_ptr<ProcessMetrics> process_metrics_;
DISALLOW_COPY_AND_ASSIGN(ProcessMemoryTotalsDumpProvider);

Powered by Google App Engine
This is Rietveld 408576698