summaryrefslogtreecommitdiffstats
path: root/base/trace_event
diff options
context:
space:
mode:
authorprimiano <primiano@chromium.org>2015-04-17 10:51:13 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-17 17:51:38 +0000
commitc6c220dd7f202326285a24bd12505423eebb6f3a (patch)
treeebae1b78091c100c957eae050fd7f2d738988106 /base/trace_event
parent6b292987e0b55c3fd03febd16f7a668ec00cdbb6 (diff)
downloadchromium_src-c6c220dd7f202326285a24bd12505423eebb6f3a.zip
chromium_src-c6c220dd7f202326285a24bd12505423eebb6f3a.tar.gz
chromium_src-c6c220dd7f202326285a24bd12505423eebb6f3a.tar.bz2
[tracing] Don't emit parent names for root MemoryAllocatorDump(s)
Small fix to make it so that root MemoryAllocatorDump(s) don't end up with a "parent":"" entry in the trace. BUG=466141 Review URL: https://codereview.chromium.org/1068443004 Cr-Commit-Position: refs/heads/master@{#325668}
Diffstat (limited to 'base/trace_event')
-rw-r--r--base/trace_event/memory_allocator_dump.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/base/trace_event/memory_allocator_dump.cc b/base/trace_event/memory_allocator_dump.cc
index 604af7a..a288ced 100644
--- a/base/trace_event/memory_allocator_dump.cc
+++ b/base/trace_event/memory_allocator_dump.cc
@@ -49,7 +49,9 @@ void MemoryAllocatorDump::AsValueInto(TracedValue* value) const {
value->BeginDictionary(name_.c_str());
- value->SetString("parent", parent_ ? parent_->name_ : "");
+ if (parent_)
+ value->SetString("parent", parent_->name_);
+
value->SetString("physical_size_in_bytes",
StringPrintf(kHexFmt, physical_size_in_bytes_));
value->SetString("allocated_objects_count",