Chromium Code Reviews| 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 0a7ca6d6153765ef6640147cd64d1ed42985aa8a..9f4bca20b90ed504815e474e7c52a84c570b8b9d 100644 |
| --- a/base/trace_event/process_memory_dump.cc |
| +++ b/base/trace_event/process_memory_dump.cc |
| @@ -145,6 +145,12 @@ MemoryAllocatorDump* ProcessMemoryDump::GetSharedGlobalAllocatorDump( |
| return GetAllocatorDump(GetSharedGlobalAllocatorDumpName(guid)); |
| } |
| +void ProcessMemoryDump::AddHeapDump(const std::string& absolute_name, |
| + scoped_refptr<TracedValue> heap_dump) { |
| + DCHECK_EQ(0ul, heap_dumps_.count(absolute_name)); |
| + heap_dumps_[absolute_name] = heap_dump; |
| +} |
| + |
| void ProcessMemoryDump::Clear() { |
| if (has_process_totals_) { |
| process_totals_.Clear(); |
| @@ -159,6 +165,7 @@ void ProcessMemoryDump::Clear() { |
| allocator_dumps_storage_.clear(); |
| allocator_dumps_.clear(); |
| allocator_dumps_edges_.clear(); |
| + heap_dumps_.clear(); |
| } |
| void ProcessMemoryDump::TakeAllDumpsFrom(ProcessMemoryDump* other) { |
| @@ -180,6 +187,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 { |
| @@ -202,6 +212,13 @@ void ProcessMemoryDump::AsValueInto(TracedValue* value) const { |
| value->EndDictionary(); |
| } |
| + if (heap_dumps_.size() > 0) { |
| + value->BeginDictionary("heap_dumps"); |
|
Primiano Tucci (use gerrit)
2015/10/26 20:57:57
I thought you were going to call this "heaps" ?
Ruud van Asseldonk
2015/10/27 10:50:18
See patchset 7.
|
| + for (const auto& name_and_dump : heap_dumps_) |
| + value->SetValueWithCopiedName(name_and_dump.first, *name_and_dump.second); |
|
Primiano Tucci (use gerrit)
2015/10/26 20:57:57
and have a "entries" here?
Ruud van Asseldonk
2015/10/27 10:50:18
See patchset 7. (Entries are written by the |HeapD
|
| + value->EndDictionary(); // heap_dumps |
| + } |
| + |
| value->BeginArray("allocators_graph"); |
| for (const MemoryAllocatorDumpEdge& edge : allocator_dumps_edges_) { |
| value->BeginDictionary(); |