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 { | 13 namespace net { |
14 class IPEndPoint; | 14 class IPEndPoint; |
15 } // namespace net | 15 } // namespace net |
16 | 16 |
17 namespace remoting { | 17 namespace remoting { |
18 namespace protocol { | 18 namespace protocol { |
19 | 19 |
20 class StreamChannelFactory; | 20 class ChannelFactory; |
21 struct TransportRoute; | 21 struct TransportRoute; |
22 | 22 |
23 // Generic interface for Chromotocol connection used by both client and host. | 23 // Generic interface for Chromotocol connection used by both client and host. |
24 // 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 |
25 // protocol used for each channel. | 25 // protocol used for each channel. |
26 class Session { | 26 class Session { |
27 public: | 27 public: |
28 enum State { | 28 enum State { |
29 // Created, but not connecting yet. | 29 // Created, but not connecting yet. |
30 INITIALIZING, | 30 INITIALIZING, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 virtual const SessionConfig& config() = 0; | 92 virtual const SessionConfig& config() = 0; |
93 | 93 |
94 // Set protocol configuration for an incoming session. Must be | 94 // Set protocol configuration for an incoming session. Must be |
95 // called on the host before the connection is accepted, from | 95 // called on the host before the connection is accepted, from |
96 // ChromotocolServer::IncomingConnectionCallback. | 96 // ChromotocolServer::IncomingConnectionCallback. |
97 virtual void set_config(const SessionConfig& config) = 0; | 97 virtual void set_config(const SessionConfig& config) = 0; |
98 | 98 |
99 // GetTransportChannelFactory() returns a factory that creates a new transport | 99 // GetTransportChannelFactory() returns a factory that creates a new transport |
100 // channel for each logical channel. GetMultiplexedChannelFactory() channels | 100 // channel for each logical channel. GetMultiplexedChannelFactory() channels |
101 // share a single underlying transport channel | 101 // share a single underlying transport channel |
102 virtual StreamChannelFactory* GetTransportChannelFactory() = 0; | 102 virtual ChannelFactory* GetTransportChannelFactory() = 0; |
103 virtual StreamChannelFactory* GetMultiplexedChannelFactory() = 0; | 103 virtual ChannelFactory* GetMultiplexedChannelFactory() = 0; |
104 | 104 |
105 // Closes connection. Callbacks are guaranteed not to be called | 105 // Closes connection. Callbacks are guaranteed not to be called |
106 // after this method returns. Must be called before the object is | 106 // after this method returns. Must be called before the object is |
107 // destroyed, unless the state is set to FAILED or CLOSED. | 107 // destroyed, unless the state is set to FAILED or CLOSED. |
108 virtual void Close() = 0; | 108 virtual void Close() = 0; |
109 | 109 |
110 private: | 110 private: |
111 DISALLOW_COPY_AND_ASSIGN(Session); | 111 DISALLOW_COPY_AND_ASSIGN(Session); |
112 }; | 112 }; |
113 | 113 |
114 } // namespace protocol | 114 } // namespace protocol |
115 } // namespace remoting | 115 } // namespace remoting |
116 | 116 |
117 #endif // REMOTING_PROTOCOL_SESSION_H_ | 117 #endif // REMOTING_PROTOCOL_SESSION_H_ |
OLD | NEW |