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_ = IPC::SyncChannel::CreateClient( |
229 new IPC::SyncChannel(channel_name_, | 229 channel_name_, |
230 IPC::Channel::MODE_CLIENT, | 230 this, |
231 this, | 231 ChildProcess::current()->io_message_loop_proxy(), |
232 ChildProcess::current()->io_message_loop_proxy(), | 232 true, |
233 true, | 233 ChildProcess::current()->GetShutDownEvent()); |
234 ChildProcess::current()->GetShutDownEvent())); | |
235 #ifdef IPC_MESSAGE_LOG_ENABLED | 234 #ifdef IPC_MESSAGE_LOG_ENABLED |
236 if (!in_browser_process_) | 235 if (!in_browser_process_) |
237 IPC::Logging::GetInstance()->SetIPCSender(this); | 236 IPC::Logging::GetInstance()->SetIPCSender(this); |
238 #endif | 237 #endif |
239 | 238 |
240 mojo_application_.reset(new MojoApplication(this)); | 239 mojo_application_.reset(new MojoApplication(this)); |
241 | 240 |
242 sync_message_filter_ = | 241 sync_message_filter_ = |
243 new IPC::SyncMessageFilter(ChildProcess::current()->GetShutDownEvent()); | 242 new IPC::SyncMessageFilter(ChildProcess::current()->GetShutDownEvent()); |
244 thread_safe_sender_ = new ThreadSafeSender( | 243 thread_safe_sender_ = new ThreadSafeSender( |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 // inflight that would addref it. | 541 // inflight that would addref it. |
543 Send(new ChildProcessHostMsg_ShutdownRequest); | 542 Send(new ChildProcessHostMsg_ShutdownRequest); |
544 } | 543 } |
545 | 544 |
546 void ChildThread::EnsureConnected() { | 545 void ChildThread::EnsureConnected() { |
547 VLOG(0) << "ChildThread::EnsureConnected()"; | 546 VLOG(0) << "ChildThread::EnsureConnected()"; |
548 base::KillProcess(base::GetCurrentProcessHandle(), 0, false); | 547 base::KillProcess(base::GetCurrentProcessHandle(), 0, false); |
549 } | 548 } |
550 | 549 |
551 } // namespace content | 550 } // namespace content |
OLD | NEW |