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

Unified Diff: base/trace_event/heap_profiler_heap_dump_writer.h

Issue 1911643002: Add configurable limit to allocations in heap profiler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moving to use session state Created 4 years, 8 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
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 88fb86f523ba0275afbf4839bde3dc46e64581b2..ea67309868c27bc3df925c543483988ef52af5a8 100644
--- a/base/trace_event/heap_profiler_heap_dump_writer.h
+++ b/base/trace_event/heap_profiler_heap_dump_writer.h
@@ -18,6 +18,7 @@
namespace base {
namespace trace_event {
+class MemoryDumpSessionState;
class StackFrameDeduplicator;
class TracedValue;
class TypeNameDeduplicator;
@@ -28,8 +29,7 @@ class TypeNameDeduplicator;
// number of entries is kept reasonable because long tails are not included.
BASE_EXPORT std::unique_ptr<TracedValue> ExportHeapDump(
const hash_map<AllocationContext, AllocationMetrics>& metrics_by_context,
- StackFrameDeduplicator* stack_frame_deduplicator,
- TypeNameDeduplicator* type_name_deduplicator);
+ const MemoryDumpSessionState& session_state);
namespace internal {
@@ -62,11 +62,10 @@ BASE_EXPORT std::unique_ptr<TracedValue> Serialize(const std::set<Entry>& dump);
// used as a one-shot local instance on the stack.
class BASE_EXPORT HeapDumpWriter {
public:
- // 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);
+ // The |session_state| is used to retrieve |stack_frame_deduplicator_| and
+ // |type_name_deduplicator_|, which are not owned. The heap dump writer
+ // assumes exclusive access to them during the lifetime of the dump writer.
+ HeapDumpWriter(const MemoryDumpSessionState& session_state);
~HeapDumpWriter();
@@ -97,6 +96,10 @@ class BASE_EXPORT HeapDumpWriter {
// dump writer instance.
TypeNameDeduplicator* const type_name_deduplicator_;
+ // Minimum size of an allocation for which an allocation bucket will be
+ // broken down with children.
+ uint32_t breakdown_threshold_bytes_;
+
DISALLOW_COPY_AND_ASSIGN(HeapDumpWriter);
};
« no previous file with comments | « no previous file | base/trace_event/heap_profiler_heap_dump_writer.cc » ('j') | base/trace_event/heap_profiler_heap_dump_writer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698