Chromium Code Reviews| 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..28e2cc9ca934b5c0bddf77c9f99727cbd094252e 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); |
|
Primiano Tucci (use gerrit)
2016/03/31 15:37:16
I aware about the fact that I am a real pain on na
ssid
2016/03/31 16:02:49
Yes but I feel this will be reused for some other
Primiano Tucci (use gerrit)
2016/03/31 16:10:59
Ahh ok, if you have upcoming use cases in mind it'
ssid
2016/04/01 04:34:54
I changed the comment and function name. wdyt?
Primiano Tucci (use gerrit)
2016/04/01 08:36:16
Much better, thanks.
|
| + 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 study the heap. |
|
Primiano Tucci (use gerrit)
2016/03/31 15:37:16
s/to study the heap/to cluster allocations/
ssid
2016/04/01 04:34:54
Done.
|
| + std::vector<const char*> task_contexts_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(AllocationContextTracker); |
| }; |