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