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

Unified Diff: base/trace_event/process_memory_dump.h

Issue 2006943003: [tracing] Sanitize process memory dumps for background mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@whitelist_mdp
Patch Set: Created 4 years, 7 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/process_memory_dump.h
diff --git a/base/trace_event/process_memory_dump.h b/base/trace_event/process_memory_dump.h
index 51e4b5f5150a00f9fd563f8bfe6a3c827db2e3a7..cd555f3a2fb8855f191cf367618ee257182bb1c9 100644
--- a/base/trace_event/process_memory_dump.h
+++ b/base/trace_event/process_memory_dump.h
@@ -67,7 +67,8 @@ class BASE_EXPORT ProcessMemoryDump {
static size_t CountResidentBytes(void* start_address, size_t mapped_size);
#endif
- ProcessMemoryDump(scoped_refptr<MemoryDumpSessionState> session_state);
+ ProcessMemoryDump(scoped_refptr<MemoryDumpSessionState> session_state,
+ MemoryDumpLevelOfDetail level_of_detail);
Primiano Tucci (use gerrit) 2016/05/27 17:23:35 Oh right now you need the args here, makes sense.
ssid 2016/05/27 17:42:48 Yes I was thinking the same. Removing the args fro
ssid 2016/05/31 22:33:20 I think this change warrents for removal of the ar
~ProcessMemoryDump();
// Creates a new MemoryAllocatorDump with the given name and returns the
@@ -183,7 +184,10 @@ class BASE_EXPORT ProcessMemoryDump {
const HeapDumpsMap& heap_dumps() const { return heap_dumps_; }
+ MemoryDumpLevelOfDetail level_of_detail() const { return level_of_detail_; }
+
private:
+ FRIEND_TEST_ALL_PREFIXES(ProcessMemoryDumpTest, BackgroundModeTest);
MemoryAllocatorDump* AddAllocatorDumpInternal(
std::unique_ptr<MemoryAllocatorDump> mad);
@@ -202,6 +206,17 @@ class BASE_EXPORT ProcessMemoryDump {
// Keeps track of relationships between MemoryAllocatorDump(s).
std::vector<MemoryAllocatorDumpEdge> allocator_dumps_edges_;
+ // Level of detail of the current dump.
+ const MemoryDumpLevelOfDetail level_of_detail_;
+
+ // This dummy allocator dump is returned when an invalid dump is created in
+ // background mode. The attributes of the dump are not added to the trace.
+ std::unique_ptr<MemoryAllocatorDump> dummy_mad_;
Primiano Tucci (use gerrit) 2016/05/27 17:23:35 dummy feels it is for test, it's not the case. May
ssid 2016/05/31 22:33:20 Done.
+
+ // When non-null, only the strings matching this name are whitelisted for
+ // background mode.
+ const char* whitelisted_name_for_testing_;
Primiano Tucci (use gerrit) 2016/05/27 17:23:35 can we move this to the memory_infra_background_wh
ssid 2016/05/27 17:42:48 Okay I will make this change in this CL, while the
ssid 2016/05/31 22:33:20 Done.
+
DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump);
};

Powered by Google App Engine
This is Rietveld 408576698