Index: base/trace_event/malloc_dump_provider.cc |
diff --git a/base/trace_event/malloc_dump_provider.cc b/base/trace_event/malloc_dump_provider.cc |
index 17e5c1e62074f95720442ee3b49a944607b490bf..cc26b5254cd9d38840c2b4a75c6fd6dea065555a 100644 |
--- a/base/trace_event/malloc_dump_provider.cc |
+++ b/base/trace_event/malloc_dump_provider.cc |
@@ -85,6 +85,21 @@ AllocatorDispatch g_allocator_hooks = { |
} // namespace |
#endif // BUILDFLAG(USE_EXPERIMENTAL_ALLOCATOR_SHIM) |
+MallocDumpProvider::ScopedHeapProfilerIgnoreMalloc:: |
+ ScopedHeapProfilerIgnoreMalloc() { |
+ if (UNLIKELY(AllocationContextTracker::capture_enabled())) { |
+ AllocationContextTracker::GetInstanceForCurrentThread() |
+ ->start_ignore_scope(); |
+ } |
+} |
+ |
+MallocDumpProvider::ScopedHeapProfilerIgnoreMalloc:: |
+ ~ScopedHeapProfilerIgnoreMalloc() { |
+ if (UNLIKELY(AllocationContextTracker::capture_enabled())) { |
+ AllocationContextTracker::GetInstanceForCurrentThread()->end_ignore_scope(); |
+ } |
+} |
+ |
// static |
const char MallocDumpProvider::kAllocatedObjects[] = "malloc/allocated_objects"; |