Index: content/browser/browser_main_loop.cc |
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc |
index 519d13f4258d88f56fc575160a4ee603b7ab6110..2a9b722d80441eb04620d0a4e7ba9350e4feaeab 100644 |
--- a/content/browser/browser_main_loop.cc |
+++ b/content/browser/browser_main_loop.cc |
@@ -135,6 +135,7 @@ |
#endif |
#if defined(OS_MACOSX) |
+#include "base/allocator/allocator_interception_mac.h" |
#include "base/memory/memory_pressure_monitor_mac.h" |
#include "content/browser/bootstrap_sandbox_manager_mac.h" |
#include "content/browser/cocoa/system_hotkey_helper_mac.h" |
@@ -860,6 +861,14 @@ int BrowserMainLoop::PreCreateThreads() { |
if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) |
MemoryCoordinatorImpl::GetInstance()->Start(); |
+#if defined(OS_MACOSX) |
+ if (CommandLine::InitializedForCurrentProcess() && |
Mark Mentovai
2017/04/03 12:10:23
Untested code. Sad compiler.
|
+ CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableHeapProfiling)) { |
+ base::allocator::PeriodicallyShimNewMallocZones(); |
+ } |
+#endif |
+ |
#if BUILDFLAG(ENABLE_PLUGINS) |
// Prior to any processing happening on the IO thread, we create the |
// plugin service as it is predominantly used from the IO thread, |