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

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

Issue 1685183004: Bootstrap Mojo IPC independent of Chrome IPC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: and fix posix 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
Index: mojo/edk/system/node_channel.h
diff --git a/mojo/edk/system/node_channel.h b/mojo/edk/system/node_channel.h
index e08dc4729fe1d233cf3dedad3327aaadbf72cb28..33c7ef5798693209caee6212b1623c58d0ea9553 100644
--- a/mojo/edk/system/node_channel.h
+++ b/mojo/edk/system/node_channel.h
@@ -87,6 +87,14 @@ class NodeChannel : public base::RefCountedThreadSafe<NodeChannel>,
// Used for context in Delegate calls (via |from_node| arguments.)
void SetRemoteNodeName(const ports::NodeName& name);
+ // If this is called with a non-empty |secret|, the channel expects the next
+ // message it receives to exactly match the contents of |secret|. This must be
+ // called before calling Start().
+ void SetExpectedSecret(const std::string& secret);
+
+ // Sends a secret to the remote end.
+ void SendSecret(const std::string& secret);
+
void AcceptChild(const ports::NodeName& parent_name,
const ports::NodeName& token);
void AcceptParent(const ports::NodeName& token,
@@ -135,6 +143,9 @@ class NodeChannel : public base::RefCountedThreadSafe<NodeChannel>,
base::Lock channel_lock_;
scoped_refptr<Channel> channel_;
+ // Must be set before calling Start(), if at all.
+ std::string expected_secret_;
+
// Must only be accessed from |io_task_runner_|'s thread.
ports::NodeName remote_node_name_;

Powered by Google App Engine
This is Rietveld 408576698