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.h" | 5 #include "content/child/child_thread.h" |
6 | 6 |
7 #include <signal.h> | 7 #include <signal.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 : router_(this), | 222 : router_(this), |
223 channel_connected_factory_(this), | 223 channel_connected_factory_(this), |
224 in_browser_process_(true) { | 224 in_browser_process_(true) { |
225 Init(options); | 225 Init(options); |
226 } | 226 } |
227 | 227 |
228 scoped_ptr<IPC::SyncChannel> ChildThread::CreateChannel(bool use_mojo_channel) { | 228 scoped_ptr<IPC::SyncChannel> ChildThread::CreateChannel(bool use_mojo_channel) { |
229 if (use_mojo_channel) { | 229 if (use_mojo_channel) { |
230 VLOG(1) << "Mojo is enabled on child"; | 230 VLOG(1) << "Mojo is enabled on child"; |
231 return IPC::SyncChannel::Create( | 231 return IPC::SyncChannel::Create( |
232 IPC::ChannelMojo::CreateFactory( | 232 IPC::ChannelMojo::CreateClientFactory(channel_name_), |
233 channel_name_, | |
234 IPC::Channel::MODE_CLIENT, | |
235 ChildProcess::current()->io_message_loop_proxy()), | |
236 this, | 233 this, |
237 ChildProcess::current()->io_message_loop_proxy(), | 234 ChildProcess::current()->io_message_loop_proxy(), |
238 true, | 235 true, |
239 ChildProcess::current()->GetShutDownEvent()); | 236 ChildProcess::current()->GetShutDownEvent()); |
240 } | 237 } |
241 | 238 |
242 VLOG(1) << "Mojo is disabled on child"; | 239 VLOG(1) << "Mojo is disabled on child"; |
243 return IPC::SyncChannel::Create( | 240 return IPC::SyncChannel::Create( |
244 channel_name_, | 241 channel_name_, |
245 IPC::Channel::MODE_CLIENT, | 242 IPC::Channel::MODE_CLIENT, |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 | 586 |
590 void ChildThread::OnProcessBackgrounded(bool background) { | 587 void ChildThread::OnProcessBackgrounded(bool background) { |
591 // Set timer slack to maximum on main thread when in background. | 588 // Set timer slack to maximum on main thread when in background. |
592 base::TimerSlack timer_slack = base::TIMER_SLACK_NONE; | 589 base::TimerSlack timer_slack = base::TIMER_SLACK_NONE; |
593 if (background) | 590 if (background) |
594 timer_slack = base::TIMER_SLACK_MAXIMUM; | 591 timer_slack = base::TIMER_SLACK_MAXIMUM; |
595 base::MessageLoop::current()->SetTimerSlack(timer_slack); | 592 base::MessageLoop::current()->SetTimerSlack(timer_slack); |
596 } | 593 } |
597 | 594 |
598 } // namespace content | 595 } // namespace content |
OLD | NEW |