Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2238633003: Revert renderer IPC::Channel acquisition via shell connection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0ce8b2249b2afb8c3331cf302b1678e93a37ee81..10612ce9b76a31afc51f725317be55b51ced954a 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -834,7 +834,7 @@ bool RenderProcessHostImpl::Init() {
g_renderer_main_thread_factory(InProcessChildThreadParams(
channel_id,
BrowserThread::GetTaskRunnerForThread(BrowserThread::IO),
- std::string(), mojo_child_connection_->service_token())));
+ channel_token_, mojo_child_connection_->service_token())));
base::Thread::Options options;
#if defined(OS_WIN) && !defined(OS_MACOSX)
@@ -894,11 +894,11 @@ std::unique_ptr<IPC::ChannelProxy> RenderProcessHostImpl::CreateChannelProxy(
const std::string& channel_id) {
scoped_refptr<base::SingleThreadTaskRunner> runner =
BrowserThread::GetTaskRunnerForThread(BrowserThread::IO);
- IPC::mojom::ChannelBootstrapPtr bootstrap;
- GetRemoteInterfaces()->GetInterface(&bootstrap);
+ channel_token_ = mojo::edk::GenerateRandomToken();
+ mojo::ScopedMessagePipeHandle handle =
+ mojo::edk::CreateParentMessagePipe(channel_token_, child_token_);
std::unique_ptr<IPC::ChannelFactory> channel_factory =
- IPC::ChannelMojo::CreateServerFactory(
- bootstrap.PassInterface().PassHandle(), runner);
+ IPC::ChannelMojo::CreateServerFactory(std::move(handle), runner);
// Do NOT expand ifdef or run time condition checks here! Synchronous
// IPCs from browser process are banned. It is only narrowly allowed
@@ -1434,6 +1434,11 @@ void RenderProcessHostImpl::AppendRendererCommandLine(
AppendCompositorCommandLineFlags(command_line);
+ if (!channel_token_.empty()) {
+ command_line->AppendSwitchASCII(
+ switches::kMojoChannelToken, channel_token_);
+ }
+
command_line->AppendSwitchASCII(switches::kMojoApplicationChannelToken,
mojo_child_connection_->service_token());
}
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698