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 d6133323bfb3d8f88f4331f6c718582c5611b3ee..7265247efd48e5832279e61cab990bc924baab4d 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 is returned for these |
Primiano Tucci (use gerrit)
2016/04/21 19:47:31
I'd say:
A dummy context that short circuits to "t
ssid
2016/04/22 04:57:12
Done.
|
+ // allocations. |
+ void begin_ignore_scope() { ignore_scope_depth_++; } |
+ void end_ignore_scope() { |
+ DCHECK(ignore_scope_depth_); |
Primiano Tucci (use gerrit)
2016/04/21 19:47:31
thinking more I think you should remove the dcheck
ssid
2016/04/22 04:57:12
Makes sense. done.
|
+ ignore_scope_depth_--; |
+ } |
+ |
// Pushes a frame onto the thread-local pseudo stack. |
void PushPseudoStackFrame(StackFrame frame); |
@@ -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); |
}; |