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

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 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 | « remoting/protocol/pepper_session.cc ('k') | remoting/protocol/session_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/session.h
diff --git a/remoting/protocol/session.h b/remoting/protocol/session.h
index 4640fad7898df45f6d1754e8c4b81b516786ee8e..aceb39d5d949a7e55b45a625a2e04530790b6fbb 100644
--- a/remoting/protocol/session.h
+++ b/remoting/protocol/session.h
@@ -36,11 +36,15 @@ class Session : public base::NonThreadSafe {
// Sent or received session-initiate, but haven't sent or received
// session-accept.
+ // TODO(sergeyu): Do we really need this state?
CONNECTING,
- // Session has been accepted.
+ // Session has been accepted and is pending authentication.
CONNECTED,
+ // Session has been connected and authenticated.
+ AUTHENTICATED,
+
// Session has been closed.
CLOSED,
@@ -58,7 +62,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. It is not safe to destroy the session from within the
+ // handler unless |state| is CLOSED or FAILED.
+ typedef base::Callback<void(State state)> StateChangeCallback;
// TODO(sergeyu): Specify connection error code when channel
// connection fails.
@@ -80,8 +87,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(
« no previous file with comments | « remoting/protocol/pepper_session.cc ('k') | remoting/protocol/session_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698