| OLD | NEW |
| 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 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #include "content/child/push_messaging/push_dispatcher.h" | 46 #include "content/child/push_messaging/push_dispatcher.h" |
| 47 #include "content/child/quota_dispatcher.h" | 47 #include "content/child/quota_dispatcher.h" |
| 48 #include "content/child/quota_message_filter.h" | 48 #include "content/child/quota_message_filter.h" |
| 49 #include "content/child/resource_dispatcher.h" | 49 #include "content/child/resource_dispatcher.h" |
| 50 #include "content/child/service_worker/service_worker_message_filter.h" | 50 #include "content/child/service_worker/service_worker_message_filter.h" |
| 51 #include "content/child/thread_safe_sender.h" | 51 #include "content/child/thread_safe_sender.h" |
| 52 #include "content/child/websocket_dispatcher.h" | 52 #include "content/child/websocket_dispatcher.h" |
| 53 #include "content/common/child_process_messages.h" | 53 #include "content/common/child_process_messages.h" |
| 54 #include "content/common/in_process_child_thread_params.h" | 54 #include "content/common/in_process_child_thread_params.h" |
| 55 #include "content/public/common/content_switches.h" | 55 #include "content/public/common/content_switches.h" |
| 56 #include "ipc/attachment_broker.h" | 56 #include "ipc/attachment_broker_unprivileged.h" |
| 57 #include "ipc/ipc_logging.h" | 57 #include "ipc/ipc_logging.h" |
| 58 #include "ipc/ipc_switches.h" | 58 #include "ipc/ipc_switches.h" |
| 59 #include "ipc/ipc_sync_channel.h" | 59 #include "ipc/ipc_sync_channel.h" |
| 60 #include "ipc/ipc_sync_message_filter.h" | 60 #include "ipc/ipc_sync_message_filter.h" |
| 61 #include "ipc/mojo/ipc_channel_mojo.h" | 61 #include "ipc/mojo/ipc_channel_mojo.h" |
| 62 | 62 |
| 63 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) | 63 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) |
| 64 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h" | 64 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h" |
| 65 #endif | 65 #endif |
| 66 | 66 |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 #if defined(OS_MACOSX) | 429 #if defined(OS_MACOSX) |
| 430 channel_->AddFilter(new IOSurfaceManagerFilter()); | 430 channel_->AddFilter(new IOSurfaceManagerFilter()); |
| 431 #endif | 431 #endif |
| 432 | 432 |
| 433 // Add filters passed here via options. | 433 // Add filters passed here via options. |
| 434 for (auto startup_filter : options.startup_filters) { | 434 for (auto startup_filter : options.startup_filters) { |
| 435 channel_->AddFilter(startup_filter); | 435 channel_->AddFilter(startup_filter); |
| 436 } | 436 } |
| 437 | 437 |
| 438 ConnectChannel(options.use_mojo_channel); | 438 ConnectChannel(options.use_mojo_channel); |
| 439 if (attachment_broker_) |
| 440 attachment_broker_->set_sender(channel_.get()); |
| 439 | 441 |
| 440 int connection_timeout = kConnectionTimeoutS; | 442 int connection_timeout = kConnectionTimeoutS; |
| 441 std::string connection_override = | 443 std::string connection_override = |
| 442 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 444 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 443 switches::kIPCConnectionTimeout); | 445 switches::kIPCConnectionTimeout); |
| 444 if (!connection_override.empty()) { | 446 if (!connection_override.empty()) { |
| 445 int temp; | 447 int temp; |
| 446 if (base::StringToInt(connection_override, &temp)) | 448 if (base::StringToInt(connection_override, &temp)) |
| 447 connection_timeout = temp; | 449 connection_timeout = temp; |
| 448 } | 450 } |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 | 711 |
| 710 void ChildThreadImpl::OnProcessBackgrounded(bool background) { | 712 void ChildThreadImpl::OnProcessBackgrounded(bool background) { |
| 711 // Set timer slack to maximum on main thread when in background. | 713 // Set timer slack to maximum on main thread when in background. |
| 712 base::TimerSlack timer_slack = base::TIMER_SLACK_NONE; | 714 base::TimerSlack timer_slack = base::TIMER_SLACK_NONE; |
| 713 if (background) | 715 if (background) |
| 714 timer_slack = base::TIMER_SLACK_MAXIMUM; | 716 timer_slack = base::TIMER_SLACK_MAXIMUM; |
| 715 base::MessageLoop::current()->SetTimerSlack(timer_slack); | 717 base::MessageLoop::current()->SetTimerSlack(timer_slack); |
| 716 } | 718 } |
| 717 | 719 |
| 718 } // namespace content | 720 } // namespace content |
| OLD | NEW |