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 |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
13 #include "base/threading/thread.h" | 13 #include "base/threading/thread.h" |
14 #include "net/base/backoff_entry.h" | 14 #include "net/base/backoff_entry.h" |
15 #include "remoting/base/encoder.h" | 15 #include "remoting/base/encoder.h" |
16 #include "remoting/host/capturer.h" | 16 #include "remoting/host/capturer.h" |
17 #include "remoting/host/client_session.h" | 17 #include "remoting/host/client_session.h" |
18 #include "remoting/host/desktop_environment.h" | 18 #include "remoting/host/desktop_environment.h" |
19 #include "remoting/host/host_key_pair.h" | 19 #include "remoting/host/host_key_pair.h" |
20 #include "remoting/host/host_status_observer.h" | 20 #include "remoting/host/host_status_observer.h" |
21 #include "remoting/host/mouse_move_observer.h" | 21 #include "remoting/host/mouse_move_observer.h" |
22 #include "remoting/host/network_settings.h" | |
23 #include "remoting/host/ui_strings.h" | 22 #include "remoting/host/ui_strings.h" |
24 #include "remoting/jingle_glue/jingle_thread.h" | |
25 #include "remoting/jingle_glue/signal_strategy.h" | |
26 #include "remoting/protocol/authenticator.h" | 23 #include "remoting/protocol/authenticator.h" |
27 #include "remoting/protocol/session_manager.h" | 24 #include "remoting/protocol/session_manager.h" |
28 #include "remoting/protocol/connection_to_client.h" | 25 #include "remoting/protocol/connection_to_client.h" |
29 | 26 |
30 namespace remoting { | 27 namespace remoting { |
31 | 28 |
32 namespace protocol { | 29 namespace protocol { |
33 class InputStub; | 30 class InputStub; |
34 class SessionConfig; | 31 class SessionConfig; |
35 class CandidateSessionConfig; | 32 class CandidateSessionConfig; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>, | 64 class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>, |
68 public ClientSession::EventHandler, | 65 public ClientSession::EventHandler, |
69 public protocol::SessionManager::Listener, | 66 public protocol::SessionManager::Listener, |
70 public MouseMoveObserver { | 67 public MouseMoveObserver { |
71 public: | 68 public: |
72 // The caller must ensure that |context|, |signal_strategy| and | 69 // The caller must ensure that |context|, |signal_strategy| and |
73 // |environment| out-live the host. | 70 // |environment| out-live the host. |
74 ChromotingHost(ChromotingHostContext* context, | 71 ChromotingHost(ChromotingHostContext* context, |
75 SignalStrategy* signal_strategy, | 72 SignalStrategy* signal_strategy, |
76 DesktopEnvironment* environment, | 73 DesktopEnvironment* environment, |
77 const NetworkSettings& network_settings); | 74 scoped_ptr<protocol::SessionManager> session_manager); |
78 | 75 |
79 // Asynchronously start the host process. | 76 // Asynchronously start the host process. |
80 // | 77 // |
81 // After this is invoked, the host process will connect to the talk | 78 // After this is invoked, the host process will connect to the talk |
82 // network and start listening for incoming connections. | 79 // network and start listening for incoming connections. |
83 // | 80 // |
84 // This method can only be called once during the lifetime of this object. | 81 // This method can only be called once during the lifetime of this object. |
85 void Start(); | 82 void Start(); |
86 | 83 |
87 // Asynchronously shutdown the host process. |shutdown_task| is | 84 // Asynchronously shutdown the host process. |shutdown_task| is |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 174 |
178 // Called from Shutdown() or OnScreenRecorderStopped() to finish shutdown. | 175 // Called from Shutdown() or OnScreenRecorderStopped() to finish shutdown. |
179 void ShutdownFinish(); | 176 void ShutdownFinish(); |
180 | 177 |
181 // Unless specified otherwise all members of this class must be | 178 // Unless specified otherwise all members of this class must be |
182 // used on the network thread only. | 179 // used on the network thread only. |
183 | 180 |
184 // Parameters specified when the host was created. | 181 // Parameters specified when the host was created. |
185 ChromotingHostContext* context_; | 182 ChromotingHostContext* context_; |
186 DesktopEnvironment* desktop_environment_; | 183 DesktopEnvironment* desktop_environment_; |
187 NetworkSettings network_settings_; | 184 scoped_ptr<protocol::SessionManager> session_manager_; |
188 | 185 |
189 // Connection objects. | 186 // Connection objects. |
190 SignalStrategy* signal_strategy_; | 187 SignalStrategy* signal_strategy_; |
191 scoped_ptr<protocol::SessionManager> session_manager_; | |
192 | 188 |
193 // Must be used on the network thread only. | 189 // Must be used on the network thread only. |
194 ObserverList<HostStatusObserver> status_observers_; | 190 ObserverList<HostStatusObserver> status_observers_; |
195 | 191 |
196 // The connections to remote clients. | 192 // The connections to remote clients. |
197 ClientList clients_; | 193 ClientList clients_; |
198 | 194 |
199 // Session manager for the host process. | 195 // Session manager for the host process. |
200 // TODO(sergeyu): Do we need to have one screen recorder per client? | 196 // TODO(sergeyu): Do we need to have one screen recorder per client? |
201 scoped_refptr<ScreenRecorder> recorder_; | 197 scoped_refptr<ScreenRecorder> recorder_; |
(...skipping 24 matching lines...) Expand all Loading... |
226 // TODO(sergeyu): The following members do not belong to | 222 // TODO(sergeyu): The following members do not belong to |
227 // ChromotingHost and should be moved elsewhere. | 223 // ChromotingHost and should be moved elsewhere. |
228 UiStrings ui_strings_; | 224 UiStrings ui_strings_; |
229 | 225 |
230 DISALLOW_COPY_AND_ASSIGN(ChromotingHost); | 226 DISALLOW_COPY_AND_ASSIGN(ChromotingHost); |
231 }; | 227 }; |
232 | 228 |
233 } // namespace remoting | 229 } // namespace remoting |
234 | 230 |
235 #endif // REMOTING_HOST_CHROMOTING_HOST_H_ | 231 #endif // REMOTING_HOST_CHROMOTING_HOST_H_ |
OLD | NEW |