| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef REMOTING_PROTOCOL_SESSION_H_ | 5 #ifndef REMOTING_PROTOCOL_SESSION_H_ |
| 6 #define REMOTING_PROTOCOL_SESSION_H_ | 6 #define REMOTING_PROTOCOL_SESSION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "remoting/protocol/errors.h" | 10 #include "remoting/protocol/errors.h" |
| 11 #include "remoting/protocol/session_config.h" | 11 #include "remoting/protocol/session_config.h" |
| 12 | 12 |
| 13 namespace net { |
| 14 class IPEndPoint; |
| 15 } // namespace net |
| 16 |
| 13 namespace remoting { | 17 namespace remoting { |
| 14 namespace protocol { | 18 namespace protocol { |
| 15 | 19 |
| 16 class StreamChannelFactory; | 20 class StreamChannelFactory; |
| 17 class TransportSession; | |
| 18 struct TransportRoute; | 21 struct TransportRoute; |
| 19 | 22 |
| 20 // Generic interface for Chromotocol connection used by both client and host. | 23 // Generic interface for Chromotocol connection used by both client and host. |
| 21 // Provides access to the connection channels, but doesn't depend on the | 24 // Provides access to the connection channels, but doesn't depend on the |
| 22 // protocol used for each channel. | 25 // protocol used for each channel. |
| 23 class Session { | 26 class Session { |
| 24 public: | 27 public: |
| 25 enum State { | 28 enum State { |
| 26 // Created, but not connecting yet. | 29 // Created, but not connecting yet. |
| 27 INITIALIZING, | 30 INITIALIZING, |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // Returns error code for a failed session. | 78 // Returns error code for a failed session. |
| 76 virtual ErrorCode error() = 0; | 79 virtual ErrorCode error() = 0; |
| 77 | 80 |
| 78 // JID of the other side. | 81 // JID of the other side. |
| 79 virtual const std::string& jid() = 0; | 82 virtual const std::string& jid() = 0; |
| 80 | 83 |
| 81 // Protocol configuration. Can be called only after session has been accepted. | 84 // Protocol configuration. Can be called only after session has been accepted. |
| 82 // Returned pointer is valid until connection is closed. | 85 // Returned pointer is valid until connection is closed. |
| 83 virtual const SessionConfig& config() = 0; | 86 virtual const SessionConfig& config() = 0; |
| 84 | 87 |
| 85 // Returns TransportSession that can be used to create transport channels. | 88 // GetTransportChannelFactory() returns a factory that creates a new transport |
| 86 virtual TransportSession* GetTransportSession() = 0; | 89 // channel for each logical channel. GetMultiplexedChannelFactory() channels |
| 87 | 90 // share a single underlying transport channel |
| 88 // Channel factory for QUIC-based channels. Returns nullptr when QUIC is | 91 virtual StreamChannelFactory* GetTransportChannelFactory() = 0; |
| 89 // disabled for the session. | 92 virtual StreamChannelFactory* GetMultiplexedChannelFactory() = 0; |
| 90 virtual StreamChannelFactory* GetQuicChannelFactory() = 0; | 93 virtual StreamChannelFactory* GetQuicChannelFactory() = 0; |
| 91 | 94 |
| 92 // Closes connection. Callbacks are guaranteed not to be called | 95 // Closes connection. Callbacks are guaranteed not to be called |
| 93 // after this method returns. Must be called before the object is | 96 // after this method returns. Must be called before the object is |
| 94 // destroyed, unless the state is set to FAILED or CLOSED. | 97 // destroyed, unless the state is set to FAILED or CLOSED. |
| 95 virtual void Close() = 0; | 98 virtual void Close() = 0; |
| 96 | 99 |
| 97 private: | 100 private: |
| 98 DISALLOW_COPY_AND_ASSIGN(Session); | 101 DISALLOW_COPY_AND_ASSIGN(Session); |
| 99 }; | 102 }; |
| 100 | 103 |
| 101 } // namespace protocol | 104 } // namespace protocol |
| 102 } // namespace remoting | 105 } // namespace remoting |
| 103 | 106 |
| 104 #endif // REMOTING_PROTOCOL_SESSION_H_ | 107 #endif // REMOTING_PROTOCOL_SESSION_H_ |
| OLD | NEW |