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

Unified Diff: base/trace_event/memory_dump_provider.h

Issue 1262333005: [tracing] Introduce MemoryDumpArgs to enable light and heavy dumps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 4 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: base/trace_event/memory_dump_provider.h
diff --git a/base/trace_event/memory_dump_provider.h b/base/trace_event/memory_dump_provider.h
index 6e6551cc03988df685fb72d2e489e626ba583ab3..9fefdec5a4fd0a827017c3575b2567bd3538d612 100644
--- a/base/trace_event/memory_dump_provider.h
+++ b/base/trace_event/memory_dump_provider.h
@@ -13,15 +13,27 @@ namespace trace_event {
class ProcessMemoryDump;
+// Contains information about the type of memory dump the MemoryDumpProvider
+// should generate on dump request. This is to control the size of dumps
+// generated.
+struct MemoryDumpArgs {
+ enum LevelOfDetail { LEVEL_OF_DETAIL_LOW, LEVEL_OF_DETAIL_HIGH };
+
+ LevelOfDetail level_of_detail;
+};
+
// The contract interface that memory dump providers must implement.
class BASE_EXPORT MemoryDumpProvider {
public:
// Called by the MemoryDumpManager when generating memory dumps.
- // The embedder should return true if the |pmd| was successfully populated,
- // false if something went wrong and the dump should be considered invalid.
+ // The |args| specify if the embedder should generate light/heavy dumps on
+ // dump requests. The embedder should return true if the |pmd| was
+ // successfully populated, false if something went wrong and the dump should
+ // be considered invalid.
// (Note, the MemoryDumpManager has a fail-safe logic which will disable the
// MemoryDumpProvider for the entire trace session if it fails consistently).
- virtual bool OnMemoryDump(ProcessMemoryDump* pmd) = 0;
+ virtual bool OnMemoryDump(const MemoryDumpArgs& args,
+ ProcessMemoryDump* pmd) = 0;
protected:
MemoryDumpProvider() {}
« no previous file with comments | « base/trace_event/memory_dump_manager_unittest.cc ('k') | base/trace_event/process_memory_maps_dump_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698