| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 public MouseMoveObserver { | 66 public MouseMoveObserver { |
| 67 public: | 67 public: |
| 68 // The caller must ensure that |signal_strategy| and | 68 // The caller must ensure that |signal_strategy| and |
| 69 // |desktop_environment_factory| remain valid at least until the | 69 // |desktop_environment_factory| remain valid at least until the |
| 70 // |shutdown_task| supplied to Shutdown() has been notified. | 70 // |shutdown_task| supplied to Shutdown() has been notified. |
| 71 ChromotingHost( | 71 ChromotingHost( |
| 72 SignalStrategy* signal_strategy, | 72 SignalStrategy* signal_strategy, |
| 73 DesktopEnvironmentFactory* desktop_environment_factory, | 73 DesktopEnvironmentFactory* desktop_environment_factory, |
| 74 scoped_ptr<protocol::SessionManager> session_manager, | 74 scoped_ptr<protocol::SessionManager> session_manager, |
| 75 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, | 75 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, |
| 76 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
| 76 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner, | 77 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner, |
| 77 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner, | 78 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner, |
| 78 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner); | 79 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner, |
| 80 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); |
| 79 | 81 |
| 80 // Asynchronously start the host process. | 82 // Asynchronously start the host process. |
| 81 // | 83 // |
| 82 // After this is invoked, the host process will connect to the talk | 84 // After this is invoked, the host process will connect to the talk |
| 83 // network and start listening for incoming connections. | 85 // network and start listening for incoming connections. |
| 84 // | 86 // |
| 85 // 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. |
| 86 void Start(const std::string& xmpp_login); | 88 void Start(const std::string& xmpp_login); |
| 87 | 89 |
| 88 // Asynchronously shutdown the host process. |shutdown_task| is | 90 // Asynchronously shutdown the host process. |shutdown_task| is |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 164 |
| 163 enum State { | 165 enum State { |
| 164 kInitial, | 166 kInitial, |
| 165 kStarted, | 167 kStarted, |
| 166 kStopping, | 168 kStopping, |
| 167 kStopped, | 169 kStopped, |
| 168 }; | 170 }; |
| 169 | 171 |
| 170 virtual ~ChromotingHost(); | 172 virtual ~ChromotingHost(); |
| 171 | 173 |
| 172 // Called when a client session is stopped completely. | |
| 173 void OnClientStopped(); | |
| 174 | |
| 175 // Called from Shutdown() to finish shutdown. | 174 // Called from Shutdown() to finish shutdown. |
| 176 void ShutdownFinish(); | 175 void ShutdownFinish(); |
| 177 | 176 |
| 178 // Unless specified otherwise all members of this class must be | 177 // Unless specified otherwise all members of this class must be |
| 179 // used on the network thread only. | 178 // used on the network thread only. |
| 180 | 179 |
| 181 // Parameters specified when the host was created. | 180 // Parameters specified when the host was created. |
| 182 DesktopEnvironmentFactory* desktop_environment_factory_; | 181 DesktopEnvironmentFactory* desktop_environment_factory_; |
| 183 scoped_ptr<protocol::SessionManager> session_manager_; | 182 scoped_ptr<protocol::SessionManager> session_manager_; |
| 184 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; | 183 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; |
| 184 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; |
| 185 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner_; | 185 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner_; |
| 186 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner_; | 186 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner_; |
| 187 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; | 187 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; |
| 188 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
| 188 | 189 |
| 189 // Connection objects. | 190 // Connection objects. |
| 190 SignalStrategy* signal_strategy_; | 191 SignalStrategy* signal_strategy_; |
| 191 | 192 |
| 192 // Must be used on the network thread only. | 193 // Must be used on the network thread only. |
| 193 ObserverList<HostStatusObserver> status_observers_; | 194 ObserverList<HostStatusObserver> status_observers_; |
| 194 | 195 |
| 195 // The connections to remote clients. | 196 // The connections to remote clients. |
| 196 ClientList clients_; | 197 ClientList clients_; |
| 197 | 198 |
| 198 // The number of allocated |ClientSession| objects. |clients_count_| can be | |
| 199 // greater than |clients_.size()| because it also includes the objects that | |
| 200 // are about to be deleted. | |
| 201 int clients_count_; | |
| 202 | |
| 203 // Tracks the internal state of the host. | 199 // Tracks the internal state of the host. |
| 204 State state_; | 200 State state_; |
| 205 | 201 |
| 206 // Configuration of the protocol. | 202 // Configuration of the protocol. |
| 207 scoped_ptr<protocol::CandidateSessionConfig> protocol_config_; | 203 scoped_ptr<protocol::CandidateSessionConfig> protocol_config_; |
| 208 | 204 |
| 209 // Login backoff state. | 205 // Login backoff state. |
| 210 net::BackoffEntry login_backoff_; | 206 net::BackoffEntry login_backoff_; |
| 211 | 207 |
| 212 // Flags used for RejectAuthenticatingClient(). | 208 // Flags used for RejectAuthenticatingClient(). |
| (...skipping 10 matching lines...) Expand all Loading... |
| 223 | 219 |
| 224 // The maximum duration of any session. | 220 // The maximum duration of any session. |
| 225 base::TimeDelta max_session_duration_; | 221 base::TimeDelta max_session_duration_; |
| 226 | 222 |
| 227 DISALLOW_COPY_AND_ASSIGN(ChromotingHost); | 223 DISALLOW_COPY_AND_ASSIGN(ChromotingHost); |
| 228 }; | 224 }; |
| 229 | 225 |
| 230 } // namespace remoting | 226 } // namespace remoting |
| 231 | 227 |
| 232 #endif // REMOTING_HOST_CHROMOTING_HOST_H_ | 228 #endif // REMOTING_HOST_CHROMOTING_HOST_H_ |
| OLD | NEW |