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

Unified Diff: remoting/protocol/session.h

Issue 8774017: Add AUTHENTICATED session state. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 1 month 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: remoting/protocol/session.h
diff --git a/remoting/protocol/session.h b/remoting/protocol/session.h
index 4640fad7898df45f6d1754e8c4b81b516786ee8e..fa45f842afa3eb904ad5709c8ea7ecd78c86dd90 100644
--- a/remoting/protocol/session.h
+++ b/remoting/protocol/session.h
@@ -38,9 +38,12 @@ class Session : public base::NonThreadSafe {
// session-accept.
Wez 2011/12/03 00:10:37 Combining this description with those of CONNECTED
Sergey Ulanov 2011/12/06 02:33:20 I think we do need to distinguish between CONNECTE
CONNECTING,
- // Session has been accepted.
+ // Session has been accepted, but authentication is not finished yet.
Wez 2011/12/03 00:10:37 nit: "... and is pending authentication."
Sergey Ulanov 2011/12/06 02:33:20 Done.
CONNECTED,
+ // Session has been connected and authenticated.
+ AUTHENTICATED,
+
// Session has been closed.
CLOSED,
@@ -58,7 +61,10 @@ class Session : public base::NonThreadSafe {
CHANNEL_CONNECTION_ERROR,
};
- typedef base::Callback<void(State)> StateChangeCallback;
+ // State change callbacks are called after session state has
+ // changed. Handlers can destroy session only when |state| is set to
+ // CLOSED or FAILED.
Wez 2011/12/03 00:10:37 nit: "It is not safe to destroy the session from w
Sergey Ulanov 2011/12/06 02:33:20 Done.
+ typedef base::Callback<void(State state)> StateChangeCallback;
// TODO(sergeyu): Specify connection error code when channel
// connection fails.
@@ -80,8 +86,8 @@ class Session : public base::NonThreadSafe {
// callback is called with NULL if connection failed for any reason.
// Ownership of the channel socket is given to the caller when the
// callback is called. All channels must be destroyed before the
- // session is destroyed. Can be called only when in CONNECTING or
- // CONNECTED state.
+ // session is destroyed. Can be called only when in CONNECTING,
+ // CONNECTED or AUTHENTICATED states.
virtual void CreateStreamChannel(
const std::string& name, const StreamChannelCallback& callback) = 0;
virtual void CreateDatagramChannel(

Powered by Google App Engine
This is Rietveld 408576698