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 |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
16 #include "base/threading/non_thread_safe.h" | 16 #include "base/threading/non_thread_safe.h" |
17 #include "base/threading/thread.h" | 17 #include "base/threading/thread.h" |
18 #include "net/base/backoff_entry.h" | 18 #include "net/base/backoff_entry.h" |
19 #include "remoting/host/client_session.h" | 19 #include "remoting/host/client_session.h" |
| 20 #include "remoting/host/host_exit_codes.h" |
20 #include "remoting/host/host_extension.h" | 21 #include "remoting/host/host_extension.h" |
21 #include "remoting/host/host_status_monitor.h" | 22 #include "remoting/host/host_status_monitor.h" |
22 #include "remoting/host/host_status_observer.h" | 23 #include "remoting/host/host_status_observer.h" |
23 #include "remoting/protocol/authenticator.h" | 24 #include "remoting/protocol/authenticator.h" |
24 #include "remoting/protocol/connection_to_client.h" | 25 #include "remoting/protocol/connection_to_client.h" |
25 #include "remoting/protocol/pairing_registry.h" | 26 #include "remoting/protocol/pairing_registry.h" |
26 #include "remoting/protocol/session_manager.h" | 27 #include "remoting/protocol/session_manager.h" |
27 | 28 |
28 namespace base { | 29 namespace base { |
29 class SingleThreadTaskRunner; | 30 class SingleThreadTaskRunner; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | 82 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); |
82 ~ChromotingHost() override; | 83 ~ChromotingHost() override; |
83 | 84 |
84 // Asynchronously starts the host. | 85 // Asynchronously starts the host. |
85 // | 86 // |
86 // After this is invoked, the host process will connect to the talk | 87 // After this is invoked, the host process will connect to the talk |
87 // network and start listening for incoming connections. | 88 // network and start listening for incoming connections. |
88 // | 89 // |
89 // This method can only be called once during the lifetime of this object. | 90 // This method can only be called once during the lifetime of this object. |
90 void Start(const std::string& host_owner); | 91 void Start(const std::string& host_owner); |
| 92 void SetExitCode(HostExitCodes exit_code); |
91 | 93 |
92 // HostStatusMonitor interface. | 94 // HostStatusMonitor interface. |
93 void AddStatusObserver(HostStatusObserver* observer) override; | 95 void AddStatusObserver(HostStatusObserver* observer) override; |
94 void RemoveStatusObserver(HostStatusObserver* observer) override; | 96 void RemoveStatusObserver(HostStatusObserver* observer) override; |
95 | 97 |
96 // Registers a host extension. | 98 // Registers a host extension. |
97 void AddExtension(scoped_ptr<HostExtension> extension); | 99 void AddExtension(scoped_ptr<HostExtension> extension); |
98 | 100 |
99 // This method may be called only from | 101 // This method may be called only from |
100 // HostStatusObserver::OnClientAuthenticated() to reject the new | 102 // HostStatusObserver::OnClientAuthenticated() to reject the new |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 SignalStrategy* signal_strategy_; | 187 SignalStrategy* signal_strategy_; |
186 | 188 |
187 // Must be used on the network thread only. | 189 // Must be used on the network thread only. |
188 ObserverList<HostStatusObserver> status_observers_; | 190 ObserverList<HostStatusObserver> status_observers_; |
189 | 191 |
190 // The connections to remote clients. | 192 // The connections to remote clients. |
191 ClientList clients_; | 193 ClientList clients_; |
192 | 194 |
193 // True if the host has been started. | 195 // True if the host has been started. |
194 bool started_; | 196 bool started_; |
| 197 HostExitCodes exit_code_; |
195 | 198 |
196 // Configuration of the protocol. | 199 // Configuration of the protocol. |
197 scoped_ptr<protocol::CandidateSessionConfig> protocol_config_; | 200 scoped_ptr<protocol::CandidateSessionConfig> protocol_config_; |
198 | 201 |
199 // Login backoff state. | 202 // Login backoff state. |
200 net::BackoffEntry login_backoff_; | 203 net::BackoffEntry login_backoff_; |
201 | 204 |
202 // Flags used for RejectAuthenticatingClient(). | 205 // Flags used for RejectAuthenticatingClient(). |
203 bool authenticating_client_; | 206 bool authenticating_client_; |
204 bool reject_authenticating_client_; | 207 bool reject_authenticating_client_; |
(...skipping 11 matching lines...) Expand all Loading... |
216 HostExtensionList extensions_; | 219 HostExtensionList extensions_; |
217 | 220 |
218 base::WeakPtrFactory<ChromotingHost> weak_factory_; | 221 base::WeakPtrFactory<ChromotingHost> weak_factory_; |
219 | 222 |
220 DISALLOW_COPY_AND_ASSIGN(ChromotingHost); | 223 DISALLOW_COPY_AND_ASSIGN(ChromotingHost); |
221 }; | 224 }; |
222 | 225 |
223 } // namespace remoting | 226 } // namespace remoting |
224 | 227 |
225 #endif // REMOTING_HOST_CHROMOTING_HOST_H_ | 228 #endif // REMOTING_HOST_CHROMOTING_HOST_H_ |
OLD | NEW |