Index: content/child/child_thread_impl.cc |
diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc |
index f91f11f74e38def29aed7e45a9dae7bb2297e870..bc9cd223e067513cb41790060c7836e5bf81b648 100644 |
--- a/content/child/child_thread_impl.cc |
+++ b/content/child/child_thread_impl.cc |
@@ -79,6 +79,10 @@ |
#include "content/public/common/content_descriptors.h" |
#endif |
+#if defined(OS_MACOSX) |
+#include "base/allocator/allocator_interception_mac.h" |
+#endif |
+ |
using tracked_objects::ThreadData; |
namespace content { |
@@ -559,6 +563,14 @@ void ChildThreadImpl::Init(const Options& options) { |
connection_timeout = temp; |
} |
+#if defined(OS_MACOSX) |
+ if (CommandLine::InitializedForCurrentProcess() && |
+ CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableHeapProfiling)) { |
+ base::allocator::PeriodicallyShimNewMallocZones(); |
+ } |
+#endif |
+ |
message_loop_->task_runner()->PostDelayedTask( |
FROM_HERE, base::Bind(&ChildThreadImpl::EnsureConnected, |
channel_connected_factory_->GetWeakPtr()), |