| 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_HOST_CHROMOTING_HOST_H_ | 5 #ifndef REMOTING_HOST_CHROMOTING_HOST_H_ |
| 6 #define REMOTING_HOST_CHROMOTING_HOST_H_ | 6 #define REMOTING_HOST_CHROMOTING_HOST_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 ClientSession* session, | 132 ClientSession* session, |
| 133 const std::string& channel_name, | 133 const std::string& channel_name, |
| 134 const protocol::TransportRoute& route) OVERRIDE; | 134 const protocol::TransportRoute& route) OVERRIDE; |
| 135 | 135 |
| 136 // SessionManager::Listener implementation. | 136 // SessionManager::Listener implementation. |
| 137 virtual void OnSessionManagerReady() OVERRIDE; | 137 virtual void OnSessionManagerReady() OVERRIDE; |
| 138 virtual void OnIncomingSession( | 138 virtual void OnIncomingSession( |
| 139 protocol::Session* session, | 139 protocol::Session* session, |
| 140 protocol::SessionManager::IncomingSessionResponse* response) OVERRIDE; | 140 protocol::SessionManager::IncomingSessionResponse* response) OVERRIDE; |
| 141 | 141 |
| 142 // Gets the candidate configuration for the protocol. |
| 143 const protocol::CandidateSessionConfig* protocol_config() const { |
| 144 return protocol_config_.get(); |
| 145 } |
| 146 |
| 142 // Sets desired configuration for the protocol. Must be called before Start(). | 147 // Sets desired configuration for the protocol. Must be called before Start(). |
| 143 void set_protocol_config(scoped_ptr<protocol::CandidateSessionConfig> config); | 148 void set_protocol_config(scoped_ptr<protocol::CandidateSessionConfig> config); |
| 144 | 149 |
| 145 base::WeakPtr<ChromotingHost> AsWeakPtr() { | |
| 146 return weak_factory_.GetWeakPtr(); | |
| 147 } | |
| 148 | |
| 149 // The host uses a pairing registry to generate and store pairing information | 150 // The host uses a pairing registry to generate and store pairing information |
| 150 // for clients for PIN-less authentication. | 151 // for clients for PIN-less authentication. |
| 151 scoped_refptr<protocol::PairingRegistry> pairing_registry() const { | 152 scoped_refptr<protocol::PairingRegistry> pairing_registry() const { |
| 152 return pairing_registry_; | 153 return pairing_registry_; |
| 153 } | 154 } |
| 154 void set_pairing_registry( | 155 void set_pairing_registry( |
| 155 scoped_refptr<protocol::PairingRegistry> pairing_registry) { | 156 scoped_refptr<protocol::PairingRegistry> pairing_registry) { |
| 156 pairing_registry_ = pairing_registry; | 157 pairing_registry_ = pairing_registry; |
| 157 } | 158 } |
| 158 | 159 |
| 160 base::WeakPtr<ChromotingHost> AsWeakPtr() { |
| 161 return weak_factory_.GetWeakPtr(); |
| 162 } |
| 163 |
| 159 private: | 164 private: |
| 160 friend class ChromotingHostTest; | 165 friend class ChromotingHostTest; |
| 161 | 166 |
| 162 typedef std::list<ClientSession*> ClientList; | 167 typedef std::list<ClientSession*> ClientList; |
| 163 typedef ScopedVector<HostExtension> HostExtensionList; | 168 typedef ScopedVector<HostExtension> HostExtensionList; |
| 164 | 169 |
| 165 // Immediately disconnects all active clients. Host-internal components may | 170 // Immediately disconnects all active clients. Host-internal components may |
| 166 // shutdown asynchronously, but the caller is guaranteed not to receive | 171 // shutdown asynchronously, but the caller is guaranteed not to receive |
| 167 // callbacks for disconnected clients after this call returns. | 172 // callbacks for disconnected clients after this call returns. |
| 168 void DisconnectAllClients(); | 173 void DisconnectAllClients(); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 HostExtensionList extensions_; | 220 HostExtensionList extensions_; |
| 216 | 221 |
| 217 base::WeakPtrFactory<ChromotingHost> weak_factory_; | 222 base::WeakPtrFactory<ChromotingHost> weak_factory_; |
| 218 | 223 |
| 219 DISALLOW_COPY_AND_ASSIGN(ChromotingHost); | 224 DISALLOW_COPY_AND_ASSIGN(ChromotingHost); |
| 220 }; | 225 }; |
| 221 | 226 |
| 222 } // namespace remoting | 227 } // namespace remoting |
| 223 | 228 |
| 224 #endif // REMOTING_HOST_CHROMOTING_HOST_H_ | 229 #endif // REMOTING_HOST_CHROMOTING_HOST_H_ |
| OLD | NEW |