| 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 void ChildThread::Init() { | 218 void ChildThread::Init() { |
| 219 g_lazy_tls.Pointer()->Set(this); | 219 g_lazy_tls.Pointer()->Set(this); |
| 220 on_channel_error_called_ = false; | 220 on_channel_error_called_ = false; |
| 221 message_loop_ = base::MessageLoop::current(); | 221 message_loop_ = base::MessageLoop::current(); |
| 222 #ifdef IPC_MESSAGE_LOG_ENABLED | 222 #ifdef IPC_MESSAGE_LOG_ENABLED |
| 223 // We must make sure to instantiate the IPC Logger *before* we create the | 223 // We must make sure to instantiate the IPC Logger *before* we create the |
| 224 // channel, otherwise we can get a callback on the IO thread which creates | 224 // channel, otherwise we can get a callback on the IO thread which creates |
| 225 // the logger, and the logger does not like being created on the IO thread. | 225 // the logger, and the logger does not like being created on the IO thread. |
| 226 IPC::Logging::GetInstance(); | 226 IPC::Logging::GetInstance(); |
| 227 #endif | 227 #endif |
| 228 channel_.reset( | 228 channel_ = |
| 229 new IPC::SyncChannel(channel_name_, | 229 IPC::SyncChannel::Create(channel_name_, |
| 230 IPC::Channel::MODE_CLIENT, | 230 IPC::Channel::MODE_CLIENT, |
| 231 this, | 231 this, |
| 232 ChildProcess::current()->io_message_loop_proxy(), | 232 ChildProcess::current()->io_message_loop_proxy(), |
| 233 true, | 233 true, |
| 234 ChildProcess::current()->GetShutDownEvent())); | 234 ChildProcess::current()->GetShutDownEvent()); |
| 235 #ifdef IPC_MESSAGE_LOG_ENABLED | 235 #ifdef IPC_MESSAGE_LOG_ENABLED |
| 236 if (!in_browser_process_) | 236 if (!in_browser_process_) |
| 237 IPC::Logging::GetInstance()->SetIPCSender(this); | 237 IPC::Logging::GetInstance()->SetIPCSender(this); |
| 238 #endif | 238 #endif |
| 239 | 239 |
| 240 mojo_application_.reset(new MojoApplication(this)); | 240 mojo_application_.reset(new MojoApplication(this)); |
| 241 | 241 |
| 242 sync_message_filter_ = | 242 sync_message_filter_ = |
| 243 new IPC::SyncMessageFilter(ChildProcess::current()->GetShutDownEvent()); | 243 new IPC::SyncMessageFilter(ChildProcess::current()->GetShutDownEvent()); |
| 244 thread_safe_sender_ = new ThreadSafeSender( | 244 thread_safe_sender_ = new ThreadSafeSender( |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 base::KillProcess(base::GetCurrentProcessHandle(), 0, false); | 553 base::KillProcess(base::GetCurrentProcessHandle(), 0, false); |
| 554 } | 554 } |
| 555 | 555 |
| 556 #if defined(OS_WIN) | 556 #if defined(OS_WIN) |
| 557 void ChildThread::OnProcessBackgrounded(bool background) { | 557 void ChildThread::OnProcessBackgrounded(bool background) { |
| 558 base::Process::Current().SetProcessBackgrounded(background); | 558 base::Process::Current().SetProcessBackgrounded(background); |
| 559 } | 559 } |
| 560 #endif | 560 #endif |
| 561 | 561 |
| 562 } // namespace content | 562 } // namespace content |
| OLD | NEW |