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

Side by Side Diff: content/child/child_thread_impl.cc

Issue 2802493002: Revert of mac: Periodically shim new malloc zones immediately after startup. (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/child/child_thread_impl.h" 5 #include "content/child/child_thread_impl.h"
6 6
7 #include <signal.h> 7 #include <signal.h>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 #include "services/service_manager/public/cpp/interface_factory.h" 72 #include "services/service_manager/public/cpp/interface_factory.h"
73 #include "services/service_manager/public/cpp/interface_provider.h" 73 #include "services/service_manager/public/cpp/interface_provider.h"
74 #include "services/service_manager/public/cpp/interface_registry.h" 74 #include "services/service_manager/public/cpp/interface_registry.h"
75 #include "services/service_manager/runner/common/client_util.h" 75 #include "services/service_manager/runner/common/client_util.h"
76 76
77 #if defined(OS_POSIX) 77 #if defined(OS_POSIX)
78 #include "base/posix/global_descriptors.h" 78 #include "base/posix/global_descriptors.h"
79 #include "content/public/common/content_descriptors.h" 79 #include "content/public/common/content_descriptors.h"
80 #endif 80 #endif
81 81
82 #if defined(OS_MACOSX)
83 #include "base/allocator/allocator_interception_mac.h"
84 #endif
85
86 using tracked_objects::ThreadData; 82 using tracked_objects::ThreadData;
87 83
88 namespace content { 84 namespace content {
89 namespace { 85 namespace {
90 86
91 // How long to wait for a connection to the browser process before giving up. 87 // How long to wait for a connection to the browser process before giving up.
92 const int kConnectionTimeoutS = 15; 88 const int kConnectionTimeoutS = 15;
93 89
94 base::LazyInstance<base::ThreadLocalPointer<ChildThreadImpl>>::DestructorAtExit 90 base::LazyInstance<base::ThreadLocalPointer<ChildThreadImpl>>::DestructorAtExit
95 g_lazy_tls = LAZY_INSTANCE_INITIALIZER; 91 g_lazy_tls = LAZY_INSTANCE_INITIALIZER;
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 int connection_timeout = kConnectionTimeoutS; 552 int connection_timeout = kConnectionTimeoutS;
557 std::string connection_override = 553 std::string connection_override =
558 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 554 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
559 switches::kIPCConnectionTimeout); 555 switches::kIPCConnectionTimeout);
560 if (!connection_override.empty()) { 556 if (!connection_override.empty()) {
561 int temp; 557 int temp;
562 if (base::StringToInt(connection_override, &temp)) 558 if (base::StringToInt(connection_override, &temp))
563 connection_timeout = temp; 559 connection_timeout = temp;
564 } 560 }
565 561
566 #if defined(OS_MACOSX)
567 if (base::CommandLine::InitializedForCurrentProcess() &&
568 base::CommandLine::ForCurrentProcess()->HasSwitch(
569 switches::kEnableHeapProfiling)) {
570 base::allocator::PeriodicallyShimNewMallocZones();
571 }
572 #endif
573
574 message_loop_->task_runner()->PostDelayedTask( 562 message_loop_->task_runner()->PostDelayedTask(
575 FROM_HERE, base::Bind(&ChildThreadImpl::EnsureConnected, 563 FROM_HERE, base::Bind(&ChildThreadImpl::EnsureConnected,
576 channel_connected_factory_->GetWeakPtr()), 564 channel_connected_factory_->GetWeakPtr()),
577 base::TimeDelta::FromSeconds(connection_timeout)); 565 base::TimeDelta::FromSeconds(connection_timeout));
578 566
579 #if defined(OS_ANDROID) 567 #if defined(OS_ANDROID)
580 g_quit_closure.Get().BindToMainThread(); 568 g_quit_closure.Get().BindToMainThread();
581 #endif 569 #endif
582 } 570 }
583 571
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 connected_to_browser_ = true; 875 connected_to_browser_ = true;
888 child_info_ = local_info; 876 child_info_ = local_info;
889 browser_info_ = remote_info; 877 browser_info_ = remote_info;
890 } 878 }
891 879
892 bool ChildThreadImpl::IsInBrowserProcess() const { 880 bool ChildThreadImpl::IsInBrowserProcess() const {
893 return static_cast<bool>(browser_process_io_runner_); 881 return static_cast<bool>(browser_process_io_runner_);
894 } 882 }
895 883
896 } // namespace content 884 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698