| 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 c629485f9059f0cd40fdcc431afc5543dfdf0eae..b5568f187794ee2f505d77d1120d13909a7246d2 100644
|
| --- a/content/browser/renderer_host/render_process_host_impl.cc
|
| +++ b/content/browser/renderer_host/render_process_host_impl.cc
|
| @@ -139,6 +139,7 @@
|
| #include "ipc/ipc_channel.h"
|
| #include "ipc/ipc_logging.h"
|
| #include "ipc/ipc_switches.h"
|
| +#include "ipc/mojo/ipc_channel_mojo.h"
|
| #include "media/base/media_switches.h"
|
| #include "net/url_request/url_request_context_getter.h"
|
| #include "ppapi/shared_impl/ppapi_switches.h"
|
| @@ -558,6 +559,27 @@ void RenderProcessHostImpl::EnableSendQueue() {
|
| is_initialized_ = false;
|
| }
|
|
|
| +bool RenderProcessHostImpl::IsMojoChannelEnabled() const {
|
| + const CommandLine& command_line = *CommandLine::ForCurrentProcess();
|
| + return command_line.HasSwitch(switches::kEnableRendererMojoChannel);
|
| +}
|
| +
|
| +scoped_ptr<IPC::ChannelProxy> RenderProcessHostImpl::CreateChannelProxy(
|
| + const std::string& channel_id) {
|
| + scoped_refptr<base::SingleThreadTaskRunner> runner =
|
| + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
|
| + if (IsMojoChannelEnabled()) {
|
| + VLOG(1) << "Mojo Channel is enabled on host";
|
| + return IPC::ChannelProxy::Create(
|
| + IPC::ChannelMojo::CreateBuilder(
|
| + channel_id, IPC::Channel::MODE_SERVER, runner),
|
| + this, runner.get());
|
| + }
|
| +
|
| + return IPC::ChannelProxy::Create(
|
| + channel_id, IPC::Channel::MODE_SERVER, this, runner.get());
|
| +}
|
| +
|
| bool RenderProcessHostImpl::Init() {
|
| // calling Init() more than once does nothing, this makes it more convenient
|
| // for the view host which may not be sure in some cases
|
| @@ -589,11 +611,7 @@ bool RenderProcessHostImpl::Init() {
|
| // Setup the IPC channel.
|
| const std::string channel_id =
|
| IPC::Channel::GenerateVerifiedChannelID(std::string());
|
| - channel_ = IPC::ChannelProxy::Create(
|
| - channel_id,
|
| - IPC::Channel::MODE_SERVER,
|
| - this,
|
| - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get());
|
| + channel_ = CreateChannelProxy(channel_id);
|
|
|
| // Setup the Mojo channel.
|
| mojo_application_host_->Init();
|
| @@ -1154,6 +1172,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
|
| switches::kEnablePinch,
|
| switches::kEnablePreciseMemoryInfo,
|
| switches::kEnablePreparsedJsCaching,
|
| + switches::kEnableRendererMojoChannel,
|
| switches::kEnableSeccompFilterSandbox,
|
| switches::kEnableSkiaBenchmarking,
|
| switches::kEnableSmoothScrolling,
|
|
|