| 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 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/at_exit.h" | 13 #include "base/at_exit.h" |
| 14 #include "base/bind.h" | 14 #include "base/bind.h" |
| 15 #include "base/callback.h" | 15 #include "base/callback.h" |
| 16 #include "base/command_line.h" | 16 #include "base/command_line.h" |
| 17 #include "base/file_path.h" | 17 #include "base/file_path.h" |
| 18 #include "base/file_util.h" | 18 #include "base/file_util.h" |
| 19 #include "base/logging.h" | 19 #include "base/logging.h" |
| 20 #include "base/memory/scoped_ptr.h" | 20 #include "base/memory/scoped_ptr.h" |
| 21 #include "base/message_loop.h" | 21 #include "base/message_loop.h" |
| 22 #include "base/threading/thread.h" | 22 #include "base/threading/thread.h" |
| 23 #include "build/build_config.h" | 23 #include "build/build_config.h" |
| 24 #include "crypto/nss_util.h" | 24 #include "crypto/nss_util.h" |
| 25 #include "net/base/network_change_notifier.h" | 25 #include "net/base/network_change_notifier.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/constants.h" |
| 28 #include "remoting/host/capturer.h" | 29 #include "remoting/host/capturer.h" |
| 29 #include "remoting/host/chromoting_host.h" | 30 #include "remoting/host/chromoting_host.h" |
| 30 #include "remoting/host/chromoting_host_context.h" | 31 #include "remoting/host/chromoting_host_context.h" |
| 31 #include "remoting/host/desktop_environment.h" | 32 #include "remoting/host/desktop_environment.h" |
| 32 #include "remoting/host/event_executor.h" | 33 #include "remoting/host/event_executor.h" |
| 33 #include "remoting/host/heartbeat_sender.h" | 34 #include "remoting/host/heartbeat_sender.h" |
| 34 #include "remoting/host/host_config.h" | 35 #include "remoting/host/host_config.h" |
| 35 #include "remoting/host/host_event_logger.h" | 36 #include "remoting/host/host_event_logger.h" |
| 36 #include "remoting/host/json_host_config.h" | 37 #include "remoting/host/json_host_config.h" |
| 37 #include "remoting/host/log_to_server.h" | 38 #include "remoting/host/log_to_server.h" |
| 38 #include "remoting/host/oauth_client.h" | 39 #include "remoting/host/oauth_client.h" |
| 39 #include "remoting/host/policy_hack/nat_policy.h" | 40 #include "remoting/host/policy_hack/nat_policy.h" |
| 40 #include "remoting/host/signaling_connector.h" | 41 #include "remoting/host/signaling_connector.h" |
| 41 #include "remoting/jingle_glue/xmpp_signal_strategy.h" | 42 #include "remoting/jingle_glue/xmpp_signal_strategy.h" |
| 42 #include "remoting/protocol/me2me_host_authenticator_factory.h" | 43 #include "remoting/protocol/me2me_host_authenticator_factory.h" |
| 43 | 44 |
| 44 #if defined(OS_MACOSX) | 45 #if defined(OS_MACOSX) |
| 45 #include "remoting/host/sighup_listener_mac.h" | 46 #include "remoting/host/sighup_listener_mac.h" |
| 46 #endif | 47 #endif |
| 47 #if defined(TOOLKIT_GTK) | 48 #if defined(TOOLKIT_GTK) |
| 48 #include "ui/gfx/gtk_util.h" | 49 #include "ui/gfx/gtk_util.h" |
| 49 #endif | 50 #endif |
| 50 | 51 |
| 51 namespace { | 52 namespace { |
| 52 | 53 |
| 53 const int kSuccessExitCode = 0; | |
| 54 const int kInvalidHostConfigurationExitCode = 1; | |
| 55 | |
| 56 // This is used for tagging system event logs. | 54 // This is used for tagging system event logs. |
| 57 const char kApplicationName[] = "chromoting"; | 55 const char kApplicationName[] = "chromoting"; |
| 58 | 56 |
| 59 // These are used for parsing the config-file locations from the command line, | 57 // These are used for parsing the config-file locations from the command line, |
| 60 // and for defining the default locations if the switches are not present. | 58 // and for defining the default locations if the switches are not present. |
| 61 const char kAuthConfigSwitchName[] = "auth-config"; | 59 const char kAuthConfigSwitchName[] = "auth-config"; |
| 62 const char kHostConfigSwitchName[] = "host-config"; | 60 const char kHostConfigSwitchName[] = "host-config"; |
| 63 | 61 |
| 64 const FilePath::CharType kDefaultAuthConfigFile[] = | 62 const FilePath::CharType kDefaultAuthConfigFile[] = |
| 65 FILE_PATH_LITERAL("auth.json"); | 63 FILE_PATH_LITERAL("auth.json"); |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 int CALLBACK WinMain(HINSTANCE instance, | 412 int CALLBACK WinMain(HINSTANCE instance, |
| 415 HINSTANCE previous_instance, | 413 HINSTANCE previous_instance, |
| 416 LPSTR command_line, | 414 LPSTR command_line, |
| 417 int show_command) { | 415 int show_command) { |
| 418 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting | 416 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting |
| 419 // the command line from GetCommandLineW(), so we can safely pass NULL here. | 417 // the command line from GetCommandLineW(), so we can safely pass NULL here. |
| 420 return main(0, NULL); | 418 return main(0, NULL); |
| 421 } | 419 } |
| 422 | 420 |
| 423 #endif | 421 #endif |
| OLD | NEW |