| 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" |
| 54 #include "remoting/host/resizing_host_observer.h" |
| 53 #include "remoting/host/session_manager_factory.h" | 55 #include "remoting/host/session_manager_factory.h" |
| 54 #include "remoting/host/signaling_connector.h" | 56 #include "remoting/host/signaling_connector.h" |
| 55 #include "remoting/host/usage_stats_consent.h" | 57 #include "remoting/host/usage_stats_consent.h" |
| 56 #include "remoting/host/video_frame_capturer.h" | 58 #include "remoting/host/video_frame_capturer.h" |
| 57 #include "remoting/jingle_glue/xmpp_signal_strategy.h" | 59 #include "remoting/jingle_glue/xmpp_signal_strategy.h" |
| 58 #include "remoting/protocol/me2me_host_authenticator_factory.h" | 60 #include "remoting/protocol/me2me_host_authenticator_factory.h" |
| 59 | 61 |
| 60 #if defined(OS_POSIX) | 62 #if defined(OS_POSIX) |
| 61 #include <signal.h> | 63 #include <signal.h> |
| 62 #include "remoting/host/posix/signal_handler.h" | 64 #include "remoting/host/posix/signal_handler.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 oauth_use_official_client_id_(false), | 125 oauth_use_official_client_id_(false), |
| 124 #endif | 126 #endif |
| 125 allow_nat_traversal_(true), | 127 allow_nat_traversal_(true), |
| 126 restarting_(false), | 128 restarting_(false), |
| 127 shutting_down_(false), | 129 shutting_down_(false), |
| 128 #if defined(OS_WIN) | 130 #if defined(OS_WIN) |
| 129 desktop_environment_factory_(new SessionDesktopEnvironmentFactory()), | 131 desktop_environment_factory_(new SessionDesktopEnvironmentFactory()), |
| 130 #else // !defined(OS_WIN) | 132 #else // !defined(OS_WIN) |
| 131 desktop_environment_factory_(new DesktopEnvironmentFactory()), | 133 desktop_environment_factory_(new DesktopEnvironmentFactory()), |
| 132 #endif // !defined(OS_WIN) | 134 #endif // !defined(OS_WIN) |
| 135 desktop_resizer_(DesktopResizer::Create()), |
| 136 resizing_host_observer_( |
| 137 new ResizingHostObserver(desktop_resizer_.get())), |
| 133 exit_code_(kSuccessExitCode) | 138 exit_code_(kSuccessExitCode) |
| 134 #if defined(OS_MACOSX) | 139 #if defined(OS_MACOSX) |
| 135 , curtain_(base::Bind(&HostProcess::OnDisconnectRequested, | 140 , curtain_(base::Bind(&HostProcess::OnDisconnectRequested, |
| 136 base::Unretained(this)), | 141 base::Unretained(this)), |
| 137 base::Bind(&HostProcess::OnDisconnectRequested, | 142 base::Bind(&HostProcess::OnDisconnectRequested, |
| 138 base::Unretained(this))) | 143 base::Unretained(this))) |
| 139 #endif | 144 #endif |
| 140 { | 145 { |
| 141 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); | 146 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); |
| 142 } | 147 } |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 context_.get(), signal_strategy_.get(), | 572 context_.get(), signal_strategy_.get(), |
| 568 desktop_environment_factory_.get(), | 573 desktop_environment_factory_.get(), |
| 569 CreateHostSessionManager(network_settings, | 574 CreateHostSessionManager(network_settings, |
| 570 context_->url_request_context_getter())); | 575 context_->url_request_context_getter())); |
| 571 | 576 |
| 572 // TODO(simonmorris): Get the maximum session duration from a policy. | 577 // TODO(simonmorris): Get the maximum session duration from a policy. |
| 573 #if defined(OS_LINUX) | 578 #if defined(OS_LINUX) |
| 574 host_->SetMaximumSessionDuration(base::TimeDelta::FromHours(20)); | 579 host_->SetMaximumSessionDuration(base::TimeDelta::FromHours(20)); |
| 575 #endif | 580 #endif |
| 576 | 581 |
| 582 host_->AddStatusObserver(resizing_host_observer_.get()); |
| 583 |
| 577 heartbeat_sender_.reset(new HeartbeatSender( | 584 heartbeat_sender_.reset(new HeartbeatSender( |
| 578 this, host_id_, signal_strategy_.get(), &key_pair_)); | 585 this, host_id_, signal_strategy_.get(), &key_pair_)); |
| 579 | 586 |
| 580 log_to_server_.reset( | 587 log_to_server_.reset( |
| 581 new LogToServer(host_, ServerLogEntry::ME2ME, signal_strategy_.get())); | 588 new LogToServer(host_, ServerLogEntry::ME2ME, signal_strategy_.get())); |
| 582 host_event_logger_ = HostEventLogger::Create(host_, kApplicationName); | 589 host_event_logger_ = HostEventLogger::Create(host_, kApplicationName); |
| 583 | 590 |
| 584 #if defined(OS_MACOSX) || defined(OS_WIN) | 591 #if defined(OS_MACOSX) || defined(OS_WIN) |
| 585 if (host_user_interface_.get()) { | 592 if (host_user_interface_.get()) { |
| 586 host_user_interface_->Start( | 593 host_user_interface_->Start( |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 bool oauth_use_official_client_id_; | 698 bool oauth_use_official_client_id_; |
| 692 | 699 |
| 693 scoped_ptr<policy_hack::PolicyWatcher> policy_watcher_; | 700 scoped_ptr<policy_hack::PolicyWatcher> policy_watcher_; |
| 694 bool allow_nat_traversal_; | 701 bool allow_nat_traversal_; |
| 695 std::string talkgadget_prefix_; | 702 std::string talkgadget_prefix_; |
| 696 | 703 |
| 697 bool restarting_; | 704 bool restarting_; |
| 698 bool shutting_down_; | 705 bool shutting_down_; |
| 699 | 706 |
| 700 scoped_ptr<DesktopEnvironmentFactory> desktop_environment_factory_; | 707 scoped_ptr<DesktopEnvironmentFactory> desktop_environment_factory_; |
| 708 scoped_ptr<DesktopResizer> desktop_resizer_; |
| 709 scoped_ptr<ResizingHostObserver> resizing_host_observer_; |
| 701 scoped_ptr<XmppSignalStrategy> signal_strategy_; | 710 scoped_ptr<XmppSignalStrategy> signal_strategy_; |
| 702 scoped_ptr<SignalingConnector> signaling_connector_; | 711 scoped_ptr<SignalingConnector> signaling_connector_; |
| 703 scoped_ptr<HeartbeatSender> heartbeat_sender_; | 712 scoped_ptr<HeartbeatSender> heartbeat_sender_; |
| 704 scoped_ptr<LogToServer> log_to_server_; | 713 scoped_ptr<LogToServer> log_to_server_; |
| 705 scoped_ptr<HostEventLogger> host_event_logger_; | 714 scoped_ptr<HostEventLogger> host_event_logger_; |
| 706 | 715 |
| 707 #if defined(OS_MACOSX) || defined(OS_WIN) | 716 #if defined(OS_MACOSX) || defined(OS_WIN) |
| 708 scoped_ptr<HostUserInterface> host_user_interface_; | 717 scoped_ptr<HostUserInterface> host_user_interface_; |
| 709 #endif | 718 #endif |
| 710 | 719 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 user32.GetFunctionPointer("SetProcessDPIAware")); | 831 user32.GetFunctionPointer("SetProcessDPIAware")); |
| 823 set_process_dpi_aware(); | 832 set_process_dpi_aware(); |
| 824 } | 833 } |
| 825 | 834 |
| 826 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting | 835 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting |
| 827 // the command line from GetCommandLineW(), so we can safely pass NULL here. | 836 // the command line from GetCommandLineW(), so we can safely pass NULL here. |
| 828 return main(0, NULL); | 837 return main(0, NULL); |
| 829 } | 838 } |
| 830 | 839 |
| 831 #endif // defined(OS_WIN) | 840 #endif // defined(OS_WIN) |
| OLD | NEW |