Index: base/trace_event/trace_log.cc |
diff --git a/base/trace_event/trace_log.cc b/base/trace_event/trace_log.cc |
index dcedb4477563028eb2510c4a1430800d35b5bcb5..3b1d2c9bb2f5dc5ca05100010a96ac6e07bdcfd5 100644 |
--- a/base/trace_event/trace_log.cc |
+++ b/base/trace_event/trace_log.cc |
@@ -1318,12 +1318,14 @@ TraceEventHandle TraceLog::AddTraceEventWithThreadIdAndTimestamp( |
if (!(flags & TRACE_EVENT_FLAG_COPY)) { |
if (AllocationContextTracker::capture_enabled()) { |
if (phase == TRACE_EVENT_PHASE_BEGIN || |
- phase == TRACE_EVENT_PHASE_COMPLETE) |
- AllocationContextTracker::PushPseudoStackFrame(name); |
- else if (phase == TRACE_EVENT_PHASE_END) |
+ phase == TRACE_EVENT_PHASE_COMPLETE) { |
+ AllocationContextTracker::GetInstanceForCurrentThread() |
+ ->PushPseudoStackFrame(name); |
+ } else if (phase == TRACE_EVENT_PHASE_END) |
// The pop for |TRACE_EVENT_PHASE_COMPLETE| events |
// is in |TraceLog::UpdateTraceEventDuration|. |
- AllocationContextTracker::PopPseudoStackFrame(name); |
+ AllocationContextTracker::GetInstanceForCurrentThread() |
+ ->PopPseudoStackFrame(name); |
} |
} |
@@ -1447,7 +1449,8 @@ void TraceLog::UpdateTraceEventDuration( |
if (base::trace_event::AllocationContextTracker::capture_enabled()) { |
// The corresponding push is in |AddTraceEventWithThreadIdAndTimestamp|. |
- base::trace_event::AllocationContextTracker::PopPseudoStackFrame(name); |
+ base::trace_event::AllocationContextTracker::GetInstanceForCurrentThread() |
+ ->PopPseudoStackFrame(name); |
} |
} |