Index: chrome/browser/chrome_browser_main.cc |
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc |
index 2fbad19680d929775e8c2076506e6afa5e606ba1..cd88e3bea5ec9024c44b6f55ac531c35b86c334e 100644 |
--- a/chrome/browser/chrome_browser_main.cc |
+++ b/chrome/browser/chrome_browser_main.cc |
@@ -14,6 +14,7 @@ |
#include <utility> |
#include <vector> |
+#include "base/allocator/features.h" |
#include "base/at_exit.h" |
#include "base/base_switches.h" |
#include "base/bind.h" |
@@ -1138,6 +1139,14 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { |
tracked_objects::ThreadData::PROFILING_ACTIVE; |
if (flag.compare("0") != 0) |
status = tracked_objects::ThreadData::DEACTIVATED; |
+ |
+#if BUILDFLAG(USE_EXPERIMENTAL_ALLOCATOR_SHIM) |
+ // If profiling is enabled and the heap shim is available, turn on heap |
+ // tracking as well. |
+ if (status != tracked_objects::ThreadData::DEACTIVATED) |
+ base::debug::HeapUsageTracker::EnableHeapTracking(); |
+#endif |
+ |
tracked_objects::ThreadData::InitializeAndSetTrackingStatus(status); |
} |