diff options
author | dcaiafa <dcaiafa@chromium.org> | 2015-08-03 14:43:33 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-03 21:44:09 +0000 |
commit | d050d71c354f9be62ccb02b1b64fe2b550903d3b (patch) | |
tree | 78fc9d9eae6369f62d2704773bf384dfa983f1a2 | |
parent | fd9cce5babbe6f4341793c2cd21753a9fe773244 (diff) | |
download | chromium_src-d050d71c354f9be62ccb02b1b64fe2b550903d3b.zip chromium_src-d050d71c354f9be62ccb02b1b64fe2b550903d3b.tar.gz chromium_src-d050d71c354f9be62ccb02b1b64fe2b550903d3b.tar.bz2 |
Move process switch names to switches.{h,cc}
Move process switch name constants from host_main.cc and ipc_constants.* to
dedicated header.
Review URL: https://codereview.chromium.org/267053009
Cr-Commit-Position: refs/heads/master@{#341622}
-rw-r--r-- | remoting/host/desktop_process_main.cc | 2 | ||||
-rw-r--r-- | remoting/host/host_main.cc | 16 | ||||
-rw-r--r-- | remoting/host/ipc_constants.cc | 2 | ||||
-rw-r--r-- | remoting/host/ipc_constants.h | 3 | ||||
-rw-r--r-- | remoting/host/remoting_me2me_host.cc | 2 | ||||
-rw-r--r-- | remoting/host/switches.cc | 22 | ||||
-rw-r--r-- | remoting/host/switches.h | 37 | ||||
-rw-r--r-- | remoting/host/win/unprivileged_process_delegate.cc | 2 | ||||
-rw-r--r-- | remoting/host/win/wts_session_process_delegate.cc | 1 | ||||
-rw-r--r-- | remoting/remoting_host_srcs.gypi | 4 |
10 files changed, 67 insertions, 24 deletions
diff --git a/remoting/host/desktop_process_main.cc b/remoting/host/desktop_process_main.cc index 7384228..316eec5 100644 --- a/remoting/host/desktop_process_main.cc +++ b/remoting/host/desktop_process_main.cc @@ -16,8 +16,8 @@ #include "remoting/host/desktop_process.h" #include "remoting/host/host_exit_codes.h" #include "remoting/host/host_main.h" -#include "remoting/host/ipc_constants.h" #include "remoting/host/me2me_desktop_environment.h" +#include "remoting/host/switches.h" #include "remoting/host/win/session_desktop_environment.h" namespace remoting { diff --git a/remoting/host/host_main.cc b/remoting/host/host_main.cc index 9d17d78..814f168 100644 --- a/remoting/host/host_main.cc +++ b/remoting/host/host_main.cc @@ -23,6 +23,7 @@ #include "remoting/host/host_exit_codes.h" #include "remoting/host/logging.h" #include "remoting/host/setup/me2me_native_messaging_host.h" +#include "remoting/host/switches.h" #include "remoting/host/usage_stats_consent.h" #if defined(OS_MACOSX) @@ -44,25 +45,10 @@ int DesktopProcessMain(); int RdpDesktopSessionMain(); #endif // defined(OS_WIN) -const char kElevateSwitchName[] = "elevate"; -const char kProcessTypeSwitchName[] = "type"; - -const char kProcessTypeDaemon[] = "daemon"; -const char kProcessTypeDesktop[] = "desktop"; -const char kProcessTypeHost[] = "host"; -const char kProcessTypeRdpDesktopSession[] = "rdp_desktop_session"; - namespace { typedef int (*MainRoutineFn)(); -// "--help" or "--?" prints the usage message. -const char kHelpSwitchName[] = "help"; -const char kQuestionSwitchName[] = "?"; - -// The command line switch used to get version of the daemon. -const char kVersionSwitchName[] = "version"; - const char kUsageMessage[] = "Usage: %s [options]\n" "\n" diff --git a/remoting/host/ipc_constants.cc b/remoting/host/ipc_constants.cc index 9702c65..6862400 100644 --- a/remoting/host/ipc_constants.cc +++ b/remoting/host/ipc_constants.cc @@ -10,8 +10,6 @@ namespace remoting { -const char kDaemonPipeSwitchName[] = "daemon-pipe"; - const base::FilePath::CharType kHostBinaryName[] = FILE_PATH_LITERAL("remoting_host"); diff --git a/remoting/host/ipc_constants.h b/remoting/host/ipc_constants.h index 3d80715..3460910f 100644 --- a/remoting/host/ipc_constants.h +++ b/remoting/host/ipc_constants.h @@ -9,9 +9,6 @@ namespace remoting { -// The command line switch specifying the daemon IPC endpoint. -extern const char kDaemonPipeSwitchName[]; - // Name of the host process binary. extern const base::FilePath::CharType kHostBinaryName[]; diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc index e6ade08..a45ca0a 100644 --- a/remoting/host/remoting_me2me_host.cc +++ b/remoting/host/remoting_me2me_host.cc @@ -55,7 +55,6 @@ #include "remoting/host/host_main.h" #include "remoting/host/host_status_logger.h" #include "remoting/host/input_injector.h" -#include "remoting/host/ipc_constants.h" #include "remoting/host/ipc_desktop_environment.h" #include "remoting/host/ipc_host_event_logger.h" #include "remoting/host/logging.h" @@ -67,6 +66,7 @@ #include "remoting/host/shutdown_watchdog.h" #include "remoting/host/signaling_connector.h" #include "remoting/host/single_window_desktop_environment.h" +#include "remoting/host/switches.h" #include "remoting/host/third_party_auth_config.h" #include "remoting/host/token_validator_factory_impl.h" #include "remoting/host/usage_stats_consent.h" diff --git a/remoting/host/switches.cc b/remoting/host/switches.cc new file mode 100644 index 0000000..b47552d --- /dev/null +++ b/remoting/host/switches.cc @@ -0,0 +1,22 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "remoting/host/switches.h" + +namespace remoting { + +const char kDaemonPipeSwitchName[] = "daemon-pipe"; +const char kElevateSwitchName[] = "elevate"; +const char kHelpSwitchName[] = "help"; +const char kProcessTypeSwitchName[] = "type"; +const char kQuestionSwitchName[] = "?"; +const char kVersionSwitchName[] = "version"; + +const char kProcessTypeController[] = "controller"; +const char kProcessTypeDaemon[] = "daemon"; +const char kProcessTypeDesktop[] = "desktop"; +const char kProcessTypeHost[] = "host"; +const char kProcessTypeRdpDesktopSession[] = "rdp_desktop_session"; + +} // namespace remoting diff --git a/remoting/host/switches.h b/remoting/host/switches.h new file mode 100644 index 0000000..34ae8a4 --- /dev/null +++ b/remoting/host/switches.h @@ -0,0 +1,37 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef REMOTING_HOST_SWITCHES_H_ +#define REMOTING_HOST_SWITCHES_H_ + +namespace remoting { + +// The command line switch specifying the daemon IPC endpoint. +extern const char kDaemonPipeSwitchName[]; + +extern const char kElevateSwitchName[]; + +// "--help" prints the usage message. +extern const char kHelpSwitchName[]; + +// Used to specify the type of the process. kProcessType* constants specify +// possible values. +extern const char kProcessTypeSwitchName[]; + +// "--?" prints the usage message. +extern const char kQuestionSwitchName[]; + +// The command line switch used to get version of the daemon. +extern const char kVersionSwitchName[]; + +// Values for kProcessTypeSwitchName. +extern const char kProcessTypeController[]; +extern const char kProcessTypeDaemon[]; +extern const char kProcessTypeDesktop[]; +extern const char kProcessTypeHost[]; +extern const char kProcessTypeRdpDesktopSession[]; + +} // namespace remoting + +#endif // REMOTING_HOST_SWITCHES_H_ diff --git a/remoting/host/win/unprivileged_process_delegate.cc b/remoting/host/win/unprivileged_process_delegate.cc index f662ce5..f9afd6c 100644 --- a/remoting/host/win/unprivileged_process_delegate.cc +++ b/remoting/host/win/unprivileged_process_delegate.cc @@ -25,8 +25,8 @@ #include "ipc/ipc_channel_proxy.h" #include "ipc/ipc_message.h" #include "remoting/base/typed_buffer.h" -#include "remoting/host/ipc_constants.h" #include "remoting/host/ipc_util.h" +#include "remoting/host/switches.h" #include "remoting/host/win/launch_process_with_token.h" #include "remoting/host/win/security_descriptor.h" #include "remoting/host/win/window_station_and_desktop.h" diff --git a/remoting/host/win/wts_session_process_delegate.cc b/remoting/host/win/wts_session_process_delegate.cc index 9c1195e..0cd0e87 100644 --- a/remoting/host/win/wts_session_process_delegate.cc +++ b/remoting/host/win/wts_session_process_delegate.cc @@ -24,6 +24,7 @@ #include "remoting/host/host_main.h" #include "remoting/host/ipc_constants.h" #include "remoting/host/ipc_util.h" +#include "remoting/host/switches.h" #include "remoting/host/win/launch_process_with_token.h" #include "remoting/host/win/worker_process_launcher.h" #include "remoting/host/win/wts_terminal_monitor.h" diff --git a/remoting/remoting_host_srcs.gypi b/remoting/remoting_host_srcs.gypi index 07c4711..bdda71a 100644 --- a/remoting/remoting_host_srcs.gypi +++ b/remoting/remoting_host_srcs.gypi @@ -226,14 +226,16 @@ 'host/single_window_input_injector_linux.cc', 'host/single_window_input_injector_mac.cc', 'host/single_window_input_injector_win.cc', + 'host/switches.cc', + 'host/switches.h', 'host/third_party_auth_config.cc', 'host/third_party_auth_config.h', 'host/token_validator_base.cc', 'host/token_validator_base.h', 'host/token_validator_factory_impl.cc', 'host/token_validator_factory_impl.h', - 'host/touch_injector_win.h', 'host/touch_injector_win.cc', + 'host/touch_injector_win.h', 'host/usage_stats_consent.h', 'host/usage_stats_consent_mac.cc', 'host/usage_stats_consent_win.cc', |