| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // connection is closed. | 87 // connection is closed. |
| 88 virtual const CandidateSessionConfig* candidate_config() = 0; | 88 virtual const CandidateSessionConfig* candidate_config() = 0; |
| 89 | 89 |
| 90 // Protocol configuration. Can be called only after session has been accepted. | 90 // Protocol configuration. Can be called only after session has been accepted. |
| 91 // Returned pointer is valid until connection is closed. | 91 // Returned pointer is valid until connection is closed. |
| 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(scoped_ptr<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 StreamChannelFactory* GetTransportChannelFactory() = 0; |
| 103 virtual StreamChannelFactory* GetMultiplexedChannelFactory() = 0; | 103 virtual StreamChannelFactory* 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 |