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

Unified Diff: base/trace_event/heap_profiler_heap_dump_writer.h

Issue 1467453003: [Tracing] Make heap profiler type info a string (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 1 month 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
Index: base/trace_event/heap_profiler_heap_dump_writer.h
diff --git a/base/trace_event/heap_profiler_heap_dump_writer.h b/base/trace_event/heap_profiler_heap_dump_writer.h
index 4b99543375a3b47c88ec7740b52fc0aa374fdf58..c3a776739973b270d6c34f9d4bca8c0806ec8a07 100644
--- a/base/trace_event/heap_profiler_heap_dump_writer.h
+++ b/base/trace_event/heap_profiler_heap_dump_writer.h
@@ -16,8 +16,9 @@
namespace base {
namespace trace_event {
-class TracedValue;
class StackFrameDeduplicator;
+class TracedValue;
+class TypeNameDeduplicator;
// Helper class to dump a snapshot of an |AllocationRegister| or other heap
// bookkeeping structure into a |TracedValue|. This class is intended to be
@@ -26,9 +27,11 @@ class StackFrameDeduplicator;
// to do the processing and generate a heap dump value for the trace log.
class BASE_EXPORT HeapDumpWriter {
public:
- // The |StackFrameDeduplicator| is not owned. The heap dump writer assumes
- // exclusive access to it during the lifetime of the dump writer.
- HeapDumpWriter(StackFrameDeduplicator* stack_frame_deduplicator);
+ // The |StackFrameDeduplicator| and |TypeNameDeduplicator| are not owned. The
+ // heap dump writer assumes exclusive access to them during the lifetime of
+ // the dump writer.
+ HeapDumpWriter(StackFrameDeduplicator* stack_frame_deduplicator,
+ TypeNameDeduplicator* type_name_deduplicator);
~HeapDumpWriter();
// Inserts information from which the heap dump will be generated. This method
@@ -45,7 +48,7 @@ class BASE_EXPORT HeapDumpWriter {
void WriteStackFrameIndex(int index);
// Writes a "type" key with the stringified type ID.
- void WriteTypeId(AllocationContext::TypeId type_id);
+ void WriteTypeId(int type_id);
// Writes a "size" key with value |size| as a hexidecimal string to the traced
// value.
@@ -58,6 +61,10 @@ class BASE_EXPORT HeapDumpWriter {
// this heap dump writer instance.
StackFrameDeduplicator* const stack_frame_deduplicator_;
+ // Helper for converting type names to IDs. Not owned, must outlive this heap
+ // dump writer instance.
+ TypeNameDeduplicator* const type_name_deduplicator_;
+
// A map of allocation context to the number of bytes allocated for that
// context.
hash_map<AllocationContext, size_t> bytes_by_context_;
« no previous file with comments | « base/trace_event/heap_profiler_allocation_context_tracker.cc ('k') | base/trace_event/heap_profiler_heap_dump_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698