| 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" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
| 14 #include "base/file_util.h" | 14 #include "base/file_util.h" |
| 15 #include "base/files/file_path_watcher.h" | 15 #include "base/files/file_path_watcher.h" |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/message_loop.h" | 18 #include "base/message_loop.h" |
| 19 #include "base/synchronization/waitable_event.h" | 19 #include "base/synchronization/waitable_event.h" |
| 20 #include "base/threading/thread.h" | 20 #include "base/threading/thread.h" |
| 21 #include "build/build_config.h" | 21 #include "build/build_config.h" |
| 22 #include "crypto/nss_util.h" | 22 #include "crypto/nss_util.h" |
| 23 #include "net/base/network_change_notifier.h" | 23 #include "net/base/network_change_notifier.h" |
| 24 #include "net/socket/ssl_server_socket.h" | 24 #include "net/socket/ssl_server_socket.h" |
| 25 #include "remoting/base/breakpad.h" | 25 #include "remoting/base/breakpad.h" |
| 26 #include "remoting/base/constants.h" | 26 #include "remoting/base/constants.h" |
| 27 #include "remoting/host/branding.h" | 27 #include "remoting/host/branding.h" |
| 28 #include "remoting/host/breakpad.h" | |
| 29 #include "remoting/host/constants.h" | 28 #include "remoting/host/constants.h" |
| 30 #include "remoting/host/capturer.h" | 29 #include "remoting/host/capturer.h" |
| 31 #include "remoting/host/chromoting_host.h" | 30 #include "remoting/host/chromoting_host.h" |
| 32 #include "remoting/host/chromoting_host_context.h" | 31 #include "remoting/host/chromoting_host_context.h" |
| 33 #include "remoting/host/desktop_environment.h" | 32 #include "remoting/host/desktop_environment.h" |
| 34 #include "remoting/host/event_executor.h" | 33 #include "remoting/host/event_executor.h" |
| 35 #include "remoting/host/heartbeat_sender.h" | 34 #include "remoting/host/heartbeat_sender.h" |
| 36 #include "remoting/host/host_config.h" | 35 #include "remoting/host/host_config.h" |
| 37 #include "remoting/host/host_event_logger.h" | 36 #include "remoting/host/host_event_logger.h" |
| 38 #include "remoting/host/host_user_interface.h" | 37 #include "remoting/host/host_user_interface.h" |
| 39 #include "remoting/host/json_host_config.h" | 38 #include "remoting/host/json_host_config.h" |
| 40 #include "remoting/host/log_to_server.h" | 39 #include "remoting/host/log_to_server.h" |
| 41 #include "remoting/host/network_settings.h" | 40 #include "remoting/host/network_settings.h" |
| 42 #include "remoting/host/policy_hack/nat_policy.h" | 41 #include "remoting/host/policy_hack/nat_policy.h" |
| 43 #include "remoting/host/session_manager_factory.h" | 42 #include "remoting/host/session_manager_factory.h" |
| 44 #include "remoting/host/signaling_connector.h" | 43 #include "remoting/host/signaling_connector.h" |
| 44 #include "remoting/host/usage_stats_consent.h" |
| 45 #include "remoting/jingle_glue/xmpp_signal_strategy.h" | 45 #include "remoting/jingle_glue/xmpp_signal_strategy.h" |
| 46 #include "remoting/protocol/me2me_host_authenticator_factory.h" | 46 #include "remoting/protocol/me2me_host_authenticator_factory.h" |
| 47 | 47 |
| 48 #if defined(OS_MACOSX) | 48 #if defined(OS_MACOSX) |
| 49 #include "base/mac/scoped_nsautorelease_pool.h" | 49 #include "base/mac/scoped_nsautorelease_pool.h" |
| 50 #include "remoting/host/sighup_listener_mac.h" | 50 #include "remoting/host/sighup_listener_mac.h" |
| 51 #endif | 51 #endif |
| 52 // N.B. OS_WIN is defined by including src/base headers. | 52 // N.B. OS_WIN is defined by including src/base headers. |
| 53 #if defined(OS_WIN) | 53 #if defined(OS_WIN) |
| 54 #include <commctrl.h> | 54 #include <commctrl.h> |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 return me2me_host.Run(); | 560 return me2me_host.Run(); |
| 561 } | 561 } |
| 562 | 562 |
| 563 #if defined(OS_WIN) | 563 #if defined(OS_WIN) |
| 564 HMODULE g_hModule = NULL; | 564 HMODULE g_hModule = NULL; |
| 565 | 565 |
| 566 int CALLBACK WinMain(HINSTANCE instance, | 566 int CALLBACK WinMain(HINSTANCE instance, |
| 567 HINSTANCE previous_instance, | 567 HINSTANCE previous_instance, |
| 568 LPSTR command_line, | 568 LPSTR command_line, |
| 569 int show_command) { | 569 int show_command) { |
| 570 // Initializes the crash dump reports. | |
| 571 if (remoting::IsCrashReportingEnabled()) { | 570 if (remoting::IsCrashReportingEnabled()) { |
| 572 remoting::InitializeCrashReporting(); | 571 remoting::InitializeCrashReporting(); |
| 573 } | 572 } |
| 574 | 573 |
| 575 g_hModule = instance; | 574 g_hModule = instance; |
| 576 | 575 |
| 577 // Register and initialize common controls. | 576 // Register and initialize common controls. |
| 578 INITCOMMONCONTROLSEX info; | 577 INITCOMMONCONTROLSEX info; |
| 579 info.dwSize = sizeof(info); | 578 info.dwSize = sizeof(info); |
| 580 info.dwICC = ICC_STANDARD_CLASSES; | 579 info.dwICC = ICC_STANDARD_CLASSES; |
| 581 InitCommonControlsEx(&info); | 580 InitCommonControlsEx(&info); |
| 582 | 581 |
| 583 // Mark the process as DPI-aware, so Windows won't scale coordinates in APIs. | 582 // Mark the process as DPI-aware, so Windows won't scale coordinates in APIs. |
| 584 SetProcessDPIAware(); | 583 SetProcessDPIAware(); |
| 585 | 584 |
| 586 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting | 585 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting |
| 587 // the command line from GetCommandLineW(), so we can safely pass NULL here. | 586 // the command line from GetCommandLineW(), so we can safely pass NULL here. |
| 588 return main(0, NULL); | 587 return main(0, NULL); |
| 589 } | 588 } |
| 590 | 589 |
| 591 #endif // defined(OS_WIN) | 590 #endif // defined(OS_WIN) |
| OLD | NEW |