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" |
(...skipping 11 matching lines...) Expand all Loading... |
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, |
31 | 31 |
32 // Sent or received session-initiate, but haven't sent or received | 32 // Sent session-initiate, but haven't received session-accept. |
33 // session-accept. | |
34 // TODO(sergeyu): Do we really need this state? | |
35 CONNECTING, | 33 CONNECTING, |
36 | 34 |
| 35 // Received session-initiate, but haven't sent session-accept. |
| 36 ACCEPTING, |
| 37 |
37 // Session has been accepted and is pending authentication. | 38 // Session has been accepted and is pending authentication. |
38 CONNECTED, | 39 CONNECTED, |
39 | 40 |
40 // Session has been connected and authenticated. | 41 // Session has been connected and authenticated. |
41 AUTHENTICATED, | 42 AUTHENTICATED, |
42 | 43 |
43 // Session has been closed. | 44 // Session has been closed. |
44 CLOSED, | 45 CLOSED, |
45 | 46 |
46 // Connection has failed. | 47 // Connection has failed. |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 virtual void Close() = 0; | 111 virtual void Close() = 0; |
111 | 112 |
112 private: | 113 private: |
113 DISALLOW_COPY_AND_ASSIGN(Session); | 114 DISALLOW_COPY_AND_ASSIGN(Session); |
114 }; | 115 }; |
115 | 116 |
116 } // namespace protocol | 117 } // namespace protocol |
117 } // namespace remoting | 118 } // namespace remoting |
118 | 119 |
119 #endif // REMOTING_PROTOCOL_SESSION_H_ | 120 #endif // REMOTING_PROTOCOL_SESSION_H_ |
OLD | NEW |