| 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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 #endif | 407 #endif |
| 408 | 408 |
| 409 channel_ = | 409 channel_ = |
| 410 IPC::SyncChannel::Create(this, ChildProcess::current()->io_task_runner(), | 410 IPC::SyncChannel::Create(this, ChildProcess::current()->io_task_runner(), |
| 411 ChildProcess::current()->GetShutDownEvent()); | 411 ChildProcess::current()->GetShutDownEvent()); |
| 412 #ifdef IPC_MESSAGE_LOG_ENABLED | 412 #ifdef IPC_MESSAGE_LOG_ENABLED |
| 413 if (!IsInBrowserProcess()) | 413 if (!IsInBrowserProcess()) |
| 414 IPC::Logging::GetInstance()->SetIPCSender(this); | 414 IPC::Logging::GetInstance()->SetIPCSender(this); |
| 415 #endif | 415 #endif |
| 416 | 416 |
| 417 mojo_ipc_support_.reset(new IPC::ScopedIPCSupport(GetIOTaskRunner())); |
| 417 mojo_application_.reset(new MojoApplication(GetIOTaskRunner())); | 418 mojo_application_.reset(new MojoApplication(GetIOTaskRunner())); |
| 418 | 419 |
| 419 sync_message_filter_ = channel_->CreateSyncMessageFilter(); | 420 sync_message_filter_ = channel_->CreateSyncMessageFilter(); |
| 420 thread_safe_sender_ = new ThreadSafeSender( | 421 thread_safe_sender_ = new ThreadSafeSender( |
| 421 message_loop_->task_runner(), sync_message_filter_.get()); | 422 message_loop_->task_runner(), sync_message_filter_.get()); |
| 422 | 423 |
| 423 resource_dispatcher_.reset(new ResourceDispatcher( | 424 resource_dispatcher_.reset(new ResourceDispatcher( |
| 424 this, message_loop()->task_runner())); | 425 this, message_loop()->task_runner())); |
| 425 websocket_dispatcher_.reset(new WebSocketDispatcher); | 426 websocket_dispatcher_.reset(new WebSocketDispatcher); |
| 426 file_system_dispatcher_.reset(new FileSystemDispatcher()); | 427 file_system_dispatcher_.reset(new FileSystemDispatcher()); |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProfilerStatus, | 647 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProfilerStatus, |
| 647 OnSetProfilerStatus) | 648 OnSetProfilerStatus) |
| 648 IPC_MESSAGE_HANDLER(ChildProcessMsg_GetChildProfilerData, | 649 IPC_MESSAGE_HANDLER(ChildProcessMsg_GetChildProfilerData, |
| 649 OnGetChildProfilerData) | 650 OnGetChildProfilerData) |
| 650 IPC_MESSAGE_HANDLER(ChildProcessMsg_ProfilingPhaseCompleted, | 651 IPC_MESSAGE_HANDLER(ChildProcessMsg_ProfilingPhaseCompleted, |
| 651 OnProfilingPhaseCompleted) | 652 OnProfilingPhaseCompleted) |
| 652 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProcessBackgrounded, | 653 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProcessBackgrounded, |
| 653 OnProcessBackgrounded) | 654 OnProcessBackgrounded) |
| 654 IPC_MESSAGE_HANDLER(MojoMsg_BindExternalMojoShellHandle, | 655 IPC_MESSAGE_HANDLER(MojoMsg_BindExternalMojoShellHandle, |
| 655 OnBindExternalMojoShellHandle) | 656 OnBindExternalMojoShellHandle) |
| 656 #if defined(OS_WIN) | |
| 657 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetMojoParentPipeHandle, | 657 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetMojoParentPipeHandle, |
| 658 OnSetMojoParentPipeHandle) | 658 OnSetMojoParentPipeHandle) |
| 659 #endif | |
| 660 IPC_MESSAGE_UNHANDLED(handled = false) | 659 IPC_MESSAGE_UNHANDLED(handled = false) |
| 661 IPC_END_MESSAGE_MAP() | 660 IPC_END_MESSAGE_MAP() |
| 662 | 661 |
| 663 if (handled) | 662 if (handled) |
| 664 return true; | 663 return true; |
| 665 | 664 |
| 666 if (msg.routing_id() == MSG_ROUTING_CONTROL) | 665 if (msg.routing_id() == MSG_ROUTING_CONTROL) |
| 667 return OnControlMessageReceived(msg); | 666 return OnControlMessageReceived(msg); |
| 668 | 667 |
| 669 return router_.OnMessageReceived(msg); | 668 return router_.OnMessageReceived(msg); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 void ChildThreadImpl::EnsureConnected() { | 764 void ChildThreadImpl::EnsureConnected() { |
| 766 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; | 765 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; |
| 767 base::Process::Current().Terminate(0, false); | 766 base::Process::Current().Terminate(0, false); |
| 768 } | 767 } |
| 769 | 768 |
| 770 bool ChildThreadImpl::IsInBrowserProcess() const { | 769 bool ChildThreadImpl::IsInBrowserProcess() const { |
| 771 return browser_process_io_runner_; | 770 return browser_process_io_runner_; |
| 772 } | 771 } |
| 773 | 772 |
| 774 } // namespace content | 773 } // namespace content |
| OLD | NEW |