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

Unified Diff: mojo/edk/system/remote_message_pipe_bootstrap.h

Issue 1675603002: [mojo-edk] Simplify multiprocess pipe bootstrap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix some callers to work with sync APIs 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/ports/ports_unittest.cc ('k') | mojo/edk/system/remote_message_pipe_bootstrap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/remote_message_pipe_bootstrap.h
diff --git a/mojo/edk/system/remote_message_pipe_bootstrap.h b/mojo/edk/system/remote_message_pipe_bootstrap.h
index 911d5188e30e46f1ff4aaec693989c61664283b0..2a24680d5768b5d8149d6977486cc0323e33e95e 100644
--- a/mojo/edk/system/remote_message_pipe_bootstrap.h
+++ b/mojo/edk/system/remote_message_pipe_bootstrap.h
@@ -7,7 +7,6 @@
#include <string>
-#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/message_loop/message_loop.h"
@@ -28,17 +27,20 @@ class NodeController;
//
// The bootstrapping procedure the same on either end:
//
-// 1. Create a local port P.
+// 1. Select a local port P to be merged with a remote port.
// 2. Write the local node name and P's name to the bootstrap pipe.
// 3. When a message is read from the pipe:
// - If it's the first message read, extract the remote node+port name and
-// initialize the local port. Send an empty ACK message on the pipe.
+// and send an empty ACK message on the pipe.
// - If it's the second message read, close the channel, and delete |this|.
// 4. When an error occus on the pipe, delete |this|.
//
// Excluding irrecoverable error conditions such as either process dying,
// armageddon, etc., this ensures neither end closes the channel until both ends
-// have intiailized their corresponding local port.
+// are aware of each other's port-to-merge.
+//
+// At step 3, one side of the channel is chosen to issue a message at the Ports
+// layer which eventually merges the two ports.
class RemoteMessagePipeBootstrap
: public Channel::Delegate,
public base::MessageLoop::DestructionObserver {
@@ -48,22 +50,18 @@ class RemoteMessagePipeBootstrap
// |port| must be a reference to an uninitialized local port.
static void Create(NodeController* node_controller,
ScopedPlatformHandle platform_handle,
- const ports::PortRef& port,
- const base::Closure& callback);
+ const ports::PortRef& port);
protected:
- explicit RemoteMessagePipeBootstrap(
- NodeController* node_controller,
- ScopedPlatformHandle platform_handle,
- const ports::PortRef& port,
- const base::Closure& callback);
+ explicit RemoteMessagePipeBootstrap(NodeController* node_controller,
+ ScopedPlatformHandle platform_handle,
+ const ports::PortRef& port);
void ShutDown();
bool shutting_down_ = false;
NodeController* node_controller_;
const ports::PortRef local_port_;
- base::Closure callback_;
scoped_refptr<base::TaskRunner> io_task_runner_;
scoped_refptr<Channel> channel_;
« no previous file with comments | « mojo/edk/system/ports/ports_unittest.cc ('k') | mojo/edk/system/remote_message_pipe_bootstrap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698