Index: content/common/child_process_host_impl.cc |
diff --git a/content/common/child_process_host_impl.cc b/content/common/child_process_host_impl.cc |
index 69a63507f5866808d58339dc9aa9f17ccc654caa..00a09a6771f8c50bb353a98945f9747eeb17236f 100644 |
--- a/content/common/child_process_host_impl.cc |
+++ b/content/common/child_process_host_impl.cc |
@@ -25,6 +25,8 @@ |
#include "ipc/ipc_channel.h" |
#include "ipc/ipc_logging.h" |
#include "ipc/message_filter.h" |
+#include "ipc/mojo/ipc_channel_mojo.h" |
+#include "ipc/mojo/ipc_channel_mojo_host.h" |
#if defined(OS_LINUX) |
#include "base/linux_util.h" |
@@ -159,13 +161,31 @@ void ChildProcessHostImpl::AddFilter(IPC::MessageFilter* filter) { |
filter->OnFilterAdded(channel_.get()); |
} |
+void ChildProcessHostImpl::OnProcessLaunched(base::ProcessHandle process) { |
+ if (channel_mojo_host_) |
+ channel_mojo_host_->OnClientLaunched(process); |
+} |
+ |
void ChildProcessHostImpl::ForceShutdown() { |
Send(new ChildProcessMsg_Shutdown()); |
} |
std::string ChildProcessHostImpl::CreateChannel() { |
channel_id_ = IPC::Channel::GenerateVerifiedChannelID(std::string()); |
- channel_ = IPC::Channel::CreateServer(channel_id_, this); |
+ |
+ if (delegate_->ShouldUseMojoChannel()) { |
+ if (!channel_mojo_host_) { |
+ channel_mojo_host_.reset(new IPC::ChannelMojoHost( |
+ base::MessageLoop::current()->task_runner())); |
+ } |
+ |
+ channel_ = |
+ IPC::ChannelMojo::Create(channel_mojo_host_->channel_delegate(), |
+ channel_id_, IPC::Channel::MODE_SERVER, this); |
+ } else { |
+ channel_ = IPC::Channel::CreateServer(channel_id_, this); |
+ } |
+ |
if (!channel_->Connect()) |
return std::string(); |