Index: base/trace_event/process_memory_dump.cc |
diff --git a/base/trace_event/process_memory_dump.cc b/base/trace_event/process_memory_dump.cc |
index fab111f6da03858c353c98d66c5d348339cb09f1..289baacc6ebd175869048b918f6e1da0277f26eb 100644 |
--- a/base/trace_event/process_memory_dump.cc |
+++ b/base/trace_event/process_memory_dump.cc |
@@ -144,6 +144,11 @@ MemoryAllocatorDump* ProcessMemoryDump::GetSharedGlobalAllocatorDump( |
return GetAllocatorDump(GetSharedGlobalAllocatorDumpName(guid)); |
} |
+void ProcessMemoryDump::AddHeapDump(const std::string& absolute_name, |
+ scoped_refptr<TracedValue> heap_dump) { |
+ heap_dumps_[absolute_name] = heap_dump; |
Primiano Tucci (use gerrit)
2015/10/26 11:52:07
add a DCHECK_EQ(0u, heap_dumps_.count(absolute_nam
Ruud van Asseldonk
2015/10/26 14:51:27
Done.
|
+} |
+ |
void ProcessMemoryDump::Clear() { |
if (has_process_totals_) { |
process_totals_.Clear(); |
@@ -158,6 +163,7 @@ void ProcessMemoryDump::Clear() { |
allocator_dumps_storage_.clear(); |
allocator_dumps_.clear(); |
allocator_dumps_edges_.clear(); |
+ heap_dumps_.clear(); |
} |
void ProcessMemoryDump::TakeAllDumpsFrom(ProcessMemoryDump* other) { |
@@ -179,6 +185,9 @@ void ProcessMemoryDump::TakeAllDumpsFrom(ProcessMemoryDump* other) { |
other->allocator_dumps_edges_.begin(), |
other->allocator_dumps_edges_.end()); |
other->allocator_dumps_edges_.clear(); |
+ |
+ heap_dumps_.insert(other->heap_dumps_.begin(), other->heap_dumps_.end()); |
+ other->heap_dumps_.clear(); |
} |
void ProcessMemoryDump::AsValueInto(TracedValue* value) const { |
@@ -201,6 +210,13 @@ void ProcessMemoryDump::AsValueInto(TracedValue* value) const { |
value->EndDictionary(); |
} |
+ if (heap_dumps_.size() > 0) { |
+ value->BeginDictionary("heap_dumps"); |
+ for (auto name_and_dump : heap_dumps_) |
Primiano Tucci (use gerrit)
2015/10/26 11:52:07
const auto& ?
Ruud van Asseldonk
2015/10/26 14:51:27
Done.
|
+ value->SetValueWithCopiedName(name_and_dump.first, *name_and_dump.second); |
+ value->EndDictionary(); // heap_dumps |
+ } |
+ |
value->BeginArray("allocators_graph"); |
for (const MemoryAllocatorDumpEdge& edge : allocator_dumps_edges_) { |
value->BeginDictionary(); |