| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| 67 #if defined(OS_MACOSX) | 67 #if defined(OS_MACOSX) |
| 68 #include "content/child/child_io_surface_manager_mac.h" | 68 #include "content/child/child_io_surface_manager_mac.h" |
| 69 #endif | 69 #endif |
| 70 | 70 |
| 71 #if defined(OS_WIN) | 71 #if defined(OS_WIN) |
| 72 #include "ipc/attachment_broker_win.h" | 72 #include "ipc/attachment_broker_unprivileged_win.h" |
| 73 #endif | 73 #endif |
| 74 | 74 |
| 75 using tracked_objects::ThreadData; | 75 using tracked_objects::ThreadData; |
| 76 | 76 |
| 77 namespace content { | 77 namespace content { |
| 78 namespace { | 78 namespace { |
| 79 | 79 |
| 80 // How long to wait for a connection to the browser process before giving up. | 80 // How long to wait for a connection to the browser process before giving up. |
| 81 const int kConnectionTimeoutS = 15; | 81 const int kConnectionTimeoutS = 15; |
| 82 | 82 |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 #endif | 354 #endif |
| 355 channel_ = | 355 channel_ = |
| 356 IPC::SyncChannel::Create(this, ChildProcess::current()->io_task_runner(), | 356 IPC::SyncChannel::Create(this, ChildProcess::current()->io_task_runner(), |
| 357 ChildProcess::current()->GetShutDownEvent()); | 357 ChildProcess::current()->GetShutDownEvent()); |
| 358 #ifdef IPC_MESSAGE_LOG_ENABLED | 358 #ifdef IPC_MESSAGE_LOG_ENABLED |
| 359 if (!IsInBrowserProcess()) | 359 if (!IsInBrowserProcess()) |
| 360 IPC::Logging::GetInstance()->SetIPCSender(this); | 360 IPC::Logging::GetInstance()->SetIPCSender(this); |
| 361 #endif | 361 #endif |
| 362 | 362 |
| 363 #if defined(OS_WIN) | 363 #if defined(OS_WIN) |
| 364 attachment_broker_.reset(new IPC::AttachmentBrokerWin()); | 364 attachment_broker_.reset(new IPC::AttachmentBrokerUnprivilegedWin()); |
| 365 #endif | 365 #endif |
| 366 | 366 |
| 367 mojo_application_.reset(new MojoApplication(GetIOTaskRunner())); | 367 mojo_application_.reset(new MojoApplication(GetIOTaskRunner())); |
| 368 | 368 |
| 369 sync_message_filter_ = | 369 sync_message_filter_ = |
| 370 new IPC::SyncMessageFilter(ChildProcess::current()->GetShutDownEvent()); | 370 new IPC::SyncMessageFilter(ChildProcess::current()->GetShutDownEvent()); |
| 371 thread_safe_sender_ = new ThreadSafeSender( | 371 thread_safe_sender_ = new ThreadSafeSender( |
| 372 message_loop_->task_runner(), sync_message_filter_.get()); | 372 message_loop_->task_runner(), sync_message_filter_.get()); |
| 373 | 373 |
| 374 resource_dispatcher_.reset(new ResourceDispatcher( | 374 resource_dispatcher_.reset(new ResourceDispatcher( |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 | 709 |
| 710 void ChildThreadImpl::OnProcessBackgrounded(bool background) { | 710 void ChildThreadImpl::OnProcessBackgrounded(bool background) { |
| 711 // Set timer slack to maximum on main thread when in background. | 711 // Set timer slack to maximum on main thread when in background. |
| 712 base::TimerSlack timer_slack = base::TIMER_SLACK_NONE; | 712 base::TimerSlack timer_slack = base::TIMER_SLACK_NONE; |
| 713 if (background) | 713 if (background) |
| 714 timer_slack = base::TIMER_SLACK_MAXIMUM; | 714 timer_slack = base::TIMER_SLACK_MAXIMUM; |
| 715 base::MessageLoop::current()->SetTimerSlack(timer_slack); | 715 base::MessageLoop::current()->SetTimerSlack(timer_slack); |
| 716 } | 716 } |
| 717 | 717 |
| 718 } // namespace content | 718 } // namespace content |
| OLD | NEW |