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 4f7d141104dd3342a26c3263aa2686bf1f20eb5f..3ce9c43118056f12924e558aef27b582d21e6ebf 100644 |
--- a/base/trace_event/process_memory_dump.h |
+++ b/base/trace_event/process_memory_dump.h |
@@ -30,6 +30,7 @@ namespace trace_event { |
class ConvertableToTraceFormat; |
class MemoryDumpManager; |
class MemoryDumpSessionState; |
+class TracedValue; |
// ProcessMemoryDump is as a strongly typed container which holds the dumps |
// produced by the MemoryDumpProvider(s) for a specific process. |
@@ -47,6 +48,9 @@ class BASE_EXPORT ProcessMemoryDump { |
using AllocatorDumpsMap = |
SmallMap<hash_map<std::string, MemoryAllocatorDump*>>; |
+ using HeapDumpsMap = |
+ SmallMap<hash_map<std::string, scoped_refptr<TracedValue>>>; |
+ |
#if defined(COUNT_RESIDENT_BYTES_SUPPORTED) |
// Returns the total bytes resident for a virtual address range, with given |
// |start_address| and |mapped_size|. |mapped_size| is specified in bytes. The |
@@ -95,6 +99,12 @@ class BASE_EXPORT ProcessMemoryDump { |
// Returns the map of the MemoryAllocatorDumps added to this dump. |
const AllocatorDumpsMap& allocator_dumps() const { return allocator_dumps_; } |
+ // Adds a heap dump for the allocator with |absolute_name|. The |TracedValue| |
+ // must have the correct format. |trace_event::HeapDumper| will generate such |
+ // a value from a |trace_event::AllocationRegister|. |
+ void AddHeapDump(const std::string& absolute_name, |
+ scoped_refptr<TracedValue> heap_dump); |
+ |
// Adds an ownership relationship between two MemoryAllocatorDump(s) with the |
// semantics: |source| owns |target|, and has the effect of attributing |
// the memory usage of |target| to |source|. |importance| is optional and |
@@ -155,6 +165,7 @@ class BASE_EXPORT ProcessMemoryDump { |
bool has_process_mmaps_; |
AllocatorDumpsMap allocator_dumps_; |
+ HeapDumpsMap heap_dumps_; |
// ProcessMemoryDump handles the memory ownership of all its belongings. |
ScopedVector<MemoryAllocatorDump> allocator_dumps_storage_; |