| 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 22 matching lines...) Expand all Loading... |
| 33 #include "remoting/base/breakpad.h" | 33 #include "remoting/base/breakpad.h" |
| 34 #include "remoting/base/constants.h" | 34 #include "remoting/base/constants.h" |
| 35 #include "remoting/host/branding.h" | 35 #include "remoting/host/branding.h" |
| 36 #include "remoting/host/chromoting_host.h" | 36 #include "remoting/host/chromoting_host.h" |
| 37 #include "remoting/host/chromoting_host_context.h" | 37 #include "remoting/host/chromoting_host_context.h" |
| 38 #include "remoting/host/chromoting_messages.h" | 38 #include "remoting/host/chromoting_messages.h" |
| 39 #include "remoting/host/config_file_watcher.h" | 39 #include "remoting/host/config_file_watcher.h" |
| 40 #include "remoting/host/constants.h" | 40 #include "remoting/host/constants.h" |
| 41 #include "remoting/host/config_file_watcher.h" | 41 #include "remoting/host/config_file_watcher.h" |
| 42 #include "remoting/host/desktop_environment_factory.h" | 42 #include "remoting/host/desktop_environment_factory.h" |
| 43 #include "remoting/host/desktop_resizer.h" |
| 43 #include "remoting/host/dns_blackhole_checker.h" | 44 #include "remoting/host/dns_blackhole_checker.h" |
| 44 #include "remoting/host/event_executor.h" | 45 #include "remoting/host/event_executor.h" |
| 45 #include "remoting/host/heartbeat_sender.h" | 46 #include "remoting/host/heartbeat_sender.h" |
| 46 #include "remoting/host/host_config.h" | 47 #include "remoting/host/host_config.h" |
| 47 #include "remoting/host/host_event_logger.h" | 48 #include "remoting/host/host_event_logger.h" |
| 48 #include "remoting/host/host_user_interface.h" | 49 #include "remoting/host/host_user_interface.h" |
| 49 #include "remoting/host/json_host_config.h" | 50 #include "remoting/host/json_host_config.h" |
| 50 #include "remoting/host/log_to_server.h" | 51 #include "remoting/host/log_to_server.h" |
| 51 #include "remoting/host/network_settings.h" | 52 #include "remoting/host/network_settings.h" |
| 52 #include "remoting/host/policy_hack/policy_watcher.h" | 53 #include "remoting/host/policy_hack/policy_watcher.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 oauth_use_official_client_id_(false), | 120 oauth_use_official_client_id_(false), |
| 120 #endif | 121 #endif |
| 121 allow_nat_traversal_(true), | 122 allow_nat_traversal_(true), |
| 122 restarting_(false), | 123 restarting_(false), |
| 123 shutting_down_(false), | 124 shutting_down_(false), |
| 124 #if defined(OS_WIN) | 125 #if defined(OS_WIN) |
| 125 desktop_environment_factory_(new SessionDesktopEnvironmentFactory()), | 126 desktop_environment_factory_(new SessionDesktopEnvironmentFactory()), |
| 126 #else // !defined(OS_WIN) | 127 #else // !defined(OS_WIN) |
| 127 desktop_environment_factory_(new DesktopEnvironmentFactory()), | 128 desktop_environment_factory_(new DesktopEnvironmentFactory()), |
| 128 #endif // !defined(OS_WIN) | 129 #endif // !defined(OS_WIN) |
| 130 desktop_resizer_(DesktopResizer::Create()), |
| 129 exit_code_(kSuccessExitCode) | 131 exit_code_(kSuccessExitCode) |
| 130 #if defined(OS_MACOSX) | 132 #if defined(OS_MACOSX) |
| 131 , curtain_(base::Bind(&HostProcess::OnDisconnectRequested, | 133 , curtain_(base::Bind(&HostProcess::OnDisconnectRequested, |
| 132 base::Unretained(this)), | 134 base::Unretained(this)), |
| 133 base::Bind(&HostProcess::OnDisconnectRequested, | 135 base::Bind(&HostProcess::OnDisconnectRequested, |
| 134 base::Unretained(this))) | 136 base::Unretained(this))) |
| 135 #endif | 137 #endif |
| 136 { | 138 { |
| 137 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); | 139 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); |
| 138 } | 140 } |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 context_.get(), signal_strategy_.get(), | 558 context_.get(), signal_strategy_.get(), |
| 557 desktop_environment_factory_.get(), | 559 desktop_environment_factory_.get(), |
| 558 CreateHostSessionManager(network_settings, | 560 CreateHostSessionManager(network_settings, |
| 559 context_->url_request_context_getter())); | 561 context_->url_request_context_getter())); |
| 560 | 562 |
| 561 // TODO(simonmorris): Get the maximum session duration from a policy. | 563 // TODO(simonmorris): Get the maximum session duration from a policy. |
| 562 #if defined(OS_LINUX) | 564 #if defined(OS_LINUX) |
| 563 host_->SetMaximumSessionDuration(base::TimeDelta::FromHours(20)); | 565 host_->SetMaximumSessionDuration(base::TimeDelta::FromHours(20)); |
| 564 #endif | 566 #endif |
| 565 | 567 |
| 568 host_->AddStatusObserver(new DesktopResizer::HostStatusObserver( |
| 569 desktop_resizer_.get())); |
| 570 |
| 566 heartbeat_sender_.reset(new HeartbeatSender( | 571 heartbeat_sender_.reset(new HeartbeatSender( |
| 567 this, host_id_, signal_strategy_.get(), &key_pair_)); | 572 this, host_id_, signal_strategy_.get(), &key_pair_)); |
| 568 | 573 |
| 569 log_to_server_.reset( | 574 log_to_server_.reset( |
| 570 new LogToServer(host_, ServerLogEntry::ME2ME, signal_strategy_.get())); | 575 new LogToServer(host_, ServerLogEntry::ME2ME, signal_strategy_.get())); |
| 571 host_event_logger_ = HostEventLogger::Create(host_, kApplicationName); | 576 host_event_logger_ = HostEventLogger::Create(host_, kApplicationName); |
| 572 | 577 |
| 573 #if defined(OS_MACOSX) || defined(OS_WIN) | 578 #if defined(OS_MACOSX) || defined(OS_WIN) |
| 574 if (host_user_interface_.get()) { | 579 if (host_user_interface_.get()) { |
| 575 host_user_interface_->Start( | 580 host_user_interface_->Start( |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 bool oauth_use_official_client_id_; | 685 bool oauth_use_official_client_id_; |
| 681 | 686 |
| 682 scoped_ptr<policy_hack::PolicyWatcher> policy_watcher_; | 687 scoped_ptr<policy_hack::PolicyWatcher> policy_watcher_; |
| 683 bool allow_nat_traversal_; | 688 bool allow_nat_traversal_; |
| 684 std::string talkgadget_prefix_; | 689 std::string talkgadget_prefix_; |
| 685 | 690 |
| 686 bool restarting_; | 691 bool restarting_; |
| 687 bool shutting_down_; | 692 bool shutting_down_; |
| 688 | 693 |
| 689 scoped_ptr<DesktopEnvironmentFactory> desktop_environment_factory_; | 694 scoped_ptr<DesktopEnvironmentFactory> desktop_environment_factory_; |
| 695 scoped_ptr<DesktopResizer> desktop_resizer_; |
| 690 scoped_ptr<XmppSignalStrategy> signal_strategy_; | 696 scoped_ptr<XmppSignalStrategy> signal_strategy_; |
| 691 scoped_ptr<SignalingConnector> signaling_connector_; | 697 scoped_ptr<SignalingConnector> signaling_connector_; |
| 692 scoped_ptr<HeartbeatSender> heartbeat_sender_; | 698 scoped_ptr<HeartbeatSender> heartbeat_sender_; |
| 693 scoped_ptr<LogToServer> log_to_server_; | 699 scoped_ptr<LogToServer> log_to_server_; |
| 694 scoped_ptr<HostEventLogger> host_event_logger_; | 700 scoped_ptr<HostEventLogger> host_event_logger_; |
| 695 | 701 |
| 696 #if defined(OS_MACOSX) || defined(OS_WIN) | 702 #if defined(OS_MACOSX) || defined(OS_WIN) |
| 697 scoped_ptr<HostUserInterface> host_user_interface_; | 703 scoped_ptr<HostUserInterface> host_user_interface_; |
| 698 #endif | 704 #endif |
| 699 | 705 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 user32.GetFunctionPointer("SetProcessDPIAware")); | 812 user32.GetFunctionPointer("SetProcessDPIAware")); |
| 807 set_process_dpi_aware(); | 813 set_process_dpi_aware(); |
| 808 } | 814 } |
| 809 | 815 |
| 810 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting | 816 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting |
| 811 // the command line from GetCommandLineW(), so we can safely pass NULL here. | 817 // the command line from GetCommandLineW(), so we can safely pass NULL here. |
| 812 return main(0, NULL); | 818 return main(0, NULL); |
| 813 } | 819 } |
| 814 | 820 |
| 815 #endif // defined(OS_WIN) | 821 #endif // defined(OS_WIN) |
| OLD | NEW |