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

Unified Diff: mojo/shell/runner/child/runner_connection.cc

Issue 1678333003: Revert of [mojo-edk] Simplify multiprocess pipe bootstrap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « mojo/edk/system/remote_message_pipe_bootstrap.cc ('k') | mojo/shell/runner/host/child_process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/runner/child/runner_connection.cc
diff --git a/mojo/shell/runner/child/runner_connection.cc b/mojo/shell/runner/child/runner_connection.cc
index 313c00a338d7bdade01b3a465639378835f78a0b..75b4648dc0db58f70f7753fe65959533d4e84baa 100644
--- a/mojo/shell/runner/child/runner_connection.cc
+++ b/mojo/shell/runner/child/runner_connection.cc
@@ -74,6 +74,13 @@
using GotApplicationRequestCallback =
base::Callback<void(InterfaceRequest<mojom::ShellClient>)>;
+void OnCreateMessagePipe(ScopedMessagePipeHandle* result,
+ Blocker::Unblocker unblocker,
+ ScopedMessagePipeHandle pipe) {
+ *result = std::move(pipe);
+ unblocker.Unblock(base::Bind(&base::DoNothing));
+}
+
void OnGotApplicationRequest(InterfaceRequest<mojom::ShellClient>* out_request,
InterfaceRequest<mojom::ShellClient> request) {
*out_request = std::move(request);
@@ -222,10 +229,13 @@
std::string primordial_pipe_token =
base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kPrimordialPipeToken);
- handle = edk::CreateChildMessagePipe(primordial_pipe_token);
- }
-
- DCHECK(handle.is_valid());
+ Blocker blocker;
+ edk::CreateChildMessagePipe(
+ primordial_pipe_token,
+ base::Bind(&OnCreateMessagePipe, base::Unretained(&handle),
+ blocker.GetUnblocker()));
+ blocker.Block();
+ }
Blocker blocker;
controller_runner_->PostTask(
« no previous file with comments | « mojo/edk/system/remote_message_pipe_bootstrap.cc ('k') | mojo/shell/runner/host/child_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698