Index: content/browser/renderer_host/render_process_host_impl.cc |
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc |
index de6cb37ad67bf21b445ae61c090747f0c43d3601..eaaf9578866f079916d0acc4efe87a913b9f3cc7 100644 |
--- a/content/browser/renderer_host/render_process_host_impl.cc |
+++ b/content/browser/renderer_host/render_process_host_impl.cc |
@@ -701,7 +701,7 @@ bool RenderProcessHostImpl::Init() { |
if (channel_) |
return true; |
- RegisterChildWithExternalShell(id_, instance_id_++, this); |
+ shell_pipe_token_ = RegisterChildWithExternalShell(id_, instance_id_++, this); |
base::CommandLine::StringType renderer_prefix; |
// A command prefix is something prepended to the command line of the spawned |
@@ -1626,6 +1626,11 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( |
} |
} |
+ if (!shell_pipe_token_.empty()) { |
+ renderer_cmd->AppendSwitchASCII(switches::kMojoPrimordialPipeToken, |
+ shell_pipe_token_); |
+ } |
+ |
#if defined(OS_WIN) && !defined(OFFICIAL_BUILD) |
// Needed because we can't show the dialog from the sandbox. Don't pass |
// --no-sandbox in official builds because that would bypass the bad_flgs |
@@ -2577,19 +2582,6 @@ void RenderProcessHostImpl::OnProcessLaunched() { |
Source<RenderProcessHost>(this), |
NotificationService::NoDetails()); |
- if (child_process_launcher_.get()) { |
- base::ProcessHandle process_handle = |
- child_process_launcher_->GetProcess().Handle(); |
- mojo::edk::ScopedPlatformHandle client_pipe = |
- mojo::edk::ChildProcessLaunched(process_handle); |
- Send(new ChildProcessMsg_SetMojoParentPipeHandle( |
- IPC::GetFileHandleForProcess(client_pipe.release().handle, |
- process_handle, true))); |
- } |
- |
- // Send the mojo shell handle to the renderer. |
- SendExternalMojoShellHandleToChild(GetHandle(), this); |
- |
// Allow Mojo to be setup before the renderer sees any Chrome IPC messages. |
// This way, Mojo can be safely used from the renderer in response to any |
// Chrome IPC message. |