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

Unified Diff: mojo/edk/embedder/embedder.h

Issue 2019973002: [mojo-edk] Bind a child token to child launches and port reservations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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/test/render_thread_impl_browser_test_ipc_helper.cc ('k') | mojo/edk/embedder/embedder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/embedder/embedder.h
diff --git a/mojo/edk/embedder/embedder.h b/mojo/edk/embedder/embedder.h
index 2f27bb2bc0fa7834f240ca1b313f6df002c2a82d..68c198b7067a1aa27eb914d12edc9abb6a34e72b 100644
--- a/mojo/edk/embedder/embedder.h
+++ b/mojo/edk/embedder/embedder.h
@@ -40,7 +40,15 @@ MOJO_SYSTEM_IMPL_EXPORT void SetMaxMessageSize(size_t bytes);
// Called in the parent process for each child process that is launched.
MOJO_SYSTEM_IMPL_EXPORT void ChildProcessLaunched(
- base::ProcessHandle child_process, ScopedPlatformHandle server_pipe);
+ base::ProcessHandle child_process,
+ ScopedPlatformHandle server_pipe,
+ const std::string& child_token);
+
+// Called in the parent process when a child process fails to launch.
+// Exactly one of ChildProcessLaunched() or ChildProcessLaunchFailed() must be
+// called per child process launch attempt.
+MOJO_SYSTEM_IMPL_EXPORT void ChildProcessLaunchFailed(
+ const std::string& child_token);
// Should be called as early as possible in the child process with the handle
// that the parent received from ChildProcessLaunched.
@@ -150,9 +158,13 @@ CreateMessagePipe(ScopedPlatformHandle platform_handle);
// Creates a message pipe from a token. A child embedder must also have this
// token and call CreateChildMessagePipe() with it in order for the pipe to get
-// connected.
+// connected. |child_token| identifies the child process and should be the same
+// as the token passed into ChildProcessLaunched(). If they are different, the
+// returned message pipe will not be signaled of peer closure if the child
+// process dies before establishing connection to the pipe.
MOJO_SYSTEM_IMPL_EXPORT ScopedMessagePipeHandle
-CreateParentMessagePipe(const std::string& token);
+CreateParentMessagePipe(const std::string& token,
+ const std::string& child_token);
// Creates a message pipe from a token in a child process. The parent must also
// have this token and call CreateParentMessagePipe() with it in order for the
« no previous file with comments | « content/test/render_thread_impl_browser_test_ipc_helper.cc ('k') | mojo/edk/embedder/embedder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698