| 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 29ec744dc6ca4dfd46a474494abe1c2286654d87..7592d3f8f96b0942eb8fdfded0035bcf1d54c70b 100644
|
| --- a/content/browser/renderer_host/render_process_host_impl.cc
|
| +++ b/content/browser/renderer_host/render_process_host_impl.cc
|
| @@ -800,20 +800,22 @@
|
| const std::string& channel_id) {
|
| scoped_refptr<base::SingleThreadTaskRunner> runner =
|
| BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
|
| - mojo_channel_token_ = mojo::edk::GenerateRandomToken();
|
| - mojo::ScopedMessagePipeHandle handle =
|
| - mojo::edk::CreateParentMessagePipe(mojo_channel_token_);
|
| -
|
| - // Do NOT expand ifdef or run time condition checks here! Synchronous
|
| - // IPCs from browser process are banned. It is only narrowly allowed
|
| - // for Android WebView to maintain backward compatibility.
|
| - // See crbug.com/526842 for details.
|
| + if (ShouldUseMojoChannel()) {
|
| + VLOG(1) << "Mojo Channel is enabled on host";
|
| + mojo_channel_token_ = mojo::edk::GenerateRandomToken();
|
| + mojo::ScopedMessagePipeHandle handle =
|
| + mojo::edk::CreateParentMessagePipe(mojo_channel_token_);
|
| +
|
| + // Do NOT expand ifdef or run time condition checks here! Synchronous
|
| + // IPCs from browser process are banned. It is only narrowly allowed
|
| + // for Android WebView to maintain backward compatibility.
|
| + // See crbug.com/526842 for details.
|
| #if defined(OS_ANDROID)
|
| - if (GetContentClient()->UsingSynchronousCompositing()) {
|
| - return IPC::SyncChannel::Create(
|
| - IPC::ChannelMojo::CreateServerFactory(std::move(handle)), this,
|
| - runner.get(), true, &never_signaled_);
|
| - }
|
| + if (GetContentClient()->UsingSynchronousCompositing()) {
|
| + return IPC::SyncChannel::Create(
|
| + IPC::ChannelMojo::CreateServerFactory(std::move(handle)), this,
|
| + runner.get(), true, &never_signaled_);
|
| + }
|
| #endif // OS_ANDROID
|
|
|
| std::unique_ptr<IPC::ChannelProxy> channel(
|
| @@ -824,6 +826,25 @@
|
| content::BrowserThread::IO));
|
| #endif
|
| channel->Init(IPC::ChannelMojo::CreateServerFactory(std::move(handle)), true);
|
| + return channel;
|
| + }
|
| +
|
| + // Do NOT expand ifdef or run time condition checks here! See comment above.
|
| +#if defined(OS_ANDROID)
|
| + if (GetContentClient()->UsingSynchronousCompositing()) {
|
| + return IPC::SyncChannel::Create(channel_id, IPC::Channel::MODE_SERVER, this,
|
| + runner.get(), true, &never_signaled_);
|
| + }
|
| +#endif // OS_ANDROID
|
| +
|
| + std::unique_ptr<IPC::ChannelProxy> channel(
|
| + new IPC::ChannelProxy(this, runner.get()));
|
| +#if USE_ATTACHMENT_BROKER
|
| + IPC::AttachmentBroker::GetGlobal()->RegisterCommunicationChannel(
|
| + channel.get(), content::BrowserThread::GetMessageLoopProxyForThread(
|
| + content::BrowserThread::IO));
|
| +#endif
|
| + channel->Init(channel_id, IPC::Channel::MODE_SERVER, true);
|
| return channel;
|
| }
|
|
|
| @@ -1404,6 +1425,7 @@
|
| switches::kEnableLinkDisambiguationPopup,
|
| switches::kEnableLowResTiling,
|
| switches::kEnableMediaSuspend,
|
| + switches::kEnableMojoChannel,
|
| switches::kEnableInbandTextTracks,
|
| switches::kEnableLCDText,
|
| switches::kEnableLogging,
|
|
|