| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // This method can only be called once during the lifetime of this object. | 87 // This method can only be called once during the lifetime of this object. |
| 88 void Start(const std::string& host_owner); | 88 void Start(const std::string& host_owner); |
| 89 | 89 |
| 90 // HostStatusMonitor interface. | 90 // HostStatusMonitor interface. |
| 91 void AddStatusObserver(HostStatusObserver* observer) override; | 91 void AddStatusObserver(HostStatusObserver* observer) override; |
| 92 void RemoveStatusObserver(HostStatusObserver* observer) override; | 92 void RemoveStatusObserver(HostStatusObserver* observer) override; |
| 93 | 93 |
| 94 // Registers a host extension. | 94 // Registers a host extension. |
| 95 void AddExtension(scoped_ptr<HostExtension> extension); | 95 void AddExtension(scoped_ptr<HostExtension> extension); |
| 96 | 96 |
| 97 // This method may be called only from | |
| 98 // HostStatusObserver::OnClientAuthenticated() to reject the new | |
| 99 // client. | |
| 100 void RejectAuthenticatingClient(); | |
| 101 | |
| 102 // Sets the authenticator factory to use for incoming | 97 // Sets the authenticator factory to use for incoming |
| 103 // connections. Incoming connections are rejected until | 98 // connections. Incoming connections are rejected until |
| 104 // authenticator factory is set. Must be called on the network | 99 // authenticator factory is set. Must be called on the network |
| 105 // thread after the host is started. Must not be called more than | 100 // thread after the host is started. Must not be called more than |
| 106 // once per host instance because it may not be safe to delete | 101 // once per host instance because it may not be safe to delete |
| 107 // factory before all authenticators it created are deleted. | 102 // factory before all authenticators it created are deleted. |
| 108 void SetAuthenticatorFactory( | 103 void SetAuthenticatorFactory( |
| 109 scoped_ptr<protocol::AuthenticatorFactory> authenticator_factory); | 104 scoped_ptr<protocol::AuthenticatorFactory> authenticator_factory); |
| 110 | 105 |
| 111 // Enables/disables curtaining when one or more clients are connected. | 106 // Enables/disables curtaining when one or more clients are connected. |
| 112 // Takes immediate effect if clients are already connected. | 107 // Takes immediate effect if clients are already connected. |
| 113 void SetEnableCurtaining(bool enable); | 108 void SetEnableCurtaining(bool enable); |
| 114 | 109 |
| 115 // Sets the maximum duration of any session. By default, a session has no | 110 // Sets the maximum duration of any session. By default, a session has no |
| 116 // maximum duration. | 111 // maximum duration. |
| 117 void SetMaximumSessionDuration(const base::TimeDelta& max_session_duration); | 112 void SetMaximumSessionDuration(const base::TimeDelta& max_session_duration); |
| 118 | 113 |
| 119 //////////////////////////////////////////////////////////////////////////// | 114 //////////////////////////////////////////////////////////////////////////// |
| 120 // ClientSession::EventHandler implementation. | 115 // ClientSession::EventHandler implementation. |
| 121 void OnSessionAuthenticating(ClientSession* client) override; | 116 void OnSessionAuthenticating(ClientSession* client) override; |
| 122 bool OnSessionAuthenticated(ClientSession* client) override; | 117 void OnSessionAuthenticated(ClientSession* client) override; |
| 123 void OnSessionChannelsConnected(ClientSession* client) override; | 118 void OnSessionChannelsConnected(ClientSession* client) override; |
| 124 void OnSessionAuthenticationFailed(ClientSession* client) override; | 119 void OnSessionAuthenticationFailed(ClientSession* client) override; |
| 125 void OnSessionClosed(ClientSession* session) override; | 120 void OnSessionClosed(ClientSession* session) override; |
| 126 void OnSessionRouteChange(ClientSession* session, | 121 void OnSessionRouteChange(ClientSession* session, |
| 127 const std::string& channel_name, | 122 const std::string& channel_name, |
| 128 const protocol::TransportRoute& route) override; | 123 const protocol::TransportRoute& route) override; |
| 129 | 124 |
| 130 // SessionManager::Listener implementation. | 125 // SessionManager::Listener implementation. |
| 131 void OnSessionManagerReady() override; | 126 void OnSessionManagerReady() override; |
| 132 void OnIncomingSession( | 127 void OnIncomingSession( |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 174 |
| 180 // The connections to remote clients. | 175 // The connections to remote clients. |
| 181 ClientList clients_; | 176 ClientList clients_; |
| 182 | 177 |
| 183 // True if the host has been started. | 178 // True if the host has been started. |
| 184 bool started_; | 179 bool started_; |
| 185 | 180 |
| 186 // Login backoff state. | 181 // Login backoff state. |
| 187 net::BackoffEntry login_backoff_; | 182 net::BackoffEntry login_backoff_; |
| 188 | 183 |
| 189 // Flags used for RejectAuthenticatingClient(). | |
| 190 bool authenticating_client_; | |
| 191 bool reject_authenticating_client_; | |
| 192 | |
| 193 // True if the curtain mode is enabled. | 184 // True if the curtain mode is enabled. |
| 194 bool enable_curtaining_; | 185 bool enable_curtaining_; |
| 195 | 186 |
| 196 // The maximum duration of any session. | 187 // The maximum duration of any session. |
| 197 base::TimeDelta max_session_duration_; | 188 base::TimeDelta max_session_duration_; |
| 198 | 189 |
| 199 // The pairing registry for PIN-less authentication. | 190 // The pairing registry for PIN-less authentication. |
| 200 scoped_refptr<protocol::PairingRegistry> pairing_registry_; | 191 scoped_refptr<protocol::PairingRegistry> pairing_registry_; |
| 201 | 192 |
| 202 // List of host extensions. | 193 // List of host extensions. |
| 203 HostExtensionList extensions_; | 194 HostExtensionList extensions_; |
| 204 | 195 |
| 205 base::WeakPtrFactory<ChromotingHost> weak_factory_; | 196 base::WeakPtrFactory<ChromotingHost> weak_factory_; |
| 206 | 197 |
| 207 DISALLOW_COPY_AND_ASSIGN(ChromotingHost); | 198 DISALLOW_COPY_AND_ASSIGN(ChromotingHost); |
| 208 }; | 199 }; |
| 209 | 200 |
| 210 } // namespace remoting | 201 } // namespace remoting |
| 211 | 202 |
| 212 #endif // REMOTING_HOST_CHROMOTING_HOST_H_ | 203 #endif // REMOTING_HOST_CHROMOTING_HOST_H_ |
| OLD | NEW |