diff options
Diffstat (limited to 'base/trace_event/heap_profiler_allocation_context_tracker.h')
-rw-r--r-- | base/trace_event/heap_profiler_allocation_context_tracker.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/base/trace_event/heap_profiler_allocation_context_tracker.h b/base/trace_event/heap_profiler_allocation_context_tracker.h index 9c9a313..20a6e30 100644 --- a/base/trace_event/heap_profiler_allocation_context_tracker.h +++ b/base/trace_event/heap_profiler_allocation_context_tracker.h @@ -43,22 +43,25 @@ class BASE_EXPORT AllocationContextTracker { return subtle::Acquire_Load(&capture_enabled_) != 0; } + // Returns the thread-local instance, creating one if necessary. Returns + // always a valid instance, unless it is called re-entrantly, in which case + // returns nullptr in the nested calls. + static AllocationContextTracker* GetInstanceForCurrentThread(); + // Pushes a frame onto the thread-local pseudo stack. - static void PushPseudoStackFrame(StackFrame frame); + void PushPseudoStackFrame(StackFrame frame); // Pops a frame from the thread-local pseudo stack. - static void PopPseudoStackFrame(StackFrame frame); + void PopPseudoStackFrame(StackFrame frame); // Returns a snapshot of the current thread-local context. - static AllocationContext GetContextSnapshot(); + AllocationContext GetContextSnapshot(); ~AllocationContextTracker(); private: AllocationContextTracker(); - static AllocationContextTracker* GetThreadLocalTracker(); - static subtle::Atomic32 capture_enabled_; // The pseudo stack where frames are |TRACE_EVENT| names. |