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 // This file implements a standalone host process for Me2Me. | 5 // This file implements a standalone host process for Me2Me. |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 #include "remoting/host/config_watcher.h" | 46 #include "remoting/host/config_watcher.h" |
47 #include "remoting/host/desktop_environment.h" | 47 #include "remoting/host/desktop_environment.h" |
48 #include "remoting/host/desktop_session_connector.h" | 48 #include "remoting/host/desktop_session_connector.h" |
49 #include "remoting/host/dns_blackhole_checker.h" | 49 #include "remoting/host/dns_blackhole_checker.h" |
50 #include "remoting/host/heartbeat_sender.h" | 50 #include "remoting/host/heartbeat_sender.h" |
51 #include "remoting/host/host_change_notification_listener.h" | 51 #include "remoting/host/host_change_notification_listener.h" |
52 #include "remoting/host/host_config.h" | 52 #include "remoting/host/host_config.h" |
53 #include "remoting/host/host_event_logger.h" | 53 #include "remoting/host/host_event_logger.h" |
54 #include "remoting/host/host_exit_codes.h" | 54 #include "remoting/host/host_exit_codes.h" |
55 #include "remoting/host/host_main.h" | 55 #include "remoting/host/host_main.h" |
| 56 #include "remoting/host/host_status_logger.h" |
56 #include "remoting/host/host_status_sender.h" | 57 #include "remoting/host/host_status_sender.h" |
57 #include "remoting/host/ipc_constants.h" | 58 #include "remoting/host/ipc_constants.h" |
58 #include "remoting/host/ipc_desktop_environment.h" | 59 #include "remoting/host/ipc_desktop_environment.h" |
59 #include "remoting/host/ipc_host_event_logger.h" | 60 #include "remoting/host/ipc_host_event_logger.h" |
60 #include "remoting/host/json_host_config.h" | 61 #include "remoting/host/json_host_config.h" |
61 #include "remoting/host/log_to_server.h" | |
62 #include "remoting/host/logging.h" | 62 #include "remoting/host/logging.h" |
63 #include "remoting/host/me2me_desktop_environment.h" | 63 #include "remoting/host/me2me_desktop_environment.h" |
64 #include "remoting/host/pairing_registry_delegate.h" | 64 #include "remoting/host/pairing_registry_delegate.h" |
65 #include "remoting/host/policy_hack/policy_watcher.h" | 65 #include "remoting/host/policy_hack/policy_watcher.h" |
66 #include "remoting/host/session_manager_factory.h" | 66 #include "remoting/host/session_manager_factory.h" |
67 #include "remoting/host/signaling_connector.h" | 67 #include "remoting/host/signaling_connector.h" |
68 #include "remoting/host/token_validator_factory_impl.h" | 68 #include "remoting/host/token_validator_factory_impl.h" |
69 #include "remoting/host/usage_stats_consent.h" | 69 #include "remoting/host/usage_stats_consent.h" |
70 #include "remoting/host/username.h" | 70 #include "remoting/host/username.h" |
71 #include "remoting/jingle_glue/network_settings.h" | 71 #include "remoting/jingle_glue/network_settings.h" |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 bool curtain_required_; | 301 bool curtain_required_; |
302 ThirdPartyAuthConfig third_party_auth_config_; | 302 ThirdPartyAuthConfig third_party_auth_config_; |
303 bool enable_gnubby_auth_; | 303 bool enable_gnubby_auth_; |
304 | 304 |
305 scoped_ptr<OAuthTokenGetter> oauth_token_getter_; | 305 scoped_ptr<OAuthTokenGetter> oauth_token_getter_; |
306 scoped_ptr<XmppSignalStrategy> signal_strategy_; | 306 scoped_ptr<XmppSignalStrategy> signal_strategy_; |
307 scoped_ptr<SignalingConnector> signaling_connector_; | 307 scoped_ptr<SignalingConnector> signaling_connector_; |
308 scoped_ptr<HeartbeatSender> heartbeat_sender_; | 308 scoped_ptr<HeartbeatSender> heartbeat_sender_; |
309 scoped_ptr<HostStatusSender> host_status_sender_; | 309 scoped_ptr<HostStatusSender> host_status_sender_; |
310 scoped_ptr<HostChangeNotificationListener> host_change_notification_listener_; | 310 scoped_ptr<HostChangeNotificationListener> host_change_notification_listener_; |
311 scoped_ptr<LogToServer> log_to_server_; | 311 scoped_ptr<HostStatusLogger> host_status_logger_; |
312 scoped_ptr<HostEventLogger> host_event_logger_; | 312 scoped_ptr<HostEventLogger> host_event_logger_; |
313 | 313 |
314 scoped_ptr<ChromotingHost> host_; | 314 scoped_ptr<ChromotingHost> host_; |
315 | 315 |
316 // Used to keep this HostProcess alive until it is shutdown. | 316 // Used to keep this HostProcess alive until it is shutdown. |
317 scoped_refptr<HostProcess> self_; | 317 scoped_refptr<HostProcess> self_; |
318 | 318 |
319 #if defined(REMOTING_MULTI_PROCESS) | 319 #if defined(REMOTING_MULTI_PROCESS) |
320 DesktopSessionConnector* desktop_session_connector_; | 320 DesktopSessionConnector* desktop_session_connector_; |
321 #endif // defined(REMOTING_MULTI_PROCESS) | 321 #endif // defined(REMOTING_MULTI_PROCESS) |
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1213 heartbeat_sender_.reset(new HeartbeatSender( | 1213 heartbeat_sender_.reset(new HeartbeatSender( |
1214 this, host_id_, signal_strategy_.get(), key_pair_, | 1214 this, host_id_, signal_strategy_.get(), key_pair_, |
1215 directory_bot_jid_)); | 1215 directory_bot_jid_)); |
1216 | 1216 |
1217 host_status_sender_.reset(new HostStatusSender( | 1217 host_status_sender_.reset(new HostStatusSender( |
1218 host_id_, signal_strategy_.get(), key_pair_, directory_bot_jid_)); | 1218 host_id_, signal_strategy_.get(), key_pair_, directory_bot_jid_)); |
1219 | 1219 |
1220 host_change_notification_listener_.reset(new HostChangeNotificationListener( | 1220 host_change_notification_listener_.reset(new HostChangeNotificationListener( |
1221 this, host_id_, signal_strategy_.get(), directory_bot_jid_)); | 1221 this, host_id_, signal_strategy_.get(), directory_bot_jid_)); |
1222 | 1222 |
1223 log_to_server_.reset( | 1223 host_status_logger_.reset( |
1224 new LogToServer(host_->AsWeakPtr(), ServerLogEntry::ME2ME, | 1224 new HostStatusLogger(host_->AsWeakPtr(), ServerLogEntry::ME2ME, |
1225 signal_strategy_.get(), directory_bot_jid_)); | 1225 signal_strategy_.get(), directory_bot_jid_)); |
1226 | 1226 |
1227 // Set up repoting the host status notifications. | 1227 // Set up repoting the host status notifications. |
1228 #if defined(REMOTING_MULTI_PROCESS) | 1228 #if defined(REMOTING_MULTI_PROCESS) |
1229 host_event_logger_.reset( | 1229 host_event_logger_.reset( |
1230 new IpcHostEventLogger(host_->AsWeakPtr(), daemon_channel_.get())); | 1230 new IpcHostEventLogger(host_->AsWeakPtr(), daemon_channel_.get())); |
1231 #else // !defined(REMOTING_MULTI_PROCESS) | 1231 #else // !defined(REMOTING_MULTI_PROCESS) |
1232 host_event_logger_ = | 1232 host_event_logger_ = |
1233 HostEventLogger::Create(host_->AsWeakPtr(), kApplicationName); | 1233 HostEventLogger::Create(host_->AsWeakPtr(), kApplicationName); |
1234 #endif // !defined(REMOTING_MULTI_PROCESS) | 1234 #endif // !defined(REMOTING_MULTI_PROCESS) |
1235 | 1235 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1287 FROM_HERE, | 1287 FROM_HERE, |
1288 base::Bind(&HostProcess::ShutdownOnNetworkThread, base::Unretained(this)), | 1288 base::Bind(&HostProcess::ShutdownOnNetworkThread, base::Unretained(this)), |
1289 base::TimeDelta::FromSeconds(2)); | 1289 base::TimeDelta::FromSeconds(2)); |
1290 } | 1290 } |
1291 | 1291 |
1292 void HostProcess::ShutdownOnNetworkThread() { | 1292 void HostProcess::ShutdownOnNetworkThread() { |
1293 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); | 1293 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); |
1294 | 1294 |
1295 host_.reset(); | 1295 host_.reset(); |
1296 host_event_logger_.reset(); | 1296 host_event_logger_.reset(); |
1297 log_to_server_.reset(); | 1297 host_status_logger_.reset(); |
1298 heartbeat_sender_.reset(); | 1298 heartbeat_sender_.reset(); |
1299 host_status_sender_.reset(); | 1299 host_status_sender_.reset(); |
1300 host_change_notification_listener_.reset(); | 1300 host_change_notification_listener_.reset(); |
1301 signaling_connector_.reset(); | 1301 signaling_connector_.reset(); |
1302 oauth_token_getter_.reset(); | 1302 oauth_token_getter_.reset(); |
1303 signal_strategy_.reset(); | 1303 signal_strategy_.reset(); |
1304 network_change_notifier_.reset(); | 1304 network_change_notifier_.reset(); |
1305 | 1305 |
1306 if (state_ == HOST_STOPPING_TO_RESTART) { | 1306 if (state_ == HOST_STOPPING_TO_RESTART) { |
1307 StartHost(); | 1307 StartHost(); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1375 return exit_code; | 1375 return exit_code; |
1376 } | 1376 } |
1377 | 1377 |
1378 } // namespace remoting | 1378 } // namespace remoting |
1379 | 1379 |
1380 #if !defined(OS_WIN) | 1380 #if !defined(OS_WIN) |
1381 int main(int argc, char** argv) { | 1381 int main(int argc, char** argv) { |
1382 return remoting::HostMain(argc, argv); | 1382 return remoting::HostMain(argc, argv); |
1383 } | 1383 } |
1384 #endif // !defined(OS_WIN) | 1384 #endif // !defined(OS_WIN) |
OLD | NEW |