| 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 16 matching lines...) Expand all Loading... |
| 27 #include "remoting/protocol/session_manager.h" | 27 #include "remoting/protocol/session_manager.h" |
| 28 | 28 |
| 29 namespace base { | 29 namespace base { |
| 30 class SingleThreadTaskRunner; | 30 class SingleThreadTaskRunner; |
| 31 } // namespace base | 31 } // namespace base |
| 32 | 32 |
| 33 namespace remoting { | 33 namespace remoting { |
| 34 | 34 |
| 35 namespace protocol { | 35 namespace protocol { |
| 36 class InputStub; | 36 class InputStub; |
| 37 class TransportContext; |
| 37 } // namespace protocol | 38 } // namespace protocol |
| 38 | 39 |
| 39 class DesktopEnvironmentFactory; | 40 class DesktopEnvironmentFactory; |
| 40 | 41 |
| 41 // A class to implement the functionality of a host process. | 42 // A class to implement the functionality of a host process. |
| 42 // | 43 // |
| 43 // Here's the work flow of this class: | 44 // Here's the work flow of this class: |
| 44 // 1. We should load the saved GAIA ID token or if this is the first | 45 // 1. We should load the saved GAIA ID token or if this is the first |
| 45 // time the host process runs we should prompt user for the | 46 // time the host process runs we should prompt user for the |
| 46 // credential. We will use this token or credentials to authenicate | 47 // credential. We will use this token or credentials to authenicate |
| (...skipping 15 matching lines...) Expand all Loading... |
| 62 // return to the idle state. We then go to step (2) if there a new | 63 // return to the idle state. We then go to step (2) if there a new |
| 63 // incoming connection. | 64 // incoming connection. |
| 64 class ChromotingHost : public base::NonThreadSafe, | 65 class ChromotingHost : public base::NonThreadSafe, |
| 65 public ClientSession::EventHandler, | 66 public ClientSession::EventHandler, |
| 66 public HostStatusMonitor { | 67 public HostStatusMonitor { |
| 67 public: | 68 public: |
| 68 // |desktop_environment_factory| must outlive this object. | 69 // |desktop_environment_factory| must outlive this object. |
| 69 ChromotingHost( | 70 ChromotingHost( |
| 70 DesktopEnvironmentFactory* desktop_environment_factory, | 71 DesktopEnvironmentFactory* desktop_environment_factory, |
| 71 scoped_ptr<protocol::SessionManager> session_manager, | 72 scoped_ptr<protocol::SessionManager> session_manager, |
| 73 scoped_refptr<protocol::TransportContext> transport_context, |
| 72 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, | 74 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, |
| 73 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 75 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
| 74 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner, | 76 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner, |
| 75 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner, | 77 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner, |
| 76 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner, | 78 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner, |
| 77 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | 79 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); |
| 78 ~ChromotingHost() override; | 80 ~ChromotingHost() override; |
| 79 | 81 |
| 80 // Asynchronously starts the host. | 82 // Asynchronously starts the host. |
| 81 // | 83 // |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // shutdown asynchronously, but the caller is guaranteed not to receive | 151 // shutdown asynchronously, but the caller is guaranteed not to receive |
| 150 // callbacks for disconnected clients after this call returns. | 152 // callbacks for disconnected clients after this call returns. |
| 151 void DisconnectAllClients(); | 153 void DisconnectAllClients(); |
| 152 | 154 |
| 153 // Unless specified otherwise all members of this class must be | 155 // Unless specified otherwise all members of this class must be |
| 154 // used on the network thread only. | 156 // used on the network thread only. |
| 155 | 157 |
| 156 // Parameters specified when the host was created. | 158 // Parameters specified when the host was created. |
| 157 DesktopEnvironmentFactory* desktop_environment_factory_; | 159 DesktopEnvironmentFactory* desktop_environment_factory_; |
| 158 scoped_ptr<protocol::SessionManager> session_manager_; | 160 scoped_ptr<protocol::SessionManager> session_manager_; |
| 161 scoped_refptr<protocol::TransportContext> transport_context_; |
| 159 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; | 162 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; |
| 160 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; | 163 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; |
| 161 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner_; | 164 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner_; |
| 162 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner_; | 165 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner_; |
| 163 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; | 166 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; |
| 164 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 167 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
| 165 | 168 |
| 166 // Must be used on the network thread only. | 169 // Must be used on the network thread only. |
| 167 base::ObserverList<HostStatusObserver> status_observers_; | 170 base::ObserverList<HostStatusObserver> status_observers_; |
| 168 | 171 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 188 HostExtensionList extensions_; | 191 HostExtensionList extensions_; |
| 189 | 192 |
| 190 base::WeakPtrFactory<ChromotingHost> weak_factory_; | 193 base::WeakPtrFactory<ChromotingHost> weak_factory_; |
| 191 | 194 |
| 192 DISALLOW_COPY_AND_ASSIGN(ChromotingHost); | 195 DISALLOW_COPY_AND_ASSIGN(ChromotingHost); |
| 193 }; | 196 }; |
| 194 | 197 |
| 195 } // namespace remoting | 198 } // namespace remoting |
| 196 | 199 |
| 197 #endif // REMOTING_HOST_CHROMOTING_HOST_H_ | 200 #endif // REMOTING_HOST_CHROMOTING_HOST_H_ |
| OLD | NEW |