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

Unified Diff: content/child/child_thread_impl.cc

Issue 2111673006: Revert of Eliminate the ChannelMojo channel for renderers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/child/child_thread_impl.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/child_thread_impl.cc
diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc
index 7ae85f510d881327445a6d2db95fca79ae758430..f8b6c1e26b594d198332b07fa8c1fbdc7b9171cf 100644
--- a/content/child/child_thread_impl.cc
+++ b/content/child/child_thread_impl.cc
@@ -354,14 +354,13 @@
if (use_mojo_channel) {
VLOG(1) << "Mojo is enabled on child";
mojo::ScopedMessagePipeHandle handle;
- std::string token = IsInBrowserProcess() ? ipc_token :
- base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- switches::kMojoChannelToken);
- if (token.empty()) {
- IPC::mojom::BootstrapRequest request = GetProxy(&pending_bootstrap_);
- handle = request.PassMessagePipe();
+ if (!IsInBrowserProcess()) {
+ DCHECK(!handle.is_valid());
+ handle = mojo::edk::CreateChildMessagePipe(
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kMojoChannelToken));
} else {
- handle = mojo::edk::CreateChildMessagePipe(token);
+ handle = mojo::edk::CreateChildMessagePipe(ipc_token);
}
DCHECK(handle.is_valid());
channel_->Init(IPC::ChannelMojo::CreateClientFactory(std::move(handle)),
@@ -595,14 +594,6 @@
MojoShellConnection* ChildThreadImpl::GetMojoShellConnection() {
return mojo_shell_connection_.get();
-}
-
-bool ChildThreadImpl::AcceptConnection(shell::Connection* connection) {
- connection->GetInterfaceRegistry()->AddInterface(
- IPC::mojom::Bootstrap::Name_,
- base::Bind(&ChildThreadImpl::BindBootstrapRequest,
- base::Unretained(this)));
- return true;
}
shell::InterfaceRegistry* ChildThreadImpl::GetInterfaceRegistry() {
@@ -777,13 +768,6 @@
base::Process::Current().Terminate(0, false);
}
-void ChildThreadImpl::BindBootstrapRequest(
- mojo::ScopedMessagePipeHandle handle) {
- IPC::mojom::BootstrapRequest request =
- mojo::MakeRequest<IPC::mojom::Bootstrap>(std::move(handle));
- mojo::FuseInterface(std::move(request), pending_bootstrap_.PassInterface());
-}
-
bool ChildThreadImpl::IsInBrowserProcess() const {
return static_cast<bool>(browser_process_io_runner_);
}
« no previous file with comments | « content/child/child_thread_impl.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698