Index: remoting/protocol/session.h |
diff --git a/remoting/protocol/session.h b/remoting/protocol/session.h |
index a87375fcc0a895f28beadd89446340a1ef47b025..917dd8088cc9a8f9a575119ee4685bab692b9750 100644 |
--- a/remoting/protocol/session.h |
+++ b/remoting/protocol/session.h |
@@ -10,17 +10,23 @@ |
#include "base/macros.h" |
#include "remoting/protocol/errors.h" |
#include "remoting/protocol/session_config.h" |
+#include "remoting/protocol/transport.h" |
+ |
+namespace buzz { |
+class XmlElement; |
+} // namespace buzz |
namespace remoting { |
namespace protocol { |
+class Authenicator; |
class StreamChannelFactory; |
class Transport; |
struct TransportRoute; |
-// Generic interface for Chromotocol connection used by both client and host. |
-// Provides access to the connection channels, but doesn't depend on the |
-// protocol used for each channel. |
+// Session is responsible for initializing and authenticating both incoming and |
+// outgoing connections. It uses TransportInfoSink interface to pass |
+// transport-info messages to the transport. |
class Session { |
public: |
enum State { |
@@ -42,9 +48,6 @@ class Session { |
// Session has been connected and authenticated. |
AUTHENTICATED, |
- // Session has been connected. |
- CONNECTED, |
- |
// Session has been closed. |
CLOSED, |
@@ -61,12 +64,6 @@ class Session { |
// the session from within the handler if |state| is AUTHENTICATING |
// or CLOSED or FAILED. |
virtual void OnSessionStateChange(State state) = 0; |
- |
- // Called whenever route for the channel specified with |
- // |channel_name| changes. Session must not be destroyed by the |
- // handler of this event. |
- virtual void OnSessionRouteChange(const std::string& channel_name, |
- const TransportRoute& route) = 0; |
}; |
Session() {} |
@@ -86,10 +83,11 @@ class Session { |
// Returned pointer is valid until connection is closed. |
virtual const SessionConfig& config() = 0; |
- // Returns Transport that can be used to create transport channels. |
- virtual Transport* GetTransport() = 0; |
+ // Sets Transport to be used by the session. Must be called before the |
+ // session becomes AUTHENTICATED. The transport must outlive the session. |
+ virtual void SetTransport(Transport* transport) = 0; |
- // Closes connection. Callbacks are guaranteed not to be called after this |
+ // Closes connection. EventHandler is guaranteed not to be called after this |
// method returns. |error| specifies the error code in case when the session |
// is being closed due to an error. |
virtual void Close(ErrorCode error) = 0; |