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 5d32c64952266475fcb440476febf208f618a39f..e70185d1ba3add70a0419f71c88bb84fbfebc023 100644 |
--- a/base/trace_event/heap_profiler_allocation_context_tracker.h |
+++ b/base/trace_event/heap_profiler_allocation_context_tracker.h |
@@ -58,6 +58,11 @@ class BASE_EXPORT AllocationContextTracker { |
// Pops a frame from the thread-local pseudo stack. |
void PopPseudoStackFrame(StackFrame frame); |
+ // Push and pop current task's context. A stack is used to support nested |
+ // tasks and the top of the stack will be used in allocation context. |
+ void PushCurrentTaskContext(const char* context); |
+ void PopCurrentTaskContext(const char* context); |
+ |
// Returns a snapshot of the current thread-local context. |
AllocationContext GetContextSnapshot(); |
@@ -74,6 +79,10 @@ class BASE_EXPORT AllocationContextTracker { |
// The thread name is used as the first entry in the pseudo stack. |
const char* thread_name_; |
+ // Stack of tasks' contexts. Context serves as a different dimension than |
+ // pseudo stack to cluster allocations. |
+ std::vector<const char*> task_contexts_; |
+ |
DISALLOW_COPY_AND_ASSIGN(AllocationContextTracker); |
}; |