Index: content/child/child_thread_impl.cc |
diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc |
index 5f5b949601a49faeb6912ff316e50fb636d4a816..538380397b7531af2ca4b553f2395dc751e7a4e3 100644 |
--- a/content/child/child_thread_impl.cc |
+++ b/content/child/child_thread_impl.cc |
@@ -388,7 +388,11 @@ void ChildThreadImpl::Init(const Options& options) { |
IPC::Logging::GetInstance()->SetIPCSender(this); |
#endif |
- mojo_ipc_support_.reset(new IPC::ScopedIPCSupport(GetIOTaskRunner())); |
+ if (!IsInBrowserProcess()) { |
+ // Don't double-initialize IPC support in single-process mode. |
+ mojo_ipc_support_.reset(new IPC::ScopedIPCSupport(GetIOTaskRunner())); |
+ } |
+ |
mojo_application_.reset(new MojoApplication(GetIOTaskRunner())); |
sync_message_filter_ = channel_->CreateSyncMessageFilter(); |
@@ -687,10 +691,10 @@ void ChildThreadImpl::OnBindExternalMojoShellHandle( |
#elif defined(OS_WIN) |
base::PlatformFile handle = file; |
#endif |
- mojo::ScopedMessagePipeHandle message_pipe = |
- mojo_shell_channel_init_.Init(handle, GetIOTaskRunner()); |
- DCHECK(message_pipe.is_valid()); |
- MojoShellConnectionImpl::Get()->BindToMessagePipe(std::move(message_pipe)); |
+ mojo_shell_channel_init_.Init( |
+ handle, GetIOTaskRunner(), |
+ base::Bind(&MojoShellConnectionImpl::BindToMessagePipe, |
+ base::Unretained(MojoShellConnectionImpl::Get()))); |
#endif // defined(MOJO_SHELL_CLIENT) |
} |