OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_TRACE_EVENT_HEAP_PROFILER_H | 5 #ifndef BASE_TRACE_EVENT_HEAP_PROFILER_H |
6 #define BASE_TRACE_EVENT_HEAP_PROFILER_H | 6 #define BASE_TRACE_EVENT_HEAP_PROFILER_H |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/trace_event/heap_profiler_allocation_context_tracker.h" | 9 #include "base/trace_event/heap_profiler_allocation_context_tracker.h" |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 // tracing from the heap profiler dumps. | 26 // tracing from the heap profiler dumps. |
27 #define HEAP_PROFILER_SCOPED_IGNORE \ | 27 #define HEAP_PROFILER_SCOPED_IGNORE \ |
28 trace_event_internal::HeapProfilerScopedIgnore INTERNAL_HEAP_PROFILER_UID( \ | 28 trace_event_internal::HeapProfilerScopedIgnore INTERNAL_HEAP_PROFILER_UID( \ |
29 scoped_ignore) | 29 scoped_ignore) |
30 | 30 |
31 namespace trace_event_internal { | 31 namespace trace_event_internal { |
32 | 32 |
33 class BASE_EXPORT HeapProfilerScopedIgnore { | 33 class BASE_EXPORT HeapProfilerScopedIgnore { |
34 public: | 34 public: |
35 inline HeapProfilerScopedIgnore() { | 35 inline HeapProfilerScopedIgnore() { |
36 using base::trace_event::AllocationContextTracker; | |
37 if (UNLIKELY( | 36 if (UNLIKELY( |
38 AllocationContextTracker::capture_mode() != | 37 base::trace_event::AllocationContextTracker::capture_enabled())) { |
39 AllocationContextTracker::CaptureMode::DISABLED)) { | 38 base::trace_event::AllocationContextTracker::GetInstanceForCurrentThread() |
40 AllocationContextTracker::GetInstanceForCurrentThread() | |
41 ->begin_ignore_scope(); | 39 ->begin_ignore_scope(); |
42 } | 40 } |
43 } | 41 } |
44 inline ~HeapProfilerScopedIgnore() { | 42 inline ~HeapProfilerScopedIgnore() { |
45 using base::trace_event::AllocationContextTracker; | |
46 if (UNLIKELY( | 43 if (UNLIKELY( |
47 AllocationContextTracker::capture_mode() != | 44 base::trace_event::AllocationContextTracker::capture_enabled())) { |
48 AllocationContextTracker::CaptureMode::DISABLED)) { | 45 base::trace_event::AllocationContextTracker::GetInstanceForCurrentThread() |
49 AllocationContextTracker::GetInstanceForCurrentThread() | |
50 ->end_ignore_scope(); | 46 ->end_ignore_scope(); |
51 } | 47 } |
52 } | 48 } |
53 }; | 49 }; |
54 | 50 |
55 } // namespace trace_event_internal | 51 } // namespace trace_event_internal |
56 | 52 |
57 #endif // BASE_TRACE_EVENT_HEAP_PROFILER_H | 53 #endif // BASE_TRACE_EVENT_HEAP_PROFILER_H |
OLD | NEW |