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

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

Issue 1946573002: Revert of Turn on MojoChannel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | content/public/common/mojo_channel_switches.h » ('j') | 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 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,
« no previous file with comments | « no previous file | content/public/common/mojo_channel_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698