Index: base/trace_event/heap_profiler_allocation_context_tracker.h |
diff --git a/base/trace_event/heap_profiler_allocation_context_tracker.h b/base/trace_event/heap_profiler_allocation_context_tracker.h |
index e5c8c187739b99afaa0f75995b1a534dd14a2e4d..632a4eface8740a9415337c41c6d9874fb107367 100644 |
--- a/base/trace_event/heap_profiler_allocation_context_tracker.h |
+++ b/base/trace_event/heap_profiler_allocation_context_tracker.h |
@@ -52,6 +52,15 @@ class BASE_EXPORT AllocationContextTracker { |
// if capture is enabled. |
static void SetCurrentThreadName(const char* name); |
+ // Starts and ends a new ignore scope between which the allocations are |
+ // ignored in the heap profiler. A dummy context that short circuits to |
+ // "tracing_overhead" is returned for these allocations. |
+ void begin_ignore_scope() { ignore_scope_depth_++; } |
+ void end_ignore_scope() { |
+ if (ignore_scope_depth_) |
+ ignore_scope_depth_--; |
+ } |
+ |
// Pushes a frame onto the thread-local pseudo stack. |
void PushPseudoStackFrame(const char* trace_event_name); |
@@ -83,6 +92,8 @@ class BASE_EXPORT AllocationContextTracker { |
// pseudo stack to cluster allocations. |
std::vector<const char*> task_contexts_; |
+ uint32_t ignore_scope_depth_; |
+ |
DISALLOW_COPY_AND_ASSIGN(AllocationContextTracker); |
}; |