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

Unified Diff: base/trace_event/memory_dump_manager.cc

Issue 2273703003: Hook memory tracing into Windows heap shim. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cosmetics. Created 4 years, 4 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
« base/BUILD.gn ('K') | « base/trace_event/malloc_dump_provider.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/memory_dump_manager.cc
diff --git a/base/trace_event/memory_dump_manager.cc b/base/trace_event/memory_dump_manager.cc
index eed070a78292a4b045724d519c3c0a293ade377d..2eea04a4775c02dbc0d4d5aa7c22644b717cc034 100644
--- a/base/trace_event/memory_dump_manager.cc
+++ b/base/trace_event/memory_dump_manager.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include <utility>
+#include "base/allocator/features.h"
#include "base/atomic_sequence_num.h"
#include "base/base_switches.h"
#include "base/command_line.h"
@@ -111,7 +112,12 @@ const char* const MemoryDumpManager::kSystemAllocatorPoolName =
#if defined(MALLOC_MEMORY_TRACING_SUPPORTED)
MallocDumpProvider::kAllocatedObjects;
#elif defined(OS_WIN)
+// If the allocator shim is enabled, the malloc provider will do.
+#if BUILDFLAG(USE_EXPERIMENTAL_ALLOCATOR_SHIM)
+ MallocDumpProvider::kAllocatedObjects;
+#else
WinHeapDumpProvider::kAllocatedObjects;
+#endif
#else
nullptr;
#endif
@@ -207,8 +213,13 @@ void MemoryDumpManager::Initialize(MemoryDumpManagerDelegate* delegate,
#endif
#if defined(OS_WIN)
+// If the allocator shim is enabled, the malloc provider will do.
+#if BUILDFLAG(USE_EXPERIMENTAL_ALLOCATOR_SHIM)
+ RegisterDumpProvider(MallocDumpProvider::GetInstance(), "Malloc", nullptr);
+#else
RegisterDumpProvider(WinHeapDumpProvider::GetInstance(), "WinHeap", nullptr);
#endif
+#endif
// If tracing was enabled before initializing MemoryDumpManager, we missed the
// OnTraceLogEnabled() event. Synthetize it so we can late-join the party.
« base/BUILD.gn ('K') | « base/trace_event/malloc_dump_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698