| 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 16 matching lines...) Expand all Loading... |
| 27 #include "crypto/nss_util.h" | 27 #include "crypto/nss_util.h" |
| 28 #include "ipc/ipc_channel.h" | 28 #include "ipc/ipc_channel.h" |
| 29 #include "ipc/ipc_channel_proxy.h" | 29 #include "ipc/ipc_channel_proxy.h" |
| 30 #include "ipc/ipc_listener.h" | 30 #include "ipc/ipc_listener.h" |
| 31 #include "net/base/network_change_notifier.h" | 31 #include "net/base/network_change_notifier.h" |
| 32 #include "net/socket/ssl_server_socket.h" | 32 #include "net/socket/ssl_server_socket.h" |
| 33 #include "remoting/base/auto_thread_task_runner.h" | 33 #include "remoting/base/auto_thread_task_runner.h" |
| 34 #include "remoting/base/breakpad.h" | 34 #include "remoting/base/breakpad.h" |
| 35 #include "remoting/base/constants.h" | 35 #include "remoting/base/constants.h" |
| 36 #include "remoting/capturer/video_frame_capturer.h" | 36 #include "remoting/capturer/video_frame_capturer.h" |
| 37 #include "remoting/host/basic_desktop_environment.h" |
| 37 #include "remoting/host/branding.h" | 38 #include "remoting/host/branding.h" |
| 38 #include "remoting/host/chromoting_host.h" | 39 #include "remoting/host/chromoting_host.h" |
| 39 #include "remoting/host/chromoting_host_context.h" | 40 #include "remoting/host/chromoting_host_context.h" |
| 40 #include "remoting/host/chromoting_messages.h" | 41 #include "remoting/host/chromoting_messages.h" |
| 41 #include "remoting/host/config_file_watcher.h" | 42 #include "remoting/host/config_file_watcher.h" |
| 42 #include "remoting/host/curtain_mode.h" | 43 #include "remoting/host/curtain_mode.h" |
| 43 #include "remoting/host/curtaining_host_observer.h" | 44 #include "remoting/host/curtaining_host_observer.h" |
| 44 #include "remoting/host/desktop_environment_factory.h" | 45 #include "remoting/host/desktop_environment.h" |
| 45 #include "remoting/host/desktop_resizer.h" | 46 #include "remoting/host/desktop_resizer.h" |
| 46 #include "remoting/host/desktop_session_connector.h" | 47 #include "remoting/host/desktop_session_connector.h" |
| 47 #include "remoting/host/dns_blackhole_checker.h" | 48 #include "remoting/host/dns_blackhole_checker.h" |
| 48 #include "remoting/host/event_executor.h" | 49 #include "remoting/host/event_executor.h" |
| 49 #include "remoting/host/heartbeat_sender.h" | 50 #include "remoting/host/heartbeat_sender.h" |
| 50 #include "remoting/host/host_config.h" | 51 #include "remoting/host/host_config.h" |
| 51 #include "remoting/host/host_event_logger.h" | 52 #include "remoting/host/host_event_logger.h" |
| 52 #include "remoting/host/host_exit_codes.h" | 53 #include "remoting/host/host_exit_codes.h" |
| 53 #include "remoting/host/host_user_interface.h" | 54 #include "remoting/host/host_user_interface.h" |
| 54 #include "remoting/host/ipc_constants.h" | 55 #include "remoting/host/ipc_constants.h" |
| 55 #include "remoting/host/ipc_desktop_environment_factory.h" | 56 #include "remoting/host/ipc_desktop_environment.h" |
| 56 #include "remoting/host/json_host_config.h" | 57 #include "remoting/host/json_host_config.h" |
| 57 #include "remoting/host/log_to_server.h" | 58 #include "remoting/host/log_to_server.h" |
| 58 #include "remoting/host/logging.h" | 59 #include "remoting/host/logging.h" |
| 59 #include "remoting/host/network_settings.h" | 60 #include "remoting/host/network_settings.h" |
| 60 #include "remoting/host/policy_hack/policy_watcher.h" | 61 #include "remoting/host/policy_hack/policy_watcher.h" |
| 61 #include "remoting/host/resizing_host_observer.h" | 62 #include "remoting/host/resizing_host_observer.h" |
| 62 #include "remoting/host/session_manager_factory.h" | 63 #include "remoting/host/session_manager_factory.h" |
| 63 #include "remoting/host/signaling_connector.h" | 64 #include "remoting/host/signaling_connector.h" |
| 64 #include "remoting/host/usage_stats_consent.h" | 65 #include "remoting/host/usage_stats_consent.h" |
| 65 #include "remoting/jingle_glue/xmpp_signal_strategy.h" | 66 #include "remoting/jingle_glue/xmpp_signal_strategy.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 78 #include "base/mac/scoped_nsautorelease_pool.h" | 79 #include "base/mac/scoped_nsautorelease_pool.h" |
| 79 #endif // defined(OS_MACOSX) | 80 #endif // defined(OS_MACOSX) |
| 80 | 81 |
| 81 #if defined(OS_LINUX) | 82 #if defined(OS_LINUX) |
| 82 #include "remoting/host/audio_capturer_linux.h" | 83 #include "remoting/host/audio_capturer_linux.h" |
| 83 #endif // defined(OS_LINUX) | 84 #endif // defined(OS_LINUX) |
| 84 | 85 |
| 85 #if defined(OS_WIN) | 86 #if defined(OS_WIN) |
| 86 #include <commctrl.h> | 87 #include <commctrl.h> |
| 87 #include "base/win/scoped_handle.h" | 88 #include "base/win/scoped_handle.h" |
| 88 #include "remoting/host/win/session_desktop_environment_factory.h" | 89 #include "remoting/host/win/session_desktop_environment.h" |
| 89 #endif // defined(OS_WIN) | 90 #endif // defined(OS_WIN) |
| 90 | 91 |
| 91 #if defined(TOOLKIT_GTK) | 92 #if defined(TOOLKIT_GTK) |
| 92 #include "ui/gfx/gtk_util.h" | 93 #include "ui/gfx/gtk_util.h" |
| 93 #endif // defined(TOOLKIT_GTK) | 94 #endif // defined(TOOLKIT_GTK) |
| 94 | 95 |
| 95 namespace { | 96 namespace { |
| 96 | 97 |
| 97 // This is used for tagging system event logs. | 98 // This is used for tagging system event logs. |
| 98 const char kApplicationName[] = "chromoting"; | 99 const char kApplicationName[] = "chromoting"; |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 } | 563 } |
| 563 #endif // defined(OS_LINUX) | 564 #endif // defined(OS_LINUX) |
| 564 | 565 |
| 565 // Create a desktop environment factory appropriate to the build type & | 566 // Create a desktop environment factory appropriate to the build type & |
| 566 // platform. | 567 // platform. |
| 567 #if defined(OS_WIN) | 568 #if defined(OS_WIN) |
| 568 | 569 |
| 569 #if defined(REMOTING_MULTI_PROCESS) | 570 #if defined(REMOTING_MULTI_PROCESS) |
| 570 IpcDesktopEnvironmentFactory* desktop_environment_factory = | 571 IpcDesktopEnvironmentFactory* desktop_environment_factory = |
| 571 new IpcDesktopEnvironmentFactory( | 572 new IpcDesktopEnvironmentFactory( |
| 572 daemon_channel_.get(), | |
| 573 context_->audio_task_runner(), | |
| 574 context_->input_task_runner(), | |
| 575 context_->network_task_runner(), | 573 context_->network_task_runner(), |
| 576 context_->ui_task_runner(), | 574 daemon_channel_.get()); |
| 577 context_->video_capture_task_runner()); | |
| 578 desktop_session_connector_ = desktop_environment_factory; | 575 desktop_session_connector_ = desktop_environment_factory; |
| 579 #else // !defined(REMOTING_MULTI_PROCESS) | 576 #else // !defined(REMOTING_MULTI_PROCESS) |
| 580 DesktopEnvironmentFactory* desktop_environment_factory = | 577 DesktopEnvironmentFactory* desktop_environment_factory = |
| 581 new SessionDesktopEnvironmentFactory( | 578 new SessionDesktopEnvironmentFactory( |
| 582 context_->input_task_runner(), context_->ui_task_runner(), | |
| 583 base::Bind(&HostProcess::SendSasToConsole, this)); | 579 base::Bind(&HostProcess::SendSasToConsole, this)); |
| 584 #endif // !defined(REMOTING_MULTI_PROCESS) | 580 #endif // !defined(REMOTING_MULTI_PROCESS) |
| 585 | 581 |
| 586 #else // !defined(OS_WIN) | 582 #else // !defined(OS_WIN) |
| 587 DesktopEnvironmentFactory* desktop_environment_factory = | 583 DesktopEnvironmentFactory* desktop_environment_factory = |
| 588 new DesktopEnvironmentFactory( | 584 new BasicDesktopEnvironmentFactory(); |
| 589 context_->input_task_runner(), context_->ui_task_runner()); | |
| 590 #endif // !defined(OS_WIN) | 585 #endif // !defined(OS_WIN) |
| 591 | 586 |
| 592 desktop_environment_factory_.reset(desktop_environment_factory); | 587 desktop_environment_factory_.reset(desktop_environment_factory); |
| 593 | 588 |
| 594 // The host UI should be created on the UI thread. | 589 // The host UI should be created on the UI thread. |
| 595 bool want_user_interface = true; | 590 bool want_user_interface = true; |
| 596 #if defined(OS_LINUX) || defined(REMOTING_MULTI_PROCESS) | 591 #if defined(OS_LINUX) || defined(REMOTING_MULTI_PROCESS) |
| 597 want_user_interface = false; | 592 want_user_interface = false; |
| 598 #elif defined(OS_MACOSX) | 593 #elif defined(OS_MACOSX) |
| 599 // Don't try to display any UI on top of the system's login screen as this | 594 // Don't try to display any UI on top of the system's login screen as this |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 network_settings.min_port = NetworkSettings::kDefaultMinPort; | 882 network_settings.min_port = NetworkSettings::kDefaultMinPort; |
| 888 network_settings.max_port = NetworkSettings::kDefaultMaxPort; | 883 network_settings.max_port = NetworkSettings::kDefaultMaxPort; |
| 889 } | 884 } |
| 890 | 885 |
| 891 host_ = new ChromotingHost( | 886 host_ = new ChromotingHost( |
| 892 signal_strategy_.get(), | 887 signal_strategy_.get(), |
| 893 desktop_environment_factory_.get(), | 888 desktop_environment_factory_.get(), |
| 894 CreateHostSessionManager(network_settings, | 889 CreateHostSessionManager(network_settings, |
| 895 context_->url_request_context_getter()), | 890 context_->url_request_context_getter()), |
| 896 context_->audio_task_runner(), | 891 context_->audio_task_runner(), |
| 892 context_->input_task_runner(), |
| 897 context_->video_capture_task_runner(), | 893 context_->video_capture_task_runner(), |
| 898 context_->video_encode_task_runner(), | 894 context_->video_encode_task_runner(), |
| 899 context_->network_task_runner()); | 895 context_->network_task_runner(), |
| 896 context_->ui_task_runner()); |
| 900 | 897 |
| 901 // TODO(simonmorris): Get the maximum session duration from a policy. | 898 // TODO(simonmorris): Get the maximum session duration from a policy. |
| 902 #if defined(OS_LINUX) | 899 #if defined(OS_LINUX) |
| 903 host_->SetMaximumSessionDuration(base::TimeDelta::FromHours(20)); | 900 host_->SetMaximumSessionDuration(base::TimeDelta::FromHours(20)); |
| 904 #endif | 901 #endif |
| 905 | 902 |
| 906 heartbeat_sender_.reset(new HeartbeatSender( | 903 heartbeat_sender_.reset(new HeartbeatSender( |
| 907 this, host_id_, signal_strategy_.get(), &key_pair_)); | 904 this, host_id_, signal_strategy_.get(), &key_pair_)); |
| 908 | 905 |
| 909 log_to_server_.reset( | 906 log_to_server_.reset( |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1140 user32.GetFunctionPointer("SetProcessDPIAware")); | 1137 user32.GetFunctionPointer("SetProcessDPIAware")); |
| 1141 set_process_dpi_aware(); | 1138 set_process_dpi_aware(); |
| 1142 } | 1139 } |
| 1143 | 1140 |
| 1144 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting | 1141 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting |
| 1145 // the command line from GetCommandLineW(), so we can safely pass NULL here. | 1142 // the command line from GetCommandLineW(), so we can safely pass NULL here. |
| 1146 return main(0, NULL); | 1143 return main(0, NULL); |
| 1147 } | 1144 } |
| 1148 | 1145 |
| 1149 #endif // defined(OS_WIN) | 1146 #endif // defined(OS_WIN) |
| OLD | NEW |