Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1737)

Unified Diff: base/trace_event/trace_event.h

Issue 1839503002: [tracing] Add native allocation tracing mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/trace_event/trace_event.h
diff --git a/base/trace_event/trace_event.h b/base/trace_event/trace_event.h
index ef452f642f2ee7f419d0f213a77180a05accbc7d..68ae71ef946ba75d3d2175dcfd83def5f8b3be92 100644
--- a/base/trace_event/trace_event.h
+++ b/base/trace_event/trace_event.h
@@ -1056,17 +1056,21 @@ class ScopedTaskExecutionEvent {
public:
explicit ScopedTaskExecutionEvent(const char* task_context)
: context_(task_context) {
+ using namespace base::trace_event;
Primiano Tucci (use gerrit) 2016/04/21 20:08:21 Just using base::trace_event::AllocationContextTra
Dmitry Skiba 2016/04/22 06:31:15 Done.
if (UNLIKELY(
- base::trace_event::AllocationContextTracker::capture_enabled())) {
- base::trace_event::AllocationContextTracker::GetInstanceForCurrentThread()
+ AllocationContextTracker::capture_mode() !=
+ AllocationContextTracker::CaptureMode::DISABLED)) {
+ AllocationContextTracker::GetInstanceForCurrentThread()
->PushCurrentTaskContext(context_);
}
}
~ScopedTaskExecutionEvent() {
+ using namespace base::trace_event;
if (UNLIKELY(
- base::trace_event::AllocationContextTracker::capture_enabled())) {
- base::trace_event::AllocationContextTracker::GetInstanceForCurrentThread()
+ AllocationContextTracker::capture_mode() !=
+ AllocationContextTracker::CaptureMode::DISABLED)) {
+ AllocationContextTracker::GetInstanceForCurrentThread()
->PopCurrentTaskContext(context_);
}
}

Powered by Google App Engine
This is Rietveld 408576698