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_; |