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

Unified Diff: content/child/child_thread_impl.cc

Issue 2713553002: mac: Periodically shim new malloc zones immediately after startup. (Closed)
Patch Set: Comments from primiano. Created 3 years, 9 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
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()),
« content/browser/browser_main_loop.cc ('K') | « content/browser/browser_main_loop.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698