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

Unified Diff: base/trace_event/memory_allocator_dump.cc

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/memory_allocator_dump.cc
diff --git a/base/trace_event/memory_allocator_dump.cc b/base/trace_event/memory_allocator_dump.cc
index f9b5799c05eb04b388e37dd6d7858d554990a65a..56470d800af8a8374f65b38d6f8a8144733b01a5 100644
--- a/base/trace_event/memory_allocator_dump.cc
+++ b/base/trace_event/memory_allocator_dump.cc
@@ -80,6 +80,12 @@ void MemoryAllocatorDump::AddScalarF(const char* name,
void MemoryAllocatorDump::AddString(const char* name,
const char* units,
const std::string& value) {
+ // String attributes are disabled in background mode.
+ if (process_memory_dump_->level_of_detail() ==
+ MemoryDumpLevelOfDetail::BACKGROUND) {
Primiano Tucci (use gerrit) 2016/05/27 17:23:35 I wonder if we want also a NOTREACHED() here so we
ssid 2016/05/31 22:33:20 Done.
+ return;
+ }
+
attributes_->BeginDictionary(name);
attributes_->SetString("type", kTypeString);
attributes_->SetString("units", units);
« no previous file with comments | « no previous file | base/trace_event/memory_allocator_dump_unittest.cc » ('j') | base/trace_event/process_memory_dump.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698