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

Unified Diff: base/trace_event/heap_profiler.cc

Issue 1900223003: [tracing] Ignore tracing allocations in heap profiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make heap_profiler.h and rebase 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/heap_profiler.cc
diff --git a/base/trace_event/heap_profiler.cc b/base/trace_event/heap_profiler.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4814c68de0b922f580e71dd7de2eac832d2d58e2
--- /dev/null
+++ b/base/trace_event/heap_profiler.cc
@@ -0,0 +1,23 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/trace_event/heap_profiler.h"
+
+#include "base/compiler_specific.h"
+
+namespace trace_event_internal {
+
+HeapProfilerScopedIgnore::HeapProfilerScopedIgnore() {}
+
+HeapProfilerScopedIgnore::~HeapProfilerScopedIgnore() {
+ if (UNLIKELY(
+ base::trace_event::AllocationContextTracker::capture_enabled())) {
+ // The corresponding begin_ignore_scope is defined in the definition of
+ // HEAP_PROFILER_SCOPED_IGNORE in the header.
+ base::trace_event::AllocationContextTracker::GetInstanceForCurrentThread()
+ ->end_ignore_scope();
+ }
+}
+
+} // namespace trace_event_internal

Powered by Google App Engine
This is Rietveld 408576698