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

Unified Diff: base/trace_event/process_memory_dump.h

Issue 1419633004: [Tracing] Introduce HeapDumpWriter helper class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nits Created 5 years, 2 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
« no previous file with comments | « base/trace_event/memory_profiler_heap_dump_writer.cc ('k') | base/trace_event/process_memory_dump.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « base/trace_event/memory_profiler_heap_dump_writer.cc ('k') | base/trace_event/process_memory_dump.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698