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

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

Issue 2713553002: mac: Periodically shim new malloc zones immediately after startup. (Closed)
Patch Set: disable test on asan. 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
82 using tracked_objects::ThreadData; 86 using tracked_objects::ThreadData;
83 87
84 namespace content { 88 namespace content {
85 namespace { 89 namespace {
86 90
87 // How long to wait for a connection to the browser process before giving up. 91 // How long to wait for a connection to the browser process before giving up.
88 const int kConnectionTimeoutS = 15; 92 const int kConnectionTimeoutS = 15;
89 93
90 base::LazyInstance<base::ThreadLocalPointer<ChildThreadImpl>>::DestructorAtExit 94 base::LazyInstance<base::ThreadLocalPointer<ChildThreadImpl>>::DestructorAtExit
91 g_lazy_tls = LAZY_INSTANCE_INITIALIZER; 95 g_lazy_tls = LAZY_INSTANCE_INITIALIZER;
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 int connection_timeout = kConnectionTimeoutS; 556 int connection_timeout = kConnectionTimeoutS;
553 std::string connection_override = 557 std::string connection_override =
554 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 558 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
555 switches::kIPCConnectionTimeout); 559 switches::kIPCConnectionTimeout);
556 if (!connection_override.empty()) { 560 if (!connection_override.empty()) {
557 int temp; 561 int temp;
558 if (base::StringToInt(connection_override, &temp)) 562 if (base::StringToInt(connection_override, &temp))
559 connection_timeout = temp; 563 connection_timeout = temp;
560 } 564 }
561 565
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
562 message_loop_->task_runner()->PostDelayedTask( 574 message_loop_->task_runner()->PostDelayedTask(
563 FROM_HERE, base::Bind(&ChildThreadImpl::EnsureConnected, 575 FROM_HERE, base::Bind(&ChildThreadImpl::EnsureConnected,
564 channel_connected_factory_->GetWeakPtr()), 576 channel_connected_factory_->GetWeakPtr()),
565 base::TimeDelta::FromSeconds(connection_timeout)); 577 base::TimeDelta::FromSeconds(connection_timeout));
566 578
567 #if defined(OS_ANDROID) 579 #if defined(OS_ANDROID)
568 g_quit_closure.Get().BindToMainThread(); 580 g_quit_closure.Get().BindToMainThread();
569 #endif 581 #endif
570 } 582 }
571 583
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 connected_to_browser_ = true; 887 connected_to_browser_ = true;
876 child_info_ = local_info; 888 child_info_ = local_info;
877 browser_info_ = remote_info; 889 browser_info_ = remote_info;
878 } 890 }
879 891
880 bool ChildThreadImpl::IsInBrowserProcess() const { 892 bool ChildThreadImpl::IsInBrowserProcess() const {
881 return static_cast<bool>(browser_process_io_runner_); 893 return static_cast<bool>(browser_process_io_runner_);
882 } 894 }
883 895
884 } // namespace content 896 } // 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