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()), |
133 exit_code_(kSuccessExitCode) | 136 exit_code_(kSuccessExitCode) |
134 #if defined(OS_MACOSX) | 137 #if defined(OS_MACOSX) |
135 , curtain_(base::Bind(&HostProcess::OnDisconnectRequested, | 138 , curtain_(base::Bind(&HostProcess::OnDisconnectRequested, |
136 base::Unretained(this)), | 139 base::Unretained(this)), |
137 base::Bind(&HostProcess::OnDisconnectRequested, | 140 base::Bind(&HostProcess::OnDisconnectRequested, |
138 base::Unretained(this))) | 141 base::Unretained(this))) |
139 #endif | 142 #endif |
140 { | 143 { |
141 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); | 144 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); |
142 } | 145 } |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 host_->SetMaximumSessionDuration(base::TimeDelta::FromHours(20)); | 577 host_->SetMaximumSessionDuration(base::TimeDelta::FromHours(20)); |
575 #endif | 578 #endif |
576 | 579 |
577 heartbeat_sender_.reset(new HeartbeatSender( | 580 heartbeat_sender_.reset(new HeartbeatSender( |
578 this, host_id_, signal_strategy_.get(), &key_pair_)); | 581 this, host_id_, signal_strategy_.get(), &key_pair_)); |
579 | 582 |
580 log_to_server_.reset( | 583 log_to_server_.reset( |
581 new LogToServer(host_, ServerLogEntry::ME2ME, signal_strategy_.get())); | 584 new LogToServer(host_, ServerLogEntry::ME2ME, signal_strategy_.get())); |
582 host_event_logger_ = HostEventLogger::Create(host_, kApplicationName); | 585 host_event_logger_ = HostEventLogger::Create(host_, kApplicationName); |
583 | 586 |
| 587 resizing_host_observer_.reset( |
| 588 new ResizingHostObserver(desktop_resizer_.get(), host_)); |
| 589 |
584 #if defined(OS_MACOSX) || defined(OS_WIN) | 590 #if defined(OS_MACOSX) || defined(OS_WIN) |
585 if (host_user_interface_.get()) { | 591 if (host_user_interface_.get()) { |
586 host_user_interface_->Start( | 592 host_user_interface_->Start( |
587 host_, base::Bind(&HostProcess::OnDisconnectRequested, | 593 host_, base::Bind(&HostProcess::OnDisconnectRequested, |
588 base::Unretained(this))); | 594 base::Unretained(this))); |
589 } | 595 } |
590 #endif | 596 #endif |
591 | 597 |
592 host_->Start(xmpp_login_); | 598 host_->Start(xmpp_login_); |
593 | 599 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 } | 667 } |
662 | 668 |
663 void ResetHost() { | 669 void ResetHost() { |
664 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); | 670 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); |
665 | 671 |
666 host_event_logger_.reset(); | 672 host_event_logger_.reset(); |
667 log_to_server_.reset(); | 673 log_to_server_.reset(); |
668 heartbeat_sender_.reset(); | 674 heartbeat_sender_.reset(); |
669 signaling_connector_.reset(); | 675 signaling_connector_.reset(); |
670 signal_strategy_.reset(); | 676 signal_strategy_.reset(); |
| 677 resizing_host_observer_.reset(); |
671 } | 678 } |
672 | 679 |
673 scoped_ptr<ChromotingHostContext> context_; | 680 scoped_ptr<ChromotingHostContext> context_; |
674 scoped_ptr<IPC::ChannelProxy> daemon_channel_; | 681 scoped_ptr<IPC::ChannelProxy> daemon_channel_; |
675 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; | 682 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; |
676 | 683 |
677 JsonHostConfig config_; | 684 JsonHostConfig config_; |
678 #if !defined(REMOTING_MULTI_PROCESS) | 685 #if !defined(REMOTING_MULTI_PROCESS) |
679 FilePath host_config_path_; | 686 FilePath host_config_path_; |
680 scoped_ptr<ConfigFileWatcher> config_watcher_; | 687 scoped_ptr<ConfigFileWatcher> config_watcher_; |
(...skipping 10 matching lines...) Expand all 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 |