OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 // Protocol configuration. Can be called only after session has been accepted. | 103 // Protocol configuration. Can be called only after session has been accepted. |
104 // Returned pointer is valid until connection is closed. | 104 // Returned pointer is valid until connection is closed. |
105 virtual const SessionConfig& config() = 0; | 105 virtual const SessionConfig& config() = 0; |
106 | 106 |
107 // Set protocol configuration for an incoming session. Must be | 107 // Set protocol configuration for an incoming session. Must be |
108 // called on the host before the connection is accepted, from | 108 // called on the host before the connection is accepted, from |
109 // ChromotocolServer::IncomingConnectionCallback. | 109 // ChromotocolServer::IncomingConnectionCallback. |
110 virtual void set_config(const SessionConfig& config) = 0; | 110 virtual void set_config(const SessionConfig& config) = 0; |
111 | 111 |
112 // The raw auth tokens from the session-initiate, or session-accept stanzas. | |
113 virtual const std::string& initiator_token() = 0; | |
114 virtual void set_initiator_token(const std::string& initiator_token) = 0; | |
115 virtual const std::string& receiver_token() = 0; | |
116 virtual void set_receiver_token(const std::string& receiver_token) = 0; | |
117 | |
118 // A shared secret to use to mutually-authenticate the SSL channels. | |
119 virtual void set_shared_secret(const std::string& secret) = 0; | |
120 virtual const std::string& shared_secret() = 0; | |
121 | |
122 // Closes connection. Callbacks are guaranteed not to be called | 112 // Closes connection. Callbacks are guaranteed not to be called |
123 // after this method returns. Must be called before the object is | 113 // after this method returns. Must be called before the object is |
124 // destroyed, unless the state is set to FAILED or CLOSED. | 114 // destroyed, unless the state is set to FAILED or CLOSED. |
125 virtual void Close() = 0; | 115 virtual void Close() = 0; |
126 | 116 |
127 private: | 117 private: |
128 DISALLOW_COPY_AND_ASSIGN(Session); | 118 DISALLOW_COPY_AND_ASSIGN(Session); |
129 }; | 119 }; |
130 | 120 |
131 } // namespace protocol | 121 } // namespace protocol |
132 } // namespace remoting | 122 } // namespace remoting |
133 | 123 |
134 #endif // REMOTING_PROTOCOL_SESSION_H_ | 124 #endif // REMOTING_PROTOCOL_SESSION_H_ |
OLD | NEW |