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 454200c474ee32be54c15e234cfa1753a8e580ce..ae5f73af432bc9ecfb4aa87c8734238176490fe3 100644 |
--- a/base/trace_event/heap_profiler_allocation_context_tracker.h |
+++ b/base/trace_event/heap_profiler_allocation_context_tracker.h |
@@ -10,7 +10,6 @@ |
#include "base/atomicops.h" |
#include "base/base_export.h" |
#include "base/debug/stack_trace.h" |
-#include "base/logging.h" |
#include "base/macros.h" |
#include "base/trace_event/heap_profiler_allocation_context.h" |
@@ -30,6 +29,17 @@ class BASE_EXPORT AllocationContextTracker { |
NATIVE_STACK // GetContextSnapshot() returns native (real) stack trace |
}; |
+ // Stack frame constructed from trace events in codebase. |
+ struct BASE_EXPORT PseudoStackFrame { |
+ const char* trace_event_category; |
+ const char* trace_event_name; |
+ |
+ bool operator==(const PseudoStackFrame& other) const { |
+ return trace_event_category == other.trace_event_category && |
+ trace_event_name == other.trace_event_name; |
+ } |
+ }; |
+ |
// Globally sets capturing mode. |
// TODO(primiano): How to guard against *_STACK -> DISABLED -> *_STACK? |
static void SetCaptureMode(CaptureMode mode); |
@@ -69,10 +79,10 @@ class BASE_EXPORT AllocationContextTracker { |
} |
// Pushes a frame onto the thread-local pseudo stack. |
- void PushPseudoStackFrame(const char* trace_event_name); |
+ void PushPseudoStackFrame(PseudoStackFrame stack_frame); |
// Pops a frame from the thread-local pseudo stack. |
- void PopPseudoStackFrame(const char* trace_event_name); |
+ void PopPseudoStackFrame(PseudoStackFrame stack_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. |
@@ -90,7 +100,7 @@ class BASE_EXPORT AllocationContextTracker { |
static subtle::Atomic32 capture_mode_; |
// The pseudo stack where frames are |TRACE_EVENT| names. |
- std::vector<const char*> pseudo_stack_; |
+ std::vector<PseudoStackFrame> pseudo_stack_; |
// The thread name is used as the first entry in the pseudo stack. |
const char* thread_name_; |