diff options
author | avi <avi@chromium.org> | 2014-12-25 09:48:05 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-25 17:48:57 +0000 |
commit | 79bf913a9f95ff7249018d0e5179f61608cfb82b (patch) | |
tree | 02c8ababb843df5cdd00e4f8911e052486d256b3 | |
parent | c28b45c1f969a9da103062adb6b8d9789193ddb3 (diff) | |
download | chromium_src-79bf913a9f95ff7249018d0e5179f61608cfb82b.zip chromium_src-79bf913a9f95ff7249018d0e5179f61608cfb82b.tar.gz chromium_src-79bf913a9f95ff7249018d0e5179f61608cfb82b.tar.bz2 |
Make callers of CommandLine use it via the base:: namespace, and remove the global alias.
BUG=422426
TEST=none
TBR=ben@chromium.org
Review URL: https://codereview.chromium.org/812353003
Cr-Commit-Position: refs/heads/master@{#309644}
111 files changed, 415 insertions, 377 deletions
diff --git a/base/android/command_line_android.cc b/base/android/command_line_android.cc index 895ffab..064450d 100644 --- a/base/android/command_line_android.cc +++ b/base/android/command_line_android.cc @@ -12,6 +12,7 @@ using base::android::ConvertUTF8ToJavaString; using base::android::ConvertJavaStringToUTF8; +using base::CommandLine; namespace { diff --git a/base/command_line.h b/base/command_line.h index 1829e63..85d924a 100644 --- a/base/command_line.h +++ b/base/command_line.h @@ -226,7 +226,4 @@ class BASE_EXPORT CommandLine { } // namespace base -// TODO(brettw) remove once all callers specify the namespace properly. -using base::CommandLine; - #endif // BASE_COMMAND_LINE_H_ diff --git a/chrome/browser/chromeos/login/session/user_session_manager.cc b/chrome/browser/chromeos/login/session/user_session_manager.cc index 8591e77..94dd211 100644 --- a/chrome/browser/chromeos/login/session/user_session_manager.cc +++ b/chrome/browser/chromeos/login/session/user_session_manager.cc @@ -595,7 +595,7 @@ bool UserSessionManager::RestartToApplyPerSessionFlagsIfNeed( about_flags::ReportCustomFlags("Login.CustomFlags", command_line_difference); - CommandLine::StringVector flags; + base::CommandLine::StringVector flags; // argv[0] is the program name |base::CommandLine::NO_PROGRAM|. flags.assign(user_flags.argv().begin() + 1, user_flags.argv().end()); LOG(WARNING) << "Restarting to apply per-session flags..."; diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc index 0cfb9cb..c52e7ba 100644 --- a/chrome/browser/chromeos/preferences.cc +++ b/chrome/browser/chromeos/preferences.cc @@ -602,8 +602,10 @@ void Preferences::ApplyPreferences(ApplyReason reason, int features = wake_on_wifi_ssid_.GetValue() ? WakeOnWifiManager::WAKE_ON_SSID : WakeOnWifiManager::WAKE_ON_NONE; // The flag enables wake on packets but doesn't update a preference. - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kWakeOnPackets)) + if (base::CommandLine::ForCurrentProcess()-> + HasSwitch(switches::kWakeOnPackets)) { features |= WakeOnWifiManager::WAKE_ON_PACKET; + } WakeOnWifiManager::Get()->OnPreferenceChanged( static_cast<WakeOnWifiManager::WakeOnWifiFeature>(features)); } diff --git a/chrome/browser/prefs/command_line_pref_store.cc b/chrome/browser/prefs/command_line_pref_store.cc index 538914b..4ec18f5 100644 --- a/chrome/browser/prefs/command_line_pref_store.cc +++ b/chrome/browser/prefs/command_line_pref_store.cc @@ -76,7 +76,8 @@ const CommandLinePrefStore::IntegerSwitchToPreferenceMapEntry { switches::kMediaCacheSize, prefs::kMediaCacheSize }, }; -CommandLinePrefStore::CommandLinePrefStore(const CommandLine* command_line) +CommandLinePrefStore::CommandLinePrefStore( + const base::CommandLine* command_line) : command_line_(command_line) { ApplySimpleSwitches(); ApplyProxyMode(); diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc index 77bbab6..587b2aa 100644 --- a/chrome/common/chrome_content_client.cc +++ b/chrome/common/chrome_content_client.cc @@ -364,8 +364,8 @@ content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path, void AddPepperFlashFromCommandLine( std::vector<content::PepperPluginInfo>* plugins) { - const CommandLine::StringType flash_path = - CommandLine::ForCurrentProcess()->GetSwitchValueNative( + const base::CommandLine::StringType flash_path = + base::CommandLine::ForCurrentProcess()->GetSwitchValueNative( switches::kPpapiFlashPath); if (flash_path.empty()) return; @@ -373,7 +373,7 @@ void AddPepperFlashFromCommandLine( // Also get the version from the command-line. Should be something like 11.2 // or 11.2.123.45. std::string flash_version = - CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kPpapiFlashVersion); plugins->push_back( @@ -382,7 +382,7 @@ void AddPepperFlashFromCommandLine( bool GetBundledPepperFlash(content::PepperPluginInfo* plugin) { #if defined(FLAPPER_AVAILABLE) - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); // Ignore bundled Pepper Flash if there is Pepper Flash specified from the // command-line. @@ -414,7 +414,7 @@ std::string GetProduct() { } // namespace std::string GetUserAgent() { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kUserAgent)) { std::string ua = command_line->GetSwitchValueASCII(switches::kUserAgent); if (net::HttpUtil::IsValidHeaderValue(ua)) diff --git a/chrome/common/chrome_content_client_unittest.cc b/chrome/common/chrome_content_client_unittest.cc index 63dd235..42514d7 100644 --- a/chrome/common/chrome_content_client_unittest.cc +++ b/chrome/common/chrome_content_client_unittest.cc @@ -66,9 +66,9 @@ TEST(ChromeContentClientTest, Basic) { CheckUserAgentStringOrdering(false); #else const char* const kArguments[] = {"chrome"}; - CommandLine::Reset(); - CommandLine::Init(1, kArguments); - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine::Reset(); + base::CommandLine::Init(1, kArguments); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); // Do it for regular devices. ASSERT_FALSE(command_line->HasSwitch(switches::kUseMobileUserAgent)); diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 524a8fc..d8daa7e 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -1374,15 +1374,16 @@ const char kFileManagerExtensionPath[] = "filemgr-ext-path"; bool AboutInSettingsEnabled() { return SettingsWindowEnabled() && - !CommandLine::ForCurrentProcess()->HasSwitch( - ::switches::kDisableAboutInSettings); + !base::CommandLine::ForCurrentProcess()->HasSwitch( + ::switches::kDisableAboutInSettings); } bool OutOfProcessPdfEnabled() { - if (CommandLine::ForCurrentProcess()->HasSwitch(kEnableOutOfProcessPdf)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch(kEnableOutOfProcessPdf)) return true; - if (CommandLine::ForCurrentProcess()->HasSwitch(kDisableOutOfProcessPdf)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + kDisableOutOfProcessPdf)) return false; // Default. @@ -1391,17 +1392,17 @@ bool OutOfProcessPdfEnabled() { bool SettingsWindowEnabled() { #if defined(OS_CHROMEOS) - return !CommandLine::ForCurrentProcess()->HasSwitch( + return !base::CommandLine::ForCurrentProcess()->HasSwitch( ::switches::kDisableSettingsWindow); #else - return CommandLine::ForCurrentProcess()->HasSwitch( + return base::CommandLine::ForCurrentProcess()->HasSwitch( ::switches::kEnableSettingsWindow); #endif } #if defined(OS_CHROMEOS) bool PowerOverlayEnabled() { - return CommandLine::ForCurrentProcess()->HasSwitch( + return base::CommandLine::ForCurrentProcess()->HasSwitch( ::switches::kEnablePowerOverlay); } #endif diff --git a/chrome/common/crash_keys.cc b/chrome/common/crash_keys.cc index b15154b..e071769 100644 --- a/chrome/common/crash_keys.cc +++ b/chrome/common/crash_keys.cc @@ -309,12 +309,12 @@ static bool IsBoringSwitch(const std::string& flag) { #endif } -void SetSwitchesFromCommandLine(const CommandLine* command_line) { +void SetSwitchesFromCommandLine(const base::CommandLine* command_line) { DCHECK(command_line); if (!command_line) return; - const CommandLine::StringVector& argv = command_line->argv(); + const base::CommandLine::StringVector& argv = command_line->argv(); // Set the number of switches in case size > kNumSwitches. base::debug::SetCrashKeyValue(kNumSwitches, diff --git a/chrome/common/crash_keys_unittest.cc b/chrome/common/crash_keys_unittest.cc index df59349..5dd04b2 100644 --- a/chrome/common/crash_keys_unittest.cc +++ b/chrome/common/crash_keys_unittest.cc @@ -60,7 +60,7 @@ CrashKeysTest* CrashKeysTest::self_ = NULL; TEST_F(CrashKeysTest, Switches) { // Set three switches. { - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); for (int i = 1; i <= 3; ++i) command_line.AppendSwitch(base::StringPrintf("--flag-%d", i)); crash_keys::SetSwitchesFromCommandLine(&command_line); @@ -72,7 +72,7 @@ TEST_F(CrashKeysTest, Switches) { // Set more than the max switches. { - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); const int kMax = crash_keys::kSwitchesMaxCount + 2; EXPECT_GT(kMax, 15); for (int i = 1; i <= kMax; ++i) @@ -87,7 +87,7 @@ TEST_F(CrashKeysTest, Switches) { // Set fewer to ensure that old ones are erased. { - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); for (int i = 1; i <= 5; ++i) command_line.AppendSwitch(base::StringPrintf("--fewer-%d", i)); crash_keys::SetSwitchesFromCommandLine(&command_line); @@ -164,7 +164,7 @@ TEST_F(CrashKeysTest, Extensions) { #if defined(OS_CHROMEOS) TEST_F(CrashKeysTest, IgnoreBoringFlags) { - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); command_line.AppendSwitch("--enable-logging"); command_line.AppendSwitch("--user-data-dir=/tmp"); command_line.AppendSwitch("--v=1"); diff --git a/chrome/common/extensions/chrome_extensions_client.cc b/chrome/common/extensions/chrome_extensions_client.cc index 9a7ae15..95c1cbb 100644 --- a/chrome/common/extensions/chrome_extensions_client.cc +++ b/chrome/common/extensions/chrome_extensions_client.cc @@ -325,16 +325,18 @@ bool ChromeExtensionsClient::ShouldSuppressFatalErrors() const { std::string ChromeExtensionsClient::GetWebstoreBaseURL() const { std::string gallery_prefix = extension_urls::kChromeWebstoreBaseURL; - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAppsGalleryURL)) - gallery_prefix = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( - switches::kAppsGalleryURL); + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAppsGalleryURL)) + gallery_prefix = + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + switches::kAppsGalleryURL); if (EndsWith(gallery_prefix, "/", true)) gallery_prefix = gallery_prefix.substr(0, gallery_prefix.length() - 1); return gallery_prefix; } std::string ChromeExtensionsClient::GetWebstoreUpdateURL() const { - CommandLine* cmdline = CommandLine::ForCurrentProcess(); + base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess(); if (cmdline->HasSwitch(switches::kAppsGalleryUpdateURL)) return cmdline->GetSwitchValueASCII(switches::kAppsGalleryUpdateURL); else diff --git a/chrome/common/extensions/feature_switch_unittest.cc b/chrome/common/extensions/feature_switch_unittest.cc index d7a2906..5377948 100644 --- a/chrome/common/extensions/feature_switch_unittest.cc +++ b/chrome/common/extensions/feature_switch_unittest.cc @@ -18,11 +18,10 @@ template<FeatureSwitch::DefaultValue T> class FeatureSwitchTest : public testing::Test { public: FeatureSwitchTest() - : command_line_(CommandLine::NO_PROGRAM), - feature_(&command_line_, kSwitchName, T) { - } + : command_line_(base::CommandLine::NO_PROGRAM), + feature_(&command_line_, kSwitchName, T) {} protected: - CommandLine command_line_; + base::CommandLine command_line_; FeatureSwitch feature_; }; diff --git a/chrome/common/extensions/manifest_handlers/app_launch_info.cc b/chrome/common/extensions/manifest_handlers/app_launch_info.cc index 7fab5b3..21381c3 100644 --- a/chrome/common/extensions/manifest_handlers/app_launch_info.cc +++ b/chrome/common/extensions/manifest_handlers/app_launch_info.cc @@ -196,8 +196,9 @@ bool AppLaunchInfo::LoadLaunchURL(Extension* extension, base::string16* error) { // process isolation, we must insert any provided value into the component // app's launch url and web extent. if (extension->id() == extensions::kWebStoreAppId) { - std::string gallery_url_str = CommandLine::ForCurrentProcess()-> - GetSwitchValueASCII(switches::kAppsGalleryURL); + std::string gallery_url_str = + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + switches::kAppsGalleryURL); // Empty string means option was not used. if (!gallery_url_str.empty()) { diff --git a/chrome/common/extensions/manifest_handlers/content_scripts_manifest_unittest.cc b/chrome/common/extensions/manifest_handlers/content_scripts_manifest_unittest.cc index 5494feb..72dc34f 100644 --- a/chrome/common/extensions/manifest_handlers/content_scripts_manifest_unittest.cc +++ b/chrome/common/extensions/manifest_handlers/content_scripts_manifest_unittest.cc @@ -48,7 +48,7 @@ TEST_F(ContentScriptsManifestTest, MatchPattern) { } TEST_F(ContentScriptsManifestTest, OnChromeUrlsWithFlag) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kExtensionsOnChromeURLs); scoped_refptr<Extension> extension = LoadAndExpectSuccess("content_script_chrome_url_invalid.json"); diff --git a/chrome/common/extensions/manifest_handlers/ui_overrides_handler_unittest.cc b/chrome/common/extensions/manifest_handlers/ui_overrides_handler_unittest.cc index d0f4c85..007d102 100644 --- a/chrome/common/extensions/manifest_handlers/ui_overrides_handler_unittest.cc +++ b/chrome/common/extensions/manifest_handlers/ui_overrides_handler_unittest.cc @@ -47,9 +47,8 @@ class UIOverrideTest : public testing::Test { TEST_F(UIOverrideTest, ParseManifest) { extensions::ScopedCurrentChannel channel(chrome::VersionInfo::CHANNEL_DEV); // This functionality requires a feature flag. - CommandLine::ForCurrentProcess()->AppendSwitchASCII( - "--enable-override-bookmarks-ui", - "1"); + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( + "--enable-override-bookmarks-ui", "1"); std::string manifest(kManifest); JSONStringValueSerializer json(&manifest); std::string error; @@ -76,9 +75,8 @@ TEST_F(UIOverrideTest, ParseManifest) { TEST_F(UIOverrideTest, ParseBrokenManifest) { extensions::ScopedCurrentChannel channel(chrome::VersionInfo::CHANNEL_DEV); // This functionality requires a feature flag. - CommandLine::ForCurrentProcess()->AppendSwitchASCII( - "--enable-override-bookmarks-ui", - "1"); + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( + "--enable-override-bookmarks-ui", "1"); std::string manifest(kBrokenManifest); JSONStringValueSerializer json(&manifest); std::string error; diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_chromepermission_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_chromepermission_unittest.cc index d5b112f..893b5d4 100644 --- a/chrome/common/extensions/manifest_tests/extension_manifests_chromepermission_unittest.cc +++ b/chrome/common/extensions/manifest_tests/extension_manifests_chromepermission_unittest.cc @@ -29,7 +29,7 @@ TEST_F(ChromePermissionManifestTest, ChromeURLPermissionInvalid) { TEST_F(ChromePermissionManifestTest, ChromeURLPermissionAllowedWithFlag) { // Ignore the policy delegate for this test. PermissionsData::SetPolicyDelegate(NULL); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kExtensionsOnChromeURLs); std::string error; scoped_refptr<Extension> extension = diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_experimental_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_experimental_unittest.cc index 74f63ba..39ff328 100644 --- a/chrome/common/extensions/manifest_tests/extension_manifests_experimental_unittest.cc +++ b/chrome/common/extensions/manifest_tests/extension_manifests_experimental_unittest.cc @@ -21,7 +21,7 @@ TEST_F(ChromeManifestTest, ExperimentalPermission) { LoadAndExpectSuccess("experimental.json", extensions::Manifest::COMPONENT); LoadAndExpectSuccess("experimental.json", extensions::Manifest::INTERNAL, extensions::Extension::FROM_WEBSTORE); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( extensions::switches::kEnableExperimentalExtensionApis); LoadAndExpectSuccess("experimental.json"); } diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc index ff7c19a..316beee3 100644 --- a/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc +++ b/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc @@ -32,7 +32,7 @@ class InitValueManifestTest : public ChromeManifestTest { }; TEST_F(InitValueManifestTest, InitFromValueInvalid) { - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( extensions::switches::kWhitelistedExtensionID, kWhitelistID); Testcase testcases[] = { Testcase("init_invalid_version_missing.json", errors::kInvalidVersion), diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_isolatedapp_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_isolatedapp_unittest.cc index 654235b..e9edcec 100644 --- a/chrome/common/extensions/manifest_tests/extension_manifests_isolatedapp_unittest.cc +++ b/chrome/common/extensions/manifest_tests/extension_manifests_isolatedapp_unittest.cc @@ -24,7 +24,7 @@ TEST_F(IsolatedAppsManifestTest, IsolatedApps) { "'experimental' requires the 'experimental-extension-apis' " "command line switch to be enabled."); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( extensions::switches::kEnableExperimentalExtensionApis); scoped_refptr<Extension> extension2( LoadAndExpectSuccess("isolated_app_valid.json")); diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_launcher_page_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_launcher_page_unittest.cc index 8d9007f..0a7392b 100644 --- a/chrome/common/extensions/manifest_tests/extension_manifests_launcher_page_unittest.cc +++ b/chrome/common/extensions/manifest_tests/extension_manifests_launcher_page_unittest.cc @@ -22,7 +22,7 @@ const char kWhitelistID[] = "lmadimbbgapmngbiclpjjngmdickadpl"; typedef ChromeManifestTest LauncherPageManifestTest; TEST_F(LauncherPageManifestTest, ValidLauncherPage) { - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( extensions::switches::kWhitelistedExtensionID, kWhitelistID); scoped_refptr<extensions::Extension> extension( LoadAndExpectSuccess("init_valid_launcher_page.json")); diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc index 99b57b1..d116e17 100644 --- a/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc +++ b/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc @@ -82,7 +82,7 @@ TEST_F(PlatformAppsManifestTest, PlatformAppContentSecurityPolicy) { // Whitelisted ones can (this is the ID corresponding to the base 64 encoded // key in the init_platform_app_csp.json manifest.) std::string test_id = "ahplfneplbnjcflhdgkkjeiglkkfeelb"; - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kWhitelistedExtensionID, test_id); scoped_refptr<Extension> extension = LoadAndExpectSuccess("init_platform_app_csp.json"); @@ -138,7 +138,7 @@ TEST_F(PlatformAppsManifestTest, CertainApisRequirePlatformApps) { } // Now try again with the experimental flag set. - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableExperimentalExtensionApis); for (size_t i = 0; i < arraysize(kPlatformAppExperimentalApis); ++i) { LoadAndExpectSuccess(ManifestData(manifests[i].get(), "")); diff --git a/chrome/common/extensions/permissions/permissions_data_unittest.cc b/chrome/common/extensions/permissions/permissions_data_unittest.cc index 4cb12f9..a38b10c 100644 --- a/chrome/common/extensions/permissions/permissions_data_unittest.cc +++ b/chrome/common/extensions/permissions/permissions_data_unittest.cc @@ -562,7 +562,7 @@ TEST_F(ExtensionScriptAndCaptureVisibleTest, Permissions) { } TEST_F(ExtensionScriptAndCaptureVisibleTest, PermissionsWithChromeURLsEnabled) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kExtensionsOnChromeURLs); scoped_refptr<Extension> extension; diff --git a/chrome/common/logging_chrome.cc b/chrome/common/logging_chrome.cc index 67569e2..04ad0e3 100644 --- a/chrome/common/logging_chrome.cc +++ b/chrome/common/logging_chrome.cc @@ -117,7 +117,7 @@ void SuppressDialogs() { namespace logging { -LoggingDestination DetermineLogMode(const CommandLine& command_line) { +LoggingDestination DetermineLogMode(const base::CommandLine& command_line) { // only use OutputDebugString in debug mode #ifdef NDEBUG bool enable_logging = false; @@ -187,7 +187,7 @@ void RemoveSymlinkAndLog(const base::FilePath& link_path, } // anonymous namespace -base::FilePath GetSessionLogDir(const CommandLine& command_line) { +base::FilePath GetSessionLogDir(const base::CommandLine& command_line) { base::FilePath log_dir; std::string log_dir_str; scoped_ptr<base::Environment> env(base::Environment::Create()); @@ -213,11 +213,11 @@ base::FilePath GetSessionLogDir(const CommandLine& command_line) { return log_dir; } -base::FilePath GetSessionLogFile(const CommandLine& command_line) { +base::FilePath GetSessionLogFile(const base::CommandLine& command_line) { return GetSessionLogDir(command_line).Append(GetLogFileName().BaseName()); } -void RedirectChromeLogging(const CommandLine& command_line) { +void RedirectChromeLogging(const base::CommandLine& command_line) { if (chrome_logging_redirected_) { // TODO(nkostylev): Support multiple active users. http://crbug.com/230345 LOG(WARNING) << "NOT redirecting logging for multi-profiles case."; @@ -252,7 +252,7 @@ void RedirectChromeLogging(const CommandLine& command_line) { #endif // OS_CHROMEOS -void InitChromeLogging(const CommandLine& command_line, +void InitChromeLogging(const base::CommandLine& command_line, OldFileDeletionState delete_old_log_file) { DCHECK(!chrome_logging_initialized_) << "Attempted to initialize logging when it was already initialized."; @@ -315,7 +315,8 @@ void InitChromeLogging(const CommandLine& command_line, #endif // Default to showing error dialogs. - if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoErrorDialogs)) + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kNoErrorDialogs)) logging::SetShowErrorDialogs(true); // we want process and thread IDs because we have a lot of things running diff --git a/chrome/common/pepper_permission_util.cc b/chrome/common/pepper_permission_util.cc index ac01c04..822c77f 100644 --- a/chrome/common/pepper_permission_util.cc +++ b/chrome/common/pepper_permission_util.cc @@ -76,7 +76,8 @@ bool IsHostAllowedByCommandLine(const GURL& url, if (!url.is_valid()) return false; - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); const std::string allowed_list = command_line.GetSwitchValueASCII(command_line_switch); if (allowed_list.empty()) diff --git a/chrome/common/profiling.cc b/chrome/common/profiling.cc index 19cbac7..07cc8de 100644 --- a/chrome/common/profiling.cc +++ b/chrome/common/profiling.cc @@ -47,7 +47,8 @@ std::string GetProfileName() { CR_DEFINE_STATIC_LOCAL(std::string, profile_name, ()); if (profile_name.empty()) { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (command_line.HasSwitch(switches::kProfilingFile)) profile_name = command_line.GetSwitchValueASCII(switches::kProfilingFile); else @@ -70,7 +71,8 @@ void FlushProfilingData(base::Thread* thread) { base::debug::FlushProfiling(); static int flush_seconds; if (!flush_seconds) { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); std::string profiling_flush = command_line.GetSwitchValueASCII(switches::kProfilingFlush); if (!profiling_flush.empty()) { @@ -125,7 +127,8 @@ base::LazyInstance<ProfilingThreadControl>::Leaky // static void Profiling::ProcessStarted() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); std::string process_type = command_line.GetSwitchValueASCII(switches::kProcessType); @@ -165,7 +168,8 @@ void Profiling::ProcessStarted() { // static void Profiling::Start() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); bool flush = command_line.HasSwitch(switches::kProfilingFlush); base::debug::StartProfiling(GetProfileName()); diff --git a/chrome/common/service_process_util_mac.mm b/chrome/common/service_process_util_mac.mm index a62c858..eab7d4e 100644 --- a/chrome/common/service_process_util_mac.mm +++ b/chrome/common/service_process_util_mac.mm @@ -227,7 +227,7 @@ bool CheckServiceProcessReady() { return ready; } -CFDictionaryRef CreateServiceProcessLaunchdPlist(CommandLine* cmd_line, +CFDictionaryRef CreateServiceProcessLaunchdPlist(base::CommandLine* cmd_line, bool for_auto_launch) { base::mac::ScopedNSAutoreleasePool pool; diff --git a/chrome/common/service_process_util_unittest.cc b/chrome/common/service_process_util_unittest.cc index 5e80b10..9d54435 100644 --- a/chrome/common/service_process_util_unittest.cc +++ b/chrome/common/service_process_util_unittest.cc @@ -121,14 +121,15 @@ TEST_F(ServiceProcessStateTest, DISABLED_ReadyState) { TEST_F(ServiceProcessStateTest, AutoRun) { ServiceProcessState state; ASSERT_TRUE(state.AddToAutoRun()); - scoped_ptr<CommandLine> autorun_command_line; + scoped_ptr<base::CommandLine> autorun_command_line; #if defined(OS_WIN) std::string value_name = GetServiceProcessScopedName("_service_run"); base::string16 value; EXPECT_TRUE(base::win::ReadCommandFromAutoRun(HKEY_CURRENT_USER, base::UTF8ToWide(value_name), &value)); - autorun_command_line.reset(new CommandLine(CommandLine::FromString(value))); + autorun_command_line.reset( + new base::CommandLine(base::CommandLine::FromString(value))); #elif defined(OS_POSIX) && !defined(OS_MACOSX) #if defined(GOOGLE_CHROME_BUILD) std::string base_desktop_name = "google-chrome-service.desktop"; @@ -146,11 +147,11 @@ TEST_F(ServiceProcessStateTest, AutoRun) { ASSERT_EQ(std::string::npos, exec_value.find('"')); ASSERT_EQ(std::string::npos, exec_value.find('\'')); - CommandLine::StringVector argv; + base::CommandLine::StringVector argv; base::SplitString(exec_value, ' ', &argv); ASSERT_GE(argv.size(), 2U) << "Expected at least one command-line option in: " << exec_value; - autorun_command_line.reset(new CommandLine(argv)); + autorun_command_line.reset(new base::CommandLine(argv)); #endif // defined(OS_WIN) if (autorun_command_line.get()) { EXPECT_EQ(autorun_command_line->GetSwitchValueASCII(switches::kProcessType), @@ -349,7 +350,7 @@ TEST_F(ServiceProcessStateFileManipulationTest, VerifyLaunchD) { // /tmp/launchd*/sock. This test is still useful as a sanity check to make // sure that launchd appears to be working. - CommandLine cl(base::FilePath("/bin/launchctl")); + base::CommandLine cl(base::FilePath("/bin/launchctl")); cl.AppendArg("limit"); std::string output; diff --git a/chrome/common/switch_utils.cc b/chrome/common/switch_utils.cc index 1e796e0..f765c17 100644 --- a/chrome/common/switch_utils.cc +++ b/chrome/common/switch_utils.cc @@ -26,7 +26,7 @@ const char* const kSwitchesToRemoveOnAutorestart[] = { }; void RemoveSwitchesForAutostart( - std::map<std::string, CommandLine::StringType>* switch_list) { + std::map<std::string, base::CommandLine::StringType>* switch_list) { for (size_t i = 0; i < arraysize(kSwitchesToRemoveOnAutorestart); ++i) switch_list->erase(kSwitchesToRemoveOnAutorestart[i]); } diff --git a/chrome/common/switch_utils_unittest.cc b/chrome/common/switch_utils_unittest.cc index d00367e..f7bb44d 100644 --- a/chrome/common/switch_utils_unittest.cc +++ b/chrome/common/switch_utils_unittest.cc @@ -10,17 +10,17 @@ #include "testing/gtest/include/gtest/gtest.h" TEST(SwitchUtilsTest, RemoveSwitches) { - const CommandLine::CharType* argv[] = { - FILE_PATH_LITERAL("program"), - FILE_PATH_LITERAL("--app=http://www.google.com/"), - FILE_PATH_LITERAL("--force-first-run"), - FILE_PATH_LITERAL("--make-default-browser"), - FILE_PATH_LITERAL("--foo"), - FILE_PATH_LITERAL("--bar")}; - CommandLine cmd_line(arraysize(argv), argv); + const base::CommandLine::CharType* argv[] = { + FILE_PATH_LITERAL("program"), + FILE_PATH_LITERAL("--app=http://www.google.com/"), + FILE_PATH_LITERAL("--force-first-run"), + FILE_PATH_LITERAL("--make-default-browser"), + FILE_PATH_LITERAL("--foo"), + FILE_PATH_LITERAL("--bar")}; + base::CommandLine cmd_line(arraysize(argv), argv); EXPECT_FALSE(cmd_line.GetCommandLineString().empty()); - std::map<std::string, CommandLine::StringType> switches = + std::map<std::string, base::CommandLine::StringType> switches = cmd_line.GetSwitches(); EXPECT_EQ(5U, switches.size()); @@ -34,7 +34,7 @@ TEST(SwitchUtilsTest, RemoveSwitches) { TEST(SwitchUtilsTest, RemoveSwitchesFromString) { // All these command line args (except foo and bar) will // be removed after RemoveSwitchesForAutostart: - CommandLine cmd_line = CommandLine::FromString( + base::CommandLine cmd_line = base::CommandLine::FromString( L"program" L" --app=http://www.google.com/" L" --force-first-run" @@ -43,7 +43,7 @@ TEST(SwitchUtilsTest, RemoveSwitchesFromString) { L" --bar"); EXPECT_FALSE(cmd_line.GetCommandLineString().empty()); - std::map<std::string, CommandLine::StringType> switches = + std::map<std::string, base::CommandLine::StringType> switches = cmd_line.GetSwitches(); EXPECT_EQ(5U, switches.size()); diff --git a/chrome/common/terminate_on_heap_corruption_experiment_win.cc b/chrome/common/terminate_on_heap_corruption_experiment_win.cc index 1d45fc7..a4dde26 100644 --- a/chrome/common/terminate_on_heap_corruption_experiment_win.cc +++ b/chrome/common/terminate_on_heap_corruption_experiment_win.cc @@ -20,10 +20,10 @@ const wchar_t* GetBeaconKeyPath() { // sets some locale-related stuff to make sure it is parsed properly. But we // can temporarily initialize it for the purpose of determining if we are // Canary. - if (!CommandLine::InitializedForCurrentProcess()) { - CommandLine::Init(0, NULL); + if (!base::CommandLine::InitializedForCurrentProcess()) { + base::CommandLine::Init(0, NULL); channel = chrome::VersionInfo::GetChannel(); - CommandLine::Reset(); + base::CommandLine::Reset(); } else { channel = chrome::VersionInfo::GetChannel(); } diff --git a/chrome/installer/gcapi/gcapi.cc b/chrome/installer/gcapi/gcapi.cc index f08d90f..ef3c963 100644 --- a/chrome/installer/gcapi/gcapi.cc +++ b/chrome/installer/gcapi/gcapi.cc @@ -504,7 +504,7 @@ BOOL __stdcall LaunchGoogleChrome() { } } - CommandLine chrome_command(chrome_exe_path); + base::CommandLine chrome_command(chrome_exe_path); bool ret = false; ScopedComPtr<IProcessLauncher> ipl; @@ -540,7 +540,7 @@ BOOL __stdcall LaunchGoogleChromeWithDimensions(int x, // When launching in the background, use WMI to ensure that chrome.exe is // is not our child process. This prevents it from pushing itself to // foreground. - CommandLine chrome_command(chrome_exe_path); + base::CommandLine chrome_command(chrome_exe_path); ScopedCOMInitializer com_initializer; if (!installer::WMIProcess::Launch(chrome_command.GetCommandLineString(), diff --git a/chrome/installer/gcapi/gcapi_dll.cc b/chrome/installer/gcapi/gcapi_dll.cc index cb512e4..66e9bc1 100644 --- a/chrome/installer/gcapi/gcapi_dll.cc +++ b/chrome/installer/gcapi/gcapi_dll.cc @@ -21,12 +21,12 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE instance, LPVOID reserved) { if (reason == DLL_PROCESS_ATTACH) { g_exit_manager = new base::AtExitManager(); - CommandLine::Init(0, NULL); + base::CommandLine::Init(0, NULL); logging::LoggingSettings settings; settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; logging::InitLogging(settings); } else if (reason == DLL_PROCESS_DETACH) { - CommandLine::Reset(); + base::CommandLine::Reset(); delete g_exit_manager; g_exit_manager = NULL; } diff --git a/chrome/installer/gcapi/gcapi_test.cc b/chrome/installer/gcapi/gcapi_test.cc index 4e5d0a7..be649f0 100644 --- a/chrome/installer/gcapi/gcapi_test.cc +++ b/chrome/installer/gcapi/gcapi_test.cc @@ -62,12 +62,12 @@ const char kManualLaunchTests[] = "launch-chrome"; int main(int argc, char* argv[]) { base::AtExitManager exit_manager; - CommandLine::Init(argc, argv); + base::CommandLine::Init(argc, argv); testing::InitGoogleTest(&argc, argv); RUN_ALL_TESTS(); - if (CommandLine::ForCurrentProcess()->HasSwitch(kManualLaunchTests)) { + if (base::CommandLine::ForCurrentProcess()->HasSwitch(kManualLaunchTests)) { call_dynamically(); call_statically(); printf("LaunchChrome returned %d.\n", LaunchGoogleChrome()); diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc index 2b544b6..64af4da 100644 --- a/chrome/installer/setup/install_worker.cc +++ b/chrome/installer/setup/install_worker.cc @@ -221,7 +221,7 @@ void AddCommandWithParameterWorkItems(const InstallerState& installer_state, ->set_log_message("removing " + base::UTF16ToASCII(command_key) + " command"); } else { - CommandLine cmd_line(installer_state.target_path().Append(app)); + base::CommandLine cmd_line(installer_state.target_path().Append(app)); cmd_line.AppendSwitchASCII(command_with_parameter, "%1"); AppCommand cmd(cmd_line.GetCommandLineString()); @@ -297,7 +297,7 @@ void AddFirewallRulesWorkItems(const InstallerState& installer_state, // --verbose-logging if the current installation was launched with // --verbose-logging. |setup_path| and |new_version| are optional only when // the operation is an uninstall. -CommandLine GetGenericQuickEnableCommand( +base::CommandLine GetGenericQuickEnableCommand( const InstallerState& installer_state, const InstallationState& machine_state, const base::FilePath& setup_path, @@ -331,7 +331,7 @@ CommandLine GetGenericQuickEnableCommand( } DCHECK(!binaries_setup_path.empty()); - CommandLine cmd_line(binaries_setup_path); + base::CommandLine cmd_line(binaries_setup_path); cmd_line.AppendSwitch(switches::kMultiInstall); if (installer_state.verbose_logging()) cmd_line.AppendSwitch(switches::kVerboseLogging); @@ -363,10 +363,8 @@ void AddQuickEnableApplicationLauncherWorkItems( GetRegCommandKey(BrowserDistribution::GetSpecificDistribution( BrowserDistribution::CHROME_BINARIES), kCmdQuickEnableApplicationHost)); - CommandLine cmd_line(GetGenericQuickEnableCommand(installer_state, - machine_state, - setup_path, - new_version)); + base::CommandLine cmd_line(GetGenericQuickEnableCommand( + installer_state, machine_state, setup_path, new_version)); // kMultiInstall and kVerboseLogging were processed above. cmd_line.AppendSwitch(switches::kChromeAppLauncher); cmd_line.AppendSwitch(switches::kEnsureGoogleUpdatePresent); @@ -688,7 +686,7 @@ void AddUninstallShortcutWorkItems(const InstallerState& installer_state, installer_state.GetInstallerDirectory(new_version)); installer_path = installer_path.Append(setup_path.BaseName()); - CommandLine uninstall_arguments(CommandLine::NO_PROGRAM); + base::CommandLine uninstall_arguments(base::CommandLine::NO_PROGRAM); AppendUninstallCommandLineFlags(installer_state, product, &uninstall_arguments); @@ -712,7 +710,7 @@ void AddUninstallShortcutWorkItems(const InstallerState& installer_state, // MSI installations will manage their own uninstall shortcuts. if (!installer_state.is_msi() && product.ShouldCreateUninstallEntry()) { // We need to quote the command line for the Add/Remove Programs dialog. - CommandLine quoted_uninstall_cmd(installer_path); + base::CommandLine quoted_uninstall_cmd(installer_path); DCHECK_EQ(quoted_uninstall_cmd.GetCommandLineString()[0], '"'); quoted_uninstall_cmd.AppendArguments(uninstall_arguments, false); @@ -1125,7 +1123,7 @@ bool AppendPostInstallTasks(const InstallerState& installer_state, installer_state.GetInstallerDirectory(new_version).Append( setup_path.BaseName())); - CommandLine rename(installer_path); + base::CommandLine rename(installer_path); rename.AppendSwitch(switches::kRenameChromeExe); if (installer_state.system_install()) rename.AppendSwitch(switches::kSystemLevel); @@ -1169,7 +1167,7 @@ bool AppendPostInstallTasks(const InstallerState& installer_state, // The first to run it will perform the operation and clean up the other // values. if (dist->GetType() != BrowserDistribution::CHROME_BINARIES) { - CommandLine product_rename_cmd(rename); + base::CommandLine product_rename_cmd(rename); products[i]->AppendRenameFlags(&product_rename_cmd); in_use_update_work_items->AddSetRegValueWorkItem( root, @@ -1495,7 +1493,7 @@ void AddActiveSetupWorkItems(const InstallerState& installer_state, base::FilePath active_setup_exe(installer_state.GetInstallerDirectory( new_version).Append(kActiveSetupExe)); - CommandLine cmd(active_setup_exe); + base::CommandLine cmd(active_setup_exe); cmd.AppendSwitch(installer::switches::kConfigureUserSettings); cmd.AppendSwitch(installer::switches::kVerboseLogging); cmd.AppendSwitch(installer::switches::kSystemLevel); @@ -1544,7 +1542,7 @@ void AddDeleteOldIELowRightsPolicyWorkItems( void AppendUninstallCommandLineFlags(const InstallerState& installer_state, const Product& product, - CommandLine* uninstall_cmd) { + base::CommandLine* uninstall_cmd) { DCHECK(uninstall_cmd); uninstall_cmd->AppendSwitch(installer::switches::kUninstall); @@ -1596,9 +1594,9 @@ void AddOsUpgradeWorkItems(const InstallerState& installer_state, } else { // Register with Google Update to have setup.exe --on-os-upgrade called on // OS upgrade. - CommandLine cmd_line(installer_state - .GetInstallerDirectory(new_version) - .Append(setup_path.BaseName())); + base::CommandLine cmd_line( + installer_state.GetInstallerDirectory(new_version) + .Append(setup_path.BaseName())); // Add the main option to indicate OS upgrade flow. cmd_line.AppendSwitch(installer::switches::kOnOsUpgrade); // Add product-specific options. @@ -1626,9 +1624,9 @@ void AddQueryEULAAcceptanceWorkItems(const InstallerState& installer_state, work_item_list->AddDeleteRegKeyWorkItem(root_key, cmd_key, KEY_WOW64_32KEY) ->set_log_message("Removing query EULA acceptance command"); } else { - CommandLine cmd_line(installer_state - .GetInstallerDirectory(new_version) - .Append(setup_path.BaseName())); + base::CommandLine cmd_line( + installer_state.GetInstallerDirectory(new_version) + .Append(setup_path.BaseName())); cmd_line.AppendSwitch(switches::kQueryEULAAcceptance); if (installer_state.system_install()) cmd_line.AppendSwitch(installer::switches::kSystemLevel); diff --git a/chrome/installer/setup/install_worker_unittest.cc b/chrome/installer/setup/install_worker_unittest.cc index 29260b2..c288549 100644 --- a/chrome/installer/setup/install_worker_unittest.cc +++ b/chrome/installer/setup/install_worker_unittest.cc @@ -119,7 +119,7 @@ class MockProductState : public ProductState { } void clear_oem_install() { has_oem_install_ = false; } void SetUninstallProgram(const base::FilePath& setup_exe) { - uninstall_command_ = CommandLine(setup_exe); + uninstall_command_ = base::CommandLine(setup_exe); } void AddUninstallSwitch(const std::string& option) { uninstall_command_.AppendSwitch(option); diff --git a/chrome/installer/setup/run_all_unittests.cc b/chrome/installer/setup/run_all_unittests.cc index a309b11..fa35408 100644 --- a/chrome/installer/setup/run_all_unittests.cc +++ b/chrome/installer/setup/run_all_unittests.cc @@ -12,7 +12,7 @@ int main(int argc, char** argv) { // Handle the --adjust-process-priority switch, which is used to test the // installer::AdjustProcessPriority() function in a subprocess. - if (CommandLine::ForCurrentProcess()->HasSwitch(kAdjustProcessPriority)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch(kAdjustProcessPriority)) return DoProcessPriorityAdjustment(); // Register Chrome Path provider so that we can get test data dir. diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc index ce590b0..9017b33 100644 --- a/chrome/installer/setup/setup_main.cc +++ b/chrome/installer/setup/setup_main.cc @@ -91,7 +91,7 @@ namespace { // returns a patch helper configured to uncompress and patch. scoped_ptr<installer::ArchivePatchHelper> CreateChromeArchiveHelper( const base::FilePath& setup_exe, - const CommandLine& command_line, + const base::CommandLine& command_line, const installer::InstallerState& installer_state, const base::FilePath& working_directory) { // A compressed archive is ordinarily given on the command line by the mini @@ -583,7 +583,7 @@ bool CheckPreInstallConditions(const InstallationState& original_state, *status = installer::EXISTING_VERSION_LAUNCHED; base::FilePath chrome_exe = install_path.Append(installer::kChromeExe); - CommandLine cmd(chrome_exe); + base::CommandLine cmd(chrome_exe); cmd.AppendSwitch(switches::kForceFirstRun); installer_state->WriteInstallerResult(*status, 0, NULL); VLOG(1) << "Launching existing system-level chrome instead."; @@ -644,7 +644,7 @@ installer::InstallStatus UninstallProduct( const InstallationState& original_state, const InstallerState& installer_state, const base::FilePath& setup_exe, - const CommandLine& cmd_line, + const base::CommandLine& cmd_line, bool remove_all, bool force_uninstall, const Product& product) { @@ -669,12 +669,12 @@ installer::InstallStatus UninstallProducts( const InstallationState& original_state, const InstallerState& installer_state, const base::FilePath& setup_exe, - const CommandLine& cmd_line) { + const base::CommandLine& cmd_line) { const Products& products = installer_state.products(); // System-level Chrome will be launched via this command if its program gets // set below. - CommandLine system_level_cmd(CommandLine::NO_PROGRAM); + base::CommandLine system_level_cmd(base::CommandLine::NO_PROGRAM); const Product* chrome = installer_state.FindProduct(BrowserDistribution::CHROME_BROWSER); @@ -758,7 +758,7 @@ void UninstallBinariesIfUnused( const ProductState* binaries_state = original_state.GetProductState(installer_state.system_install(), BrowserDistribution::CHROME_BINARIES); - const CommandLine& uninstall_cmd(binaries_state->uninstall_command()); + const base::CommandLine& uninstall_cmd(binaries_state->uninstall_command()); MasterPreferences uninstall_prefs(uninstall_cmd); InstallerState uninstall_state; uninstall_state.Initialize(uninstall_cmd, uninstall_prefs, original_state); @@ -778,7 +778,7 @@ void UninstallBinariesIfUnused( installer::InstallStatus InstallProducts( const InstallationState& original_state, const base::FilePath& setup_exe, - const CommandLine& cmd_line, + const base::CommandLine& cmd_line, const MasterPreferences& prefs, InstallerState* installer_state, base::FilePath* installer_directory) { @@ -895,7 +895,7 @@ installer::InstallStatus RegisterDevChrome( const InstallationState& original_state, const InstallerState& installer_state, const base::FilePath& setup_exe, - const CommandLine& cmd_line) { + const base::CommandLine& cmd_line) { BrowserDistribution* chrome_dist = BrowserDistribution::GetSpecificDistribution( BrowserDistribution::CHROME_BROWSER); @@ -971,7 +971,7 @@ installer::InstallStatus RegisterDevChrome( // has been found and processed (so setup.exe should exit at that point). bool HandleNonInstallCmdLineOptions(const InstallationState& original_state, const base::FilePath& setup_exe, - const CommandLine& cmd_line, + const base::CommandLine& cmd_line, InstallerState* installer_state, int* exit_code) { // TODO(gab): Add a local |status| variable which each block below sets; @@ -1325,7 +1325,7 @@ scoped_ptr<google_breakpad::ExceptionHandler> InitializeCrashReporting( // binaries will be uninstalled during later processing if they are not in-use // (see UninstallBinariesIfUnused). |original_state| and |installer_state| are // updated to reflect the state of the world following the operation. -void UninstallMultiChromeFrameIfPresent(const CommandLine& cmd_line, +void UninstallMultiChromeFrameIfPresent(const base::CommandLine& cmd_line, const MasterPreferences& prefs, InstallationState* original_state, InstallerState* installer_state) { @@ -1347,7 +1347,8 @@ void UninstallMultiChromeFrameIfPresent(const CommandLine& cmd_line, // Uninstall Chrome Frame without touching the multi-install binaries. // Simulate the uninstall as coming from the installed version. - const CommandLine& uninstall_cmd(chrome_frame_state->uninstall_command()); + const base::CommandLine& uninstall_cmd( + chrome_frame_state->uninstall_command()); MasterPreferences uninstall_prefs(uninstall_cmd); InstallerState uninstall_state; uninstall_state.Initialize(uninstall_cmd, uninstall_prefs, *original_state); @@ -1381,15 +1382,14 @@ void UninstallMultiChromeFrameIfPresent(const CommandLine& cmd_line, namespace installer { -InstallStatus InstallProductsHelper( - const InstallationState& original_state, - const base::FilePath& setup_exe, - const CommandLine& cmd_line, - const MasterPreferences& prefs, - const InstallerState& installer_state, - base::FilePath* installer_directory, - ArchiveType* archive_type, - bool* delegated_to_existing) { +InstallStatus InstallProductsHelper(const InstallationState& original_state, + const base::FilePath& setup_exe, + const base::CommandLine& cmd_line, + const MasterPreferences& prefs, + const InstallerState& installer_state, + base::FilePath* installer_directory, + ArchiveType* archive_type, + bool* delegated_to_existing) { DCHECK(archive_type); DCHECK(delegated_to_existing); const bool system_install = installer_state.system_install(); @@ -1683,7 +1683,7 @@ int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prev_instance, // The exit manager is in charge of calling the dtors of singletons. base::AtExitManager exit_manager; - CommandLine::Init(0, NULL); + base::CommandLine::Init(0, NULL); // install_util uses chrome paths. chrome::RegisterPathProvider(); @@ -1691,7 +1691,7 @@ int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prev_instance, const MasterPreferences& prefs = MasterPreferences::ForCurrentProcess(); installer::InitInstallerLogging(prefs); - const CommandLine& cmd_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& cmd_line = *base::CommandLine::ForCurrentProcess(); VLOG(1) << "Command Line: " << cmd_line.GetCommandLineString(); VLOG(1) << "multi install is " << prefs.is_multi_install(); @@ -1764,7 +1764,7 @@ int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prev_instance, if (system_install && !IsUserAnAdmin()) { if (base::win::GetVersion() >= base::win::VERSION_VISTA && !cmd_line.HasSwitch(installer::switches::kRunAsAdmin)) { - CommandLine new_cmd(CommandLine::NO_PROGRAM); + base::CommandLine new_cmd(base::CommandLine::NO_PROGRAM); new_cmd.AppendArguments(cmd_line, true); // Append --run-as-admin flag to let the new instance of setup.exe know // that we already tried to launch ourselves as admin. diff --git a/chrome/installer/setup/setup_util.cc b/chrome/installer/setup/setup_util.cc index d671097..ba25f7e 100644 --- a/chrome/installer/setup/setup_util.cc +++ b/chrome/installer/setup/setup_util.cc @@ -45,15 +45,15 @@ namespace { // the off chance that waiting itself fails, |exit_code| is set to // WAIT_FOR_EXISTING_FAILED. bool LaunchAndWaitForExistingInstall(const base::FilePath& setup_exe, - const CommandLine& command_line, + const base::CommandLine& command_line, int* exit_code) { DCHECK(exit_code); - CommandLine new_cl(setup_exe); + base::CommandLine new_cl(setup_exe); // Copy over all switches but --install-archive. - CommandLine::SwitchMap switches(command_line.GetSwitches()); + base::CommandLine::SwitchMap switches(command_line.GetSwitches()); switches.erase(switches::kInstallArchive); - for (CommandLine::SwitchMap::const_iterator i = switches.begin(); + for (base::CommandLine::SwitchMap::const_iterator i = switches.begin(); i != switches.end(); ++i) { if (i->second.empty()) new_cl.AppendSwitch(i->first); @@ -62,8 +62,8 @@ bool LaunchAndWaitForExistingInstall(const base::FilePath& setup_exe, } // Copy over all arguments. - CommandLine::StringVector args(command_line.GetArgs()); - for (CommandLine::StringVector::const_iterator i = args.begin(); + base::CommandLine::StringVector args(command_line.GetArgs()); + for (base::CommandLine::StringVector::const_iterator i = args.begin(); i != args.end(); ++i) { new_cl.AppendArgNative(*i); } @@ -285,7 +285,7 @@ bool GetExistingHigherInstaller( } bool DeferToExistingInstall(const base::FilePath& setup_exe, - const CommandLine& command_line, + const base::CommandLine& command_line, const InstallerState& installer_state, const base::FilePath& temp_path, InstallStatus* install_status) { @@ -432,7 +432,7 @@ bool IsUninstallSuccess(InstallStatus install_status) { install_status == UNINSTALL_REQUIRES_REBOOT); } -bool ContainsUnsupportedSwitch(const CommandLine& cmd_line) { +bool ContainsUnsupportedSwitch(const base::CommandLine& cmd_line) { static const char* const kLegacySwitches[] = { // Chrome Frame ready-mode. "ready-mode", diff --git a/chrome/installer/setup/setup_util_unittest.cc b/chrome/installer/setup/setup_util_unittest.cc index e11f33a..c07ec98 100644 --- a/chrome/installer/setup/setup_util_unittest.cc +++ b/chrome/installer/setup/setup_util_unittest.cc @@ -229,7 +229,7 @@ ScopedPriorityClass::~ScopedPriorityClass() { } PriorityClassChangeResult RelaunchAndDoProcessPriorityAdjustment() { - CommandLine cmd_line(*CommandLine::ForCurrentProcess()); + base::CommandLine cmd_line(*base::CommandLine::ForCurrentProcess()); cmd_line.AppendSwitch(kAdjustProcessPriority); base::Process process = base::LaunchProcess(cmd_line, base::LaunchOptions()); int exit_code = 0; @@ -285,7 +285,7 @@ class FindArchiveToPatchTest : public SetupUtilTestWithDir { version_.reset(); } - void set_uninstall_command(const CommandLine& uninstall_command) { + void set_uninstall_command(const base::CommandLine& uninstall_command) { uninstall_command_ = uninstall_command; } }; @@ -342,10 +342,11 @@ class FindArchiveToPatchTest : public SetupUtilTestWithDir { kProductType_)); product->set_version(product_version_); - CommandLine uninstall_command( - test_dir_.path().AppendASCII(product_version_.GetString()) - .Append(installer::kInstallerDir) - .Append(installer::kSetupExe)); + base::CommandLine uninstall_command( + test_dir_.path() + .AppendASCII(product_version_.GetString()) + .Append(installer::kInstallerDir) + .Append(installer::kSetupExe)); uninstall_command.AppendSwitch(installer::switches::kUninstall); product->set_uninstall_command(uninstall_command); } @@ -490,11 +491,11 @@ TEST_F(MigrateMultiToSingleTest, ChromeFrame) { TEST(SetupUtilTest, ContainsUnsupportedSwitch) { EXPECT_FALSE(installer::ContainsUnsupportedSwitch( - CommandLine::FromString(L"foo.exe"))); + base::CommandLine::FromString(L"foo.exe"))); EXPECT_FALSE(installer::ContainsUnsupportedSwitch( - CommandLine::FromString(L"foo.exe --multi-install --chrome"))); + base::CommandLine::FromString(L"foo.exe --multi-install --chrome"))); EXPECT_TRUE(installer::ContainsUnsupportedSwitch( - CommandLine::FromString(L"foo.exe --chrome-frame"))); + base::CommandLine::FromString(L"foo.exe --chrome-frame"))); } TEST(SetupUtilTest, GetRegistrationDataCommandKey) { diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc index 0eb961a..3df4ea8 100644 --- a/chrome/installer/setup/uninstall.cc +++ b/chrome/installer/setup/uninstall.cc @@ -607,7 +607,7 @@ InstallStatus IsChromeActiveOrUserCancelled( const InstallerState& installer_state, const Product& product) { int32 exit_code = content::RESULT_CODE_NORMAL_EXIT; - CommandLine options(CommandLine::NO_PROGRAM); + base::CommandLine options(base::CommandLine::NO_PROGRAM); options.AppendSwitch(installer::switches::kUninstall); // Here we want to save user from frustration (in case of Chrome crashes) @@ -638,7 +638,8 @@ InstallStatus IsChromeActiveOrUserCancelled( } bool ShouldDeleteProfile(const InstallerState& installer_state, - const CommandLine& cmd_line, InstallStatus status, + const base::CommandLine& cmd_line, + InstallStatus status, const Product& product) { bool should_delete = false; @@ -1094,7 +1095,7 @@ InstallStatus UninstallProduct(const InstallationState& original_state, const Product& product, bool remove_all, bool force_uninstall, - const CommandLine& cmd_line) { + const base::CommandLine& cmd_line) { InstallStatus status = installer::UNINSTALL_CONFIRMED; BrowserDistribution* browser_dist = product.distribution(); const base::FilePath chrome_exe( @@ -1132,7 +1133,7 @@ InstallStatus UninstallProduct(const InstallationState& original_state, !::IsUserAnAdmin() && base::win::GetVersion() >= base::win::VERSION_VISTA && !cmd_line.HasSwitch(installer::switches::kRunAsAdmin)) { - CommandLine new_cmd(CommandLine::NO_PROGRAM); + base::CommandLine new_cmd(base::CommandLine::NO_PROGRAM); new_cmd.AppendArguments(cmd_line, true); // Append --run-as-admin flag to let the new instance of setup.exe know // that we already tried to launch ourselves as admin. diff --git a/chrome/installer/test/alternate_version_generator.cc b/chrome/installer/test/alternate_version_generator.cc index fd66c01..98c72cf 100644 --- a/chrome/installer/test/alternate_version_generator.cc +++ b/chrome/installer/test/alternate_version_generator.cc @@ -467,7 +467,7 @@ bool ApplyAlternateVersion(const base::FilePath& work_dir, // command-line switch. base::FilePath Get7zaPath() { base::FilePath l7za_path = - CommandLine::ForCurrentProcess()->GetSwitchValuePath( + base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( &kSwitch7zaPath[0]); if (l7za_path.empty()) { base::FilePath dir_exe; diff --git a/chrome/installer/test/alternate_version_generator_main.cc b/chrome/installer/test/alternate_version_generator_main.cc index 7d819f0..9211a3d 100644 --- a/chrome/installer/test/alternate_version_generator_main.cc +++ b/chrome/installer/test/alternate_version_generator_main.cc @@ -58,7 +58,7 @@ const wchar_t* GetErrorMessage(ErrorCode error_code) { // Display usage information to stderr along with an optional error message with // details. -void DumpUsage(const CommandLine& cmd_line, +void DumpUsage(const base::CommandLine& cmd_line, errors::ErrorCode error_code, const std::wstring& detail) { const wchar_t* error_message = errors::GetErrorMessage(error_code); @@ -93,7 +93,7 @@ L" relative to this program's location.\n", // Gets the path to the source mini_installer.exe on which to operate, putting // the result in |mini_installer|. Returns true on success. -bool GetMiniInstallerPath(const CommandLine& cmd_line, +bool GetMiniInstallerPath(const base::CommandLine& cmd_line, base::FilePath* mini_installer) { DCHECK(mini_installer); base::FilePath result = cmd_line.GetSwitchValuePath(switches::kMiniInstaller); @@ -106,7 +106,7 @@ bool GetMiniInstallerPath(const CommandLine& cmd_line, } // Gets the path to the output file, putting the result in |out|. -void GetOutPath(const CommandLine& cmd_line, base::FilePath* out) { +void GetOutPath(const base::CommandLine& cmd_line, base::FilePath* out) { DCHECK(out); base::FilePath result = cmd_line.GetSwitchValuePath(switches::kOut); if (result.empty()) @@ -116,7 +116,7 @@ void GetOutPath(const CommandLine& cmd_line, base::FilePath* out) { } // Returns the direction in which the version should be adjusted. -upgrade_test::Direction GetDirection(const CommandLine& cmd_line) { +upgrade_test::Direction GetDirection(const base::CommandLine& cmd_line) { return cmd_line.HasSwitch(switches::kPrevious) ? upgrade_test::PREVIOUS_VERSION : upgrade_test::NEXT_VERSION; } @@ -126,8 +126,8 @@ upgrade_test::Direction GetDirection(const CommandLine& cmd_line) { // The main program. int wmain(int argc, wchar_t *argv[]) { base::AtExitManager exit_manager; - CommandLine::Init(0, NULL); - CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + base::CommandLine::Init(0, NULL); + base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); if (cmd_line->HasSwitch(switches::kHelp)) { DumpUsage(*cmd_line, errors::SHOW_HELP, std::wstring()); diff --git a/chrome/installer/tools/validate_installation_main.cc b/chrome/installer/tools/validate_installation_main.cc index dc95aaa..74f860c 100644 --- a/chrome/installer/tools/validate_installation_main.cc +++ b/chrome/installer/tools/validate_installation_main.cc @@ -165,7 +165,7 @@ int wmain(int argc, wchar_t *argv[]) { int result = EXIT_SUCCESS; base::AtExitManager exit_manager; - CommandLine::Init(0, NULL); + base::CommandLine::Init(0, NULL); ConsoleLogHelper log_helper; // Check user-level and system-level for products. diff --git a/chrome/installer/util/auto_launch_util.cc b/chrome/installer/util/auto_launch_util.cc index 9ab226d6..08be65d 100644 --- a/chrome/installer/util/auto_launch_util.cc +++ b/chrome/installer/util/auto_launch_util.cc @@ -183,7 +183,8 @@ void SetWillLaunchAtLogin(const base::FilePath& application_path, cmd_line += ASCIIToUTF16(" --"); cmd_line += ASCIIToUTF16(switches::kAutoLaunchAtStartup); - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (command_line.HasSwitch(switches::kUserDataDir)) { cmd_line += ASCIIToUTF16(" --"); cmd_line += ASCIIToUTF16(switches::kUserDataDir); diff --git a/chrome/installer/util/chrome_app_host_operations.cc b/chrome/installer/util/chrome_app_host_operations.cc index 79cfe6b..6130d41 100644 --- a/chrome/installer/util/chrome_app_host_operations.cc +++ b/chrome/installer/util/chrome_app_host_operations.cc @@ -30,9 +30,9 @@ void ChromeAppHostOperations::ReadOptions(const MasterPreferences& prefs, } } -void ChromeAppHostOperations::ReadOptions(const CommandLine& uninstall_command, - std::set<base::string16>* options) - const { +void ChromeAppHostOperations::ReadOptions( + const base::CommandLine& uninstall_command, + std::set<base::string16>* options) const { DCHECK(options); if (uninstall_command.HasSwitch(switches::kMultiInstall)) @@ -51,7 +51,7 @@ void ChromeAppHostOperations::AddComDllList( void ChromeAppHostOperations::AppendProductFlags( const std::set<base::string16>& options, - CommandLine* cmd_line) const { + base::CommandLine* cmd_line) const { DCHECK(cmd_line); bool is_multi_install = options.find(kOptionMultiInstall) != options.end(); @@ -68,7 +68,7 @@ void ChromeAppHostOperations::AppendProductFlags( void ChromeAppHostOperations::AppendRenameFlags( const std::set<base::string16>& options, - CommandLine* cmd_line) const { + base::CommandLine* cmd_line) const { DCHECK(cmd_line); bool is_multi_install = options.find(kOptionMultiInstall) != options.end(); @@ -105,7 +105,7 @@ void ChromeAppHostOperations::AddDefaultShortcutProperties( properties->set_target(target_exe); if (!properties->has_arguments()) { - CommandLine app_host_args(CommandLine::NO_PROGRAM); + base::CommandLine app_host_args(base::CommandLine::NO_PROGRAM); app_host_args.AppendSwitch(::switches::kShowAppList); properties->set_arguments(app_host_args.GetCommandLineString()); } diff --git a/chrome/installer/util/chrome_binaries_operations.cc b/chrome/installer/util/chrome_binaries_operations.cc index 85ba7bf..f8fc1ff 100644 --- a/chrome/installer/util/chrome_binaries_operations.cc +++ b/chrome/installer/util/chrome_binaries_operations.cc @@ -22,9 +22,9 @@ void ChromeBinariesOperations::ReadOptions(const MasterPreferences& prefs, options->insert(kOptionMultiInstall); } -void ChromeBinariesOperations::ReadOptions(const CommandLine& uninstall_command, - std::set<base::string16>* options) - const { +void ChromeBinariesOperations::ReadOptions( + const base::CommandLine& uninstall_command, + std::set<base::string16>* options) const { DCHECK(options); options->insert(kOptionMultiInstall); } @@ -43,7 +43,7 @@ void ChromeBinariesOperations::AddComDllList( void ChromeBinariesOperations::AppendProductFlags( const std::set<base::string16>& options, - CommandLine* cmd_line) const { + base::CommandLine* cmd_line) const { DCHECK(cmd_line); DCHECK(options.find(kOptionMultiInstall) != options.end()); @@ -55,7 +55,7 @@ void ChromeBinariesOperations::AppendProductFlags( void ChromeBinariesOperations::AppendRenameFlags( const std::set<base::string16>& options, - CommandLine* cmd_line) const { + base::CommandLine* cmd_line) const { DCHECK(cmd_line); DCHECK(options.find(kOptionMultiInstall) != options.end()); diff --git a/chrome/installer/util/chrome_browser_operations.cc b/chrome/installer/util/chrome_browser_operations.cc index 1b7bd00..431b2e1 100644 --- a/chrome/installer/util/chrome_browser_operations.cc +++ b/chrome/installer/util/chrome_browser_operations.cc @@ -34,9 +34,9 @@ void ChromeBrowserOperations::ReadOptions(const MasterPreferences& prefs, } } -void ChromeBrowserOperations::ReadOptions(const CommandLine& uninstall_command, - std::set<base::string16>* options) - const { +void ChromeBrowserOperations::ReadOptions( + const base::CommandLine& uninstall_command, + std::set<base::string16>* options) const { DCHECK(options); if (uninstall_command.HasSwitch(switches::kMultiInstall)) @@ -57,7 +57,7 @@ void ChromeBrowserOperations::AddComDllList( void ChromeBrowserOperations::AppendProductFlags( const std::set<base::string16>& options, - CommandLine* cmd_line) const { + base::CommandLine* cmd_line) const { DCHECK(cmd_line); if (options.find(kOptionMultiInstall) != options.end()) { @@ -72,7 +72,7 @@ void ChromeBrowserOperations::AppendProductFlags( void ChromeBrowserOperations::AppendRenameFlags( const std::set<base::string16>& options, - CommandLine* cmd_line) const { + base::CommandLine* cmd_line) const { DCHECK(cmd_line); // Add --multi-install if it isn't already there. @@ -142,7 +142,7 @@ void ChromeBrowserOperations::LaunchUserExperiment( const std::set<base::string16>& options, InstallStatus status, bool system_level) const { - CommandLine base_command(setup_path); + base::CommandLine base_command(setup_path); AppendProductFlags(options, &base_command); installer::LaunchBrowserUserExperiment(base_command, status, system_level); } diff --git a/chrome/installer/util/chrome_browser_sxs_operations.cc b/chrome/installer/util/chrome_browser_sxs_operations.cc index ef2fe68..71798c3 100644 --- a/chrome/installer/util/chrome_browser_sxs_operations.cc +++ b/chrome/installer/util/chrome_browser_sxs_operations.cc @@ -12,7 +12,7 @@ namespace installer { void ChromeBrowserSxSOperations::AppendProductFlags( const std::set<base::string16>& options, - CommandLine* cmd_line) const { + base::CommandLine* cmd_line) const { DCHECK(cmd_line); cmd_line->AppendSwitch(switches::kChromeSxS); @@ -21,7 +21,7 @@ void ChromeBrowserSxSOperations::AppendProductFlags( void ChromeBrowserSxSOperations::AppendRenameFlags( const std::set<base::string16>& options, - CommandLine* cmd_line) const { + base::CommandLine* cmd_line) const { DCHECK(cmd_line); cmd_line->AppendSwitch(switches::kChromeSxS); diff --git a/chrome/installer/util/chrome_frame_operations.cc b/chrome/installer/util/chrome_frame_operations.cc index 278310b..6ed2edc 100644 --- a/chrome/installer/util/chrome_frame_operations.cc +++ b/chrome/installer/util/chrome_frame_operations.cc @@ -36,9 +36,9 @@ void ChromeFrameOperations::ReadOptions(const MasterPreferences& prefs, } } -void ChromeFrameOperations::ReadOptions(const CommandLine& uninstall_command, - std::set<base::string16>* options) - const { +void ChromeFrameOperations::ReadOptions( + const base::CommandLine& uninstall_command, + std::set<base::string16>* options) const { DCHECK(options); static const struct FlagToOption { @@ -72,7 +72,7 @@ void ChromeFrameOperations::AddComDllList( void ChromeFrameOperations::AppendProductFlags( const std::set<base::string16>& options, - CommandLine* cmd_line) const { + base::CommandLine* cmd_line) const { DCHECK(cmd_line); bool is_multi_install = options.find(kOptionMultiInstall) != options.end(); @@ -86,7 +86,7 @@ void ChromeFrameOperations::AppendProductFlags( void ChromeFrameOperations::AppendRenameFlags( const std::set<base::string16>& options, - CommandLine* cmd_line) const { + base::CommandLine* cmd_line) const { DCHECK(cmd_line); bool is_multi_install = options.find(kOptionMultiInstall) != options.end(); diff --git a/chrome/installer/util/google_update_util.cc b/chrome/installer/util/google_update_util.cc index 05c3ecc..5140146 100644 --- a/chrome/installer/util/google_update_util.cc +++ b/chrome/installer/util/google_update_util.cc @@ -66,7 +66,7 @@ bool GetUserLevelGoogleUpdateInstallCommandLine(base::string16* cmd_string) { base::FilePath google_update_setup( GetGoogleUpdateSetupExe(true)); // system-level. if (!google_update_setup.empty()) { - CommandLine cmd(google_update_setup); + base::CommandLine cmd(google_update_setup); // Appends "/install runtime=true&needsadmin=false /silent /nomitag". // NB: /nomitag needs to be at the end. // Constants are found in code.google.com/p/omaha/common/const_cmd_line.h. @@ -164,7 +164,7 @@ void ElevateIfNeededToReenableUpdates() { return; } - CommandLine cmd(exe_path); + base::CommandLine cmd(exe_path); cmd.AppendSwitch(installer::switches::kReenableAutoupdates); installer::Product product(dist); product.InitializeFromUninstallCommand(product_state.uninstall_command()); diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc index e81c0cc..7a11c81 100644 --- a/chrome/installer/util/install_util.cc +++ b/chrome/installer/util/install_util.cc @@ -148,7 +148,7 @@ void InstallUtil::TriggerActiveSetupCommand() { return; } - CommandLine cmd(CommandLine::FromString(cmd_str)); + base::CommandLine cmd(base::CommandLine::FromString(cmd_str)); // Force creation of shortcuts as the First Run beacon might land between now // and the time setup.exe checks for it. cmd.AppendSwitch(installer::switches::kForceConfigureUserSettings); @@ -162,12 +162,13 @@ void InstallUtil::TriggerActiveSetupCommand() { PLOG(ERROR) << cmd.GetCommandLineString(); } -bool InstallUtil::ExecuteExeAsAdmin(const CommandLine& cmd, DWORD* exit_code) { +bool InstallUtil::ExecuteExeAsAdmin(const base::CommandLine& cmd, + DWORD* exit_code) { base::FilePath::StringType program(cmd.GetProgram().value()); DCHECK(!program.empty()); DCHECK_NE(program[0], L'\"'); - CommandLine::StringType params(cmd.GetCommandLineString()); + base::CommandLine::StringType params(cmd.GetCommandLineString()); if (params[0] == '"') { DCHECK_EQ('"', params[program.length() + 1]); DCHECK_EQ(program, params.substr(1, program.length())); @@ -208,13 +209,14 @@ bool InstallUtil::ExecuteExeAsAdmin(const CommandLine& cmd, DWORD* exit_code) { return success; } -CommandLine InstallUtil::GetChromeUninstallCmd( - bool system_install, BrowserDistribution::Type distribution_type) { +base::CommandLine InstallUtil::GetChromeUninstallCmd( + bool system_install, + BrowserDistribution::Type distribution_type) { ProductState state; if (state.Initialize(system_install, distribution_type)) { return state.uninstall_command(); } - return CommandLine(CommandLine::NO_PROGRAM); + return base::CommandLine(base::CommandLine::NO_PROGRAM); } void InstallUtil::GetChromeVersion(BrowserDistribution* dist, @@ -388,7 +390,7 @@ bool InstallUtil::IsMultiInstall(BrowserDistribution* dist, } bool CheckIsChromeSxSProcess() { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); CHECK(command_line); if (command_line->HasSwitch(installer::switches::kChromeSxS)) @@ -564,8 +566,9 @@ int InstallUtil::GetInstallReturnCode(installer::InstallStatus status) { // static void InstallUtil::MakeUninstallCommand(const base::string16& program, const base::string16& arguments, - CommandLine* command_line) { - *command_line = CommandLine::FromString(L"\"" + program + L"\" " + arguments); + base::CommandLine* command_line) { + *command_line = + base::CommandLine::FromString(L"\"" + program + L"\" " + arguments); } // static @@ -623,7 +626,7 @@ bool InstallUtil::ProgramCompare::Evaluate(const base::string16& value) const { // Suss out the exe portion of the value, which is expected to be a command // line kinda (or exactly) like: // "c:\foo\bar\chrome.exe" -- "%1" - base::FilePath program(CommandLine::FromString(value).GetProgram()); + base::FilePath program(base::CommandLine::FromString(value).GetProgram()); if (program.empty()) { LOG(WARNING) << "Failed to parse an executable name from command line: \"" << value << "\""; diff --git a/chrome/installer/util/install_util_unittest.cc b/chrome/installer/util/install_util_unittest.cc index 238148f..22dea39 100644 --- a/chrome/installer/util/install_util_unittest.cc +++ b/chrome/installer/util/install_util_unittest.cc @@ -35,7 +35,7 @@ class InstallUtilTest : public TestWithTempDirAndDeleteTempOverrideKeys { }; TEST_F(InstallUtilTest, MakeUninstallCommand) { - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); std::pair<std::wstring, std::wstring> params[] = { std::make_pair(std::wstring(L""), std::wstring(L"")), diff --git a/chrome/installer/util/installation_state.cc b/chrome/installer/util/installation_state.cc index 0173581..3c62306 100644 --- a/chrome/installer/util/installation_state.cc +++ b/chrome/installer/util/installation_state.cc @@ -15,7 +15,7 @@ namespace installer { ProductState::ProductState() - : uninstall_command_(CommandLine::NO_PROGRAM), + : uninstall_command_(base::CommandLine::NO_PROGRAM), eula_accepted_(0), usagestats_(0), msi_(false), @@ -181,7 +181,7 @@ void ProductState::Clear() { brand_.clear(); rename_cmd_.clear(); oem_install_.clear(); - uninstall_command_ = CommandLine(CommandLine::NO_PROGRAM); + uninstall_command_ = base::CommandLine(base::CommandLine::NO_PROGRAM); commands_.Clear(); eula_accepted_ = 0; usagestats_ = 0; diff --git a/chrome/installer/util/installation_validator.cc b/chrome/installer/util/installation_validator.cc index be5959a..b8812d3 100644 --- a/chrome/installer/util/installation_validator.cc +++ b/chrome/installer/util/installation_validator.cc @@ -202,7 +202,8 @@ void InstallationValidator::ValidateOnOsUpgradeCommand( bool* is_valid) { DCHECK(is_valid); - CommandLine cmd_line(CommandLine::FromString(app_cmd.command_line())); + base::CommandLine cmd_line( + base::CommandLine::FromString(app_cmd.command_line())); base::string16 name(kCmdOnOsUpgrade); ValidateSetupPath(ctx, cmd_line.GetProgram(), name, is_valid); @@ -231,7 +232,8 @@ void InstallationValidator::ValidateQueryEULAAcceptanceCommand( bool* is_valid) { DCHECK(is_valid); - CommandLine cmd_line(CommandLine::FromString(app_cmd.command_line())); + base::CommandLine cmd_line( + base::CommandLine::FromString(app_cmd.command_line())); base::string16 name(kCmdQueryEULAAcceptance); ValidateSetupPath(ctx, cmd_line.GetProgram(), name, is_valid); @@ -257,7 +259,8 @@ void InstallationValidator::ValidateQuickEnableApplicationHostCommand( bool* is_valid) { DCHECK(is_valid); - CommandLine cmd_line(CommandLine::FromString(app_cmd.command_line())); + base::CommandLine cmd_line( + base::CommandLine::FromString(app_cmd.command_line())); base::string16 name(kCmdQuickEnableApplicationHost); ValidateSetupPath(ctx, cmd_line.GetProgram(), name, is_valid); @@ -470,7 +473,7 @@ void InstallationValidator::ValidateSetupPath(const ProductContext& ctx, // Validates that |command| meets the expectations described in |expected|. void InstallationValidator::ValidateCommandExpectations( const ProductContext& ctx, - const CommandLine& command, + const base::CommandLine& command, const SwitchExpectations& expected, const base::string16& source, bool* is_valid) { @@ -492,7 +495,7 @@ void InstallationValidator::ValidateCommandExpectations( // the product described by |ctx| void InstallationValidator::ValidateUninstallCommand( const ProductContext& ctx, - const CommandLine& command, + const base::CommandLine& command, const base::string16& source, bool* is_valid) { DCHECK(is_valid); @@ -520,7 +523,8 @@ void InstallationValidator::ValidateRenameCommand(const ProductContext& ctx, DCHECK(is_valid); DCHECK(!ctx.state.rename_cmd().empty()); - CommandLine command = CommandLine::FromString(ctx.state.rename_cmd()); + base::CommandLine command = + base::CommandLine::FromString(ctx.state.rename_cmd()); base::string16 name(base::ASCIIToUTF16("in-use renamer")); ValidateSetupPath(ctx, command.GetProgram(), name, is_valid); diff --git a/chrome/installer/util/installation_validator_unittest.cc b/chrome/installer/util/installation_validator_unittest.cc index 941dc5c..ca12e2d 100644 --- a/chrome/installer/util/installation_validator_unittest.cc +++ b/chrome/installer/util/installation_validator_unittest.cc @@ -187,8 +187,8 @@ void FakeProductState::SetUninstallCommand(BrowserDistribution::Type dist_type, DCHECK(version); const bool is_multi_install = (channel_modifiers & CM_MULTI) != 0; - uninstall_command_ = CommandLine(GetSetupExePath(dist_type, install_level, - version, channel_modifiers)); + uninstall_command_ = base::CommandLine( + GetSetupExePath(dist_type, install_level, version, channel_modifiers)); uninstall_command_.AppendSwitch(installer::switches::kUninstall); if (install_level == SYSTEM_LEVEL) uninstall_command_.AppendSwitch(installer::switches::kSystemLevel); @@ -213,8 +213,8 @@ void FakeProductState::AddOsUpgradeCommand(BrowserDistribution::Type dist_type, // Right now only Chrome browser uses this. DCHECK_EQ(dist_type, BrowserDistribution::CHROME_BROWSER); - CommandLine cmd_line(GetSetupExePath(dist_type, install_level, version, - channel_modifiers)); + base::CommandLine cmd_line( + GetSetupExePath(dist_type, install_level, version, channel_modifiers)); cmd_line.AppendSwitch(installer::switches::kOnOsUpgrade); // Imitating ChromeBrowserOperations::AppendProductFlags(). if ((channel_modifiers & CM_MULTI) != 0) { @@ -237,8 +237,8 @@ void FakeProductState::AddQueryEULAAcceptanceCommand( int channel_modifiers) { DCHECK_EQ(dist_type, BrowserDistribution::CHROME_BINARIES); - CommandLine cmd_line(GetSetupExePath(dist_type, install_level, version, - channel_modifiers)); + base::CommandLine cmd_line( + GetSetupExePath(dist_type, install_level, version, channel_modifiers)); cmd_line.AppendSwitch(installer::switches::kQueryEULAAcceptance); if (install_level == SYSTEM_LEVEL) cmd_line.AppendSwitch(installer::switches::kSystemLevel); @@ -258,8 +258,8 @@ void FakeProductState::AddQuickEnableApplicationHostCommand( DCHECK_EQ(dist_type, BrowserDistribution::CHROME_BINARIES); DCHECK_NE(channel_modifiers & CM_MULTI, 0); - CommandLine cmd_line(GetSetupExePath(dist_type, install_level, version, - channel_modifiers)); + base::CommandLine cmd_line( + GetSetupExePath(dist_type, install_level, version, channel_modifiers)); cmd_line.AppendSwitch(installer::switches::kMultiInstall); cmd_line.AppendSwitch(installer::switches::kChromeAppLauncher); cmd_line.AppendSwitch(installer::switches::kEnsureGoogleUpdatePresent); diff --git a/chrome/installer/util/installer_state.cc b/chrome/installer/util/installer_state.cc index d204277..520fd58 100644 --- a/chrome/installer/util/installer_state.cc +++ b/chrome/installer/util/installer_state.cc @@ -88,7 +88,7 @@ InstallerState::InstallerState(Level level) set_level(level); } -void InstallerState::Initialize(const CommandLine& command_line, +void InstallerState::Initialize(const base::CommandLine& command_line, const MasterPreferences& prefs, const InstallationState& machine_state) { Clear(); diff --git a/chrome/installer/util/installer_state_unittest.cc b/chrome/installer/util/installer_state_unittest.cc index 4faaee0..c9b5940 100644 --- a/chrome/installer/util/installer_state_unittest.cc +++ b/chrome/installer/util/installer_state_unittest.cc @@ -76,7 +76,7 @@ void CreateTextFile(const std::wstring& filename, void BuildSingleChromeState(const base::FilePath& target_dir, MockInstallerState* installer_state) { - CommandLine cmd_line = CommandLine::FromString(L"setup.exe"); + base::CommandLine cmd_line = base::CommandLine::FromString(L"setup.exe"); MasterPreferences prefs(cmd_line); InstallationState machine_state; machine_state.Initialize(); @@ -249,7 +249,7 @@ TEST_F(InstallerStateTest, DeleteInUsed) { TEST_F(InstallerStateTest, Basic) { const bool multi_install = false; const bool system_level = true; - CommandLine cmd_line = CommandLine::FromString( + base::CommandLine cmd_line = base::CommandLine::FromString( std::wstring(L"setup.exe") + (multi_install ? L" --multi-install --chrome" : L"") + (system_level ? L" --system-level" : L"")); @@ -332,7 +332,7 @@ TEST_F(InstallerStateTest, Basic) { TEST_F(InstallerStateTest, WithProduct) { const bool multi_install = false; const bool system_level = true; - CommandLine cmd_line = CommandLine::FromString( + base::CommandLine cmd_line = base::CommandLine::FromString( std::wstring(L"setup.exe") + (multi_install ? L" --multi-install --chrome" : L"") + (system_level ? L" --system-level" : L"")); @@ -385,7 +385,8 @@ TEST_F(InstallerStateTest, InstallerResult) { { RegistryOverrideManager override_manager; override_manager.OverrideRegistry(root); - CommandLine cmd_line = CommandLine::FromString(L"setup.exe --system-level"); + base::CommandLine cmd_line = + base::CommandLine::FromString(L"setup.exe --system-level"); const MasterPreferences prefs(cmd_line); InstallationState machine_state; machine_state.Initialize(); @@ -416,7 +417,7 @@ TEST_F(InstallerStateTest, InstallerResult) { { RegistryOverrideManager override_manager; override_manager.OverrideRegistry(root); - CommandLine cmd_line = CommandLine::FromString( + base::CommandLine cmd_line = base::CommandLine::FromString( L"setup.exe --system-level --multi-install --chrome"); const MasterPreferences prefs(cmd_line); InstallationState machine_state; @@ -457,8 +458,8 @@ TEST_F(InstallerStateTest, GetCurrentVersionMigrateChrome) { new Version(chrome::kChromeVersion)); // Now we're invoked to install multi Chrome. - CommandLine cmd_line( - CommandLine::FromString(L"setup.exe --multi-install --chrome")); + base::CommandLine cmd_line( + base::CommandLine::FromString(L"setup.exe --multi-install --chrome")); MasterPreferences prefs(cmd_line); InstallerState installer_state; installer_state.Initialize(cmd_line, prefs, machine_state); @@ -625,8 +626,8 @@ TEST_F(InstallerStateTest, InitializeTwice) { // Initialize the instance to install multi Chrome. { - CommandLine cmd_line( - CommandLine::FromString(L"setup.exe --multi-install --chrome")); + base::CommandLine cmd_line( + base::CommandLine::FromString(L"setup.exe --multi-install --chrome")); MasterPreferences prefs(cmd_line); installer_state.Initialize(cmd_line, prefs, machine_state); } @@ -648,8 +649,8 @@ TEST_F(InstallerStateTest, InitializeTwice) { // Now initialize it to install system-level single Chrome. { - CommandLine cmd_line( - CommandLine::FromString(L"setup.exe --system-level --verbose-logging")); + base::CommandLine cmd_line(base::CommandLine::FromString( + L"setup.exe --system-level --verbose-logging")); MasterPreferences prefs(cmd_line); installer_state.Initialize(cmd_line, prefs, machine_state); } @@ -675,7 +676,8 @@ TEST_F(InstallerStateTest, InitializeTwice) { // tests must invoke Initialize() with a critical version. class InstallerStateCriticalVersionTest : public ::testing::Test { protected: - InstallerStateCriticalVersionTest() : cmd_line_(CommandLine::NO_PROGRAM) {} + InstallerStateCriticalVersionTest() + : cmd_line_(base::CommandLine::NO_PROGRAM) {} // Creates a set of versions for use by all test runs. static void SetUpTestCase() { @@ -699,11 +701,10 @@ class InstallerStateCriticalVersionTest : public ::testing::Test { // instance's critical update version is set to |version|. |version| may be // NULL, in which case the critical update version is unset. MockInstallerState& Initialize(const Version* version) { - cmd_line_ = version == NULL ? - CommandLine::FromString(L"setup.exe") : - CommandLine::FromString( - L"setup.exe --critical-update-version=" + - base::ASCIIToUTF16(version->GetString())); + cmd_line_ = version == NULL ? base::CommandLine::FromString(L"setup.exe") + : base::CommandLine::FromString( + L"setup.exe --critical-update-version=" + + base::ASCIIToUTF16(version->GetString())); prefs_.reset(new MasterPreferences(cmd_line_)); machine_state_.Initialize(); installer_state_.Initialize(cmd_line_, *prefs_, machine_state_); @@ -716,7 +717,7 @@ class InstallerStateCriticalVersionTest : public ::testing::Test { static Version* pv_version_; static Version* high_version_; - CommandLine cmd_line_; + base::CommandLine cmd_line_; scoped_ptr<MasterPreferences> prefs_; InstallationState machine_state_; MockInstallerState installer_state_; diff --git a/chrome/installer/util/master_preferences.cc b/chrome/installer/util/master_preferences.cc index de4d552..7bf5c2f7 100644 --- a/chrome/installer/util/master_preferences.cc +++ b/chrome/installer/util/master_preferences.cc @@ -75,10 +75,10 @@ MasterPreferences::MasterPreferences() : distribution_(NULL), chrome_(true), chrome_app_launcher_(false), multi_install_(false) { - InitializeFromCommandLine(*CommandLine::ForCurrentProcess()); + InitializeFromCommandLine(*base::CommandLine::ForCurrentProcess()); } -MasterPreferences::MasterPreferences(const CommandLine& cmd_line) +MasterPreferences::MasterPreferences(const base::CommandLine& cmd_line) : distribution_(NULL), preferences_read_from_file_(false), chrome_(true), @@ -117,7 +117,8 @@ MasterPreferences::MasterPreferences(const std::string& prefs) MasterPreferences::~MasterPreferences() { } -void MasterPreferences::InitializeFromCommandLine(const CommandLine& cmd_line) { +void MasterPreferences::InitializeFromCommandLine( + const base::CommandLine& cmd_line) { #if defined(OS_WIN) if (cmd_line.HasSwitch(installer::switches::kInstallerData)) { base::FilePath prefs_path(cmd_line.GetSwitchValuePath( diff --git a/chrome/installer/util/master_preferences_dummy.cc b/chrome/installer/util/master_preferences_dummy.cc index 971032a..54b7e67 100644 --- a/chrome/installer/util/master_preferences_dummy.cc +++ b/chrome/installer/util/master_preferences_dummy.cc @@ -15,7 +15,7 @@ namespace installer { -MasterPreferences::MasterPreferences(const CommandLine& cmd_line) +MasterPreferences::MasterPreferences(const base::CommandLine& cmd_line) : distribution_(NULL), preferences_read_from_file_(false) { } @@ -49,7 +49,7 @@ std::vector<std::string> MasterPreferences::GetFirstRunTabs() const { // static const MasterPreferences& MasterPreferences::ForCurrentProcess() { - static MasterPreferences prefs(*CommandLine::ForCurrentProcess()); + static MasterPreferences prefs(*base::CommandLine::ForCurrentProcess()); return prefs; } diff --git a/chrome/installer/util/master_preferences_unittest.cc b/chrome/installer/util/master_preferences_unittest.cc index 56c7f8c..02bb393 100644 --- a/chrome/installer/util/master_preferences_unittest.cc +++ b/chrome/installer/util/master_preferences_unittest.cc @@ -258,7 +258,7 @@ TEST_F(MasterPreferencesTest, GetInstallPreferencesTest) { std::wstring cmd_str( L"setup.exe --installerdata=\"" + prefs_file.value() + L"\""); cmd_str.append(L" --do-not-launch-chrome"); - CommandLine cmd_line = CommandLine::FromString(cmd_str); + base::CommandLine cmd_line = base::CommandLine::FromString(cmd_str); installer::MasterPreferences prefs(cmd_line); // Check prefs that do not have any equivalent command line option. @@ -303,7 +303,8 @@ TEST_F(MasterPreferencesTest, TestDefaultInstallConfig) { std::wstringstream chrome_cmd; chrome_cmd << "setup.exe"; - CommandLine chrome_install(CommandLine::FromString(chrome_cmd.str())); + base::CommandLine chrome_install( + base::CommandLine::FromString(chrome_cmd.str())); installer::MasterPreferences pref_chrome(chrome_install); @@ -318,7 +319,8 @@ TEST_F(MasterPreferencesTest, TestMultiInstallConfig) { std::wstringstream chrome_cmd, cf_cmd, chrome_cf_cmd; chrome_cmd << "setup.exe --" << kMultiInstall << " --" << kChrome; - CommandLine chrome_install(CommandLine::FromString(chrome_cmd.str())); + base::CommandLine chrome_install( + base::CommandLine::FromString(chrome_cmd.str())); installer::MasterPreferences pref_chrome(chrome_install); diff --git a/chrome/installer/util/product.cc b/chrome/installer/util/product.cc index d5dd118..89486a8 100644 --- a/chrome/installer/util/product.cc +++ b/chrome/installer/util/product.cc @@ -58,26 +58,26 @@ void Product::InitializeFromPreferences(const MasterPreferences& prefs) { } void Product::InitializeFromUninstallCommand( - const CommandLine& uninstall_command) { + const base::CommandLine& uninstall_command) { operations_->ReadOptions(uninstall_command, &options_); } bool Product::LaunchChrome(const base::FilePath& application_path) const { bool success = !application_path.empty(); if (success) { - CommandLine cmd(application_path.Append(installer::kChromeExe)); + base::CommandLine cmd(application_path.Append(installer::kChromeExe)); success = base::LaunchProcess(cmd, base::LaunchOptions()).IsValid(); } return success; } bool Product::LaunchChromeAndWait(const base::FilePath& application_path, - const CommandLine& options, + const base::CommandLine& options, int32* exit_code) const { if (application_path.empty()) return false; - CommandLine cmd(application_path.Append(installer::kChromeExe)); + base::CommandLine cmd(application_path.Append(installer::kChromeExe)); cmd.AppendArguments(options, false); bool success = false; @@ -143,11 +143,11 @@ void Product::AddComDllList(std::vector<base::FilePath>* com_dll_list) const { operations_->AddComDllList(options_, com_dll_list); } -void Product::AppendProductFlags(CommandLine* command_line) const { +void Product::AppendProductFlags(base::CommandLine* command_line) const { operations_->AppendProductFlags(options_, command_line); } -void Product::AppendRenameFlags(CommandLine* command_line) const { +void Product::AppendRenameFlags(base::CommandLine* command_line) const { operations_->AppendRenameFlags(options_, command_line); } diff --git a/chrome/installer/util/product_unittest.cc b/chrome/installer/util/product_unittest.cc index 6c311d1..d499548 100644 --- a/chrome/installer/util/product_unittest.cc +++ b/chrome/installer/util/product_unittest.cc @@ -51,7 +51,7 @@ TEST_F(ProductTest, ProductInstallBasic) { // TODO(tommi): We should mock this and use our mocked distribution. const bool multi_install = false; const bool system_level = true; - CommandLine cmd_line = CommandLine::FromString( + base::CommandLine cmd_line = base::CommandLine::FromString( std::wstring(L"setup.exe") + (multi_install ? L" --multi-install --chrome" : L"") + (system_level ? L" --system-level" : L"")); diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc index 22261c1..5a70fb9 100644 --- a/chrome/installer/util/shell_util.cc +++ b/chrome/installer/util/shell_util.cc @@ -850,12 +850,13 @@ bool ElevateAndRegisterChrome(BrowserDistribution* dist, KEY_READ | KEY_WOW64_32KEY); base::string16 uninstall_string; key.ReadValue(installer::kUninstallStringField, &uninstall_string); - CommandLine command_line = CommandLine::FromString(uninstall_string); + base::CommandLine command_line = + base::CommandLine::FromString(uninstall_string); exe_path = command_line.GetProgram(); } if (base::PathExists(exe_path)) { - CommandLine cmd(exe_path); + base::CommandLine cmd(exe_path); cmd.AppendSwitchPath(installer::switches::kRegisterChromeBrowser, chrome_exe); if (!suffix.empty()) { @@ -1249,7 +1250,7 @@ ShellUtil::DefaultState ProbeOpenCommandHandlers( base::string16 key_path; base::win::RegKey key; base::string16 value; - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); base::string16 short_path; for (size_t i = 0; i < num_protocols; ++i) { @@ -1262,7 +1263,7 @@ ShellUtil::DefaultState ProbeOpenCommandHandlers( } // Need to normalize path in case it's been munged. - command_line = CommandLine::FromString(value); + command_line = base::CommandLine::FromString(value); if (!ShortNameFromPath(command_line.GetProgram(), &short_path)) return ShellUtil::UNKNOWN_DEFAULT; @@ -1423,15 +1424,15 @@ bool ShortcutOpListOrRemoveUnknownArgs( if (!base::win::ResolveShortcut(shortcut_path, NULL, &args)) return false; - CommandLine current_args(CommandLine::FromString(base::StringPrintf( - L"unused_program %ls", args.c_str()))); + base::CommandLine current_args(base::CommandLine::FromString( + base::StringPrintf(L"unused_program %ls", args.c_str()))); const char* const kept_switches[] = { switches::kApp, switches::kAppId, switches::kShowAppList, switches::kProfileDirectory, }; - CommandLine desired_args(CommandLine::NO_PROGRAM); + base::CommandLine desired_args(base::CommandLine::NO_PROGRAM); desired_args.CopySwitchesFrom(current_args, kept_switches, arraysize(kept_switches)); if (desired_args.argv().size() == current_args.argv().size()) @@ -1846,7 +1847,7 @@ base::string16 ShellUtil::GetBrowserModelId(BrowserDistribution* dist, // TODO(robertshield): Temporary hack to make the kRegisterChromeBrowserSuffix // apply to all registry values computed down in these murky depths. - CommandLine& command_line = *CommandLine::ForCurrentProcess(); + base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); if (command_line.HasSwitch( installer::switches::kRegisterChromeBrowserSuffix)) { suffix = command_line.GetSwitchValueNative( @@ -2155,7 +2156,7 @@ bool ShellUtil::RegisterChromeBrowser(BrowserDistribution* dist, return false; } - CommandLine& command_line = *CommandLine::ForCurrentProcess(); + base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); base::string16 suffix; if (!unique_suffix.empty()) { diff --git a/chrome/installer/util/user_experiment.cc b/chrome/installer/util/user_experiment.cc index 2b646c1..b6a09894 100644 --- a/chrome/installer/util/user_experiment.cc +++ b/chrome/installer/util/user_experiment.cc @@ -111,8 +111,9 @@ int GetUserDataDirectoryWriteAgeInHours() { // If handle to experiment result key was given at startup, re-add it. // Does not wait for the process to terminate. // |cmd_line| may be modified as a result of this call. -bool LaunchSetup(CommandLine* cmd_line, bool system_level_toast) { - const CommandLine& current_cmd_line = *CommandLine::ForCurrentProcess(); +bool LaunchSetup(base::CommandLine* cmd_line, bool system_level_toast) { + const base::CommandLine& current_cmd_line = + *base::CommandLine::ForCurrentProcess(); // Propagate --verbose-logging to the invoked setup.exe. if (current_cmd_line.HasSwitch(switches::kVerboseLogging)) @@ -202,13 +203,14 @@ bool FixDACLsForExecute(const base::FilePath& exe) { // the computer is on but nobody has logged in locally. // Remote Desktop sessions do not count as interactive sessions; running this // method as a user logged in via remote desktop will do nothing. -bool LaunchSetupAsConsoleUser(CommandLine* cmd_line) { +bool LaunchSetupAsConsoleUser(base::CommandLine* cmd_line) { // Convey to the invoked setup.exe that it's operating on a system-level // installation. cmd_line->AppendSwitch(switches::kSystemLevel); // Propagate --verbose-logging to the invoked setup.exe. - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kVerboseLogging)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kVerboseLogging)) cmd_line->AppendSwitch(switches::kVerboseLogging); // Get the Google Update results key, and pass it on the command line to @@ -258,7 +260,7 @@ void SetClient(const base::string16& experiment_group, bool last_write) { // If a specific Toast Results key handle (presumably to our HKLM key) was // passed in to the command line (such as for system level installs), we use // it. Otherwise, we write to the key under HKCU. - const CommandLine& cmd_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& cmd_line = *base::CommandLine::ForCurrentProcess(); if (cmd_line.HasSwitch(switches::kToastResultsKey)) { // Get the handle to the key under HKLM. base::StringToInt( @@ -391,12 +393,12 @@ bool CreateExperimentDetails(int flavor, ExperimentDetails* experiment) { // 2- Is a system-install and it updated : relaunch as the interactive user // 3- It has been re-launched from the #2 case. In this case we enter // this function with |system_install| true and a REENTRY_SYS_UPDATE status. -void LaunchBrowserUserExperiment(const CommandLine& base_cmd_line, +void LaunchBrowserUserExperiment(const base::CommandLine& base_cmd_line, InstallStatus status, bool system_level) { if (system_level) { if (NEW_VERSION_UPDATED == status) { - CommandLine cmd_line(base_cmd_line); + base::CommandLine cmd_line(base_cmd_line); cmd_line.AppendSwitch(switches::kSystemLevelToast); // We need to relaunch as the interactive user. LaunchSetupAsConsoleUser(&cmd_line); @@ -470,7 +472,7 @@ void LaunchBrowserUserExperiment(const CommandLine& base_cmd_line, // because google_update expects the upgrade process to be quick and nimble. // System level: We have already been relaunched, so we don't need to be // quick, but we relaunch to follow the exact same codepath. - CommandLine cmd_line(base_cmd_line); + base::CommandLine cmd_line(base_cmd_line); cmd_line.AppendSwitchASCII(switches::kInactiveUserToast, base::IntToString(flavor)); cmd_line.AppendSwitchASCII(switches::kExperimentGroup, @@ -485,7 +487,7 @@ void InactiveUserToastExperiment(int flavor, const Product& product, const base::FilePath& application_path) { // Add the 'welcome back' url for chrome to show. - CommandLine options(CommandLine::NO_PROGRAM); + base::CommandLine options(base::CommandLine::NO_PROGRAM); options.AppendSwitchNative(::switches::kTryChromeAgain, base::IntToString16(flavor)); // Prepend the url with a space. @@ -525,11 +527,11 @@ void InactiveUserToastExperiment(int flavor, // The user wants to uninstall. This is a best effort operation. Note that // we waited for chrome to exit so the uninstall would not detect chrome // running. - bool system_level_toast = CommandLine::ForCurrentProcess()->HasSwitch( + bool system_level_toast = base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kSystemLevelToast); - CommandLine cmd(InstallUtil::GetChromeUninstallCmd( - system_level_toast, product.distribution()->GetType())); + base::CommandLine cmd(InstallUtil::GetChromeUninstallCmd( + system_level_toast, product.distribution()->GetType())); base::LaunchProcess(cmd, base::LaunchOptions()); } diff --git a/chrome/nacl/nacl_exe_win_64.cc b/chrome/nacl/nacl_exe_win_64.cc index 0f6b3a7..c7008fc 100644 --- a/chrome/nacl/nacl_exe_win_64.cc +++ b/chrome/nacl/nacl_exe_win_64.cc @@ -19,10 +19,10 @@ base::LazyInstance<chrome::ChromeCrashReporterClient>::Leaky int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) { base::AtExitManager exit_manager; - CommandLine::Init(0, NULL); + base::CommandLine::Init(0, NULL); std::string process_type = - CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kProcessType); crash_reporter::SetCrashReporterClient(g_chrome_crash_client.Pointer()); breakpad::InitCrashReporter(process_type); diff --git a/chrome/renderer/autofill/autofill_renderer_browsertest.cc b/chrome/renderer/autofill/autofill_renderer_browsertest.cc index 7ef6566..47d8066 100644 --- a/chrome/renderer/autofill/autofill_renderer_browsertest.cc +++ b/chrome/renderer/autofill/autofill_renderer_browsertest.cc @@ -307,7 +307,7 @@ class RequestAutocompleteRendererTest : public AutofillRendererTest { AutofillRendererTest::SetUp(); // Bypass the HTTPS-only restriction to show requestAutocomplete. - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); command_line->AppendSwitch(::switches::kReduceSecurityForTesting); GURL url("data:text/html;charset=utf-8," diff --git a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc index 2a0e8bb..477f307 100644 --- a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc +++ b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc @@ -1421,7 +1421,7 @@ TEST_F(PasswordAutofillAgentTest, CredentialsOnClick) { // FillOnAccountSelect is enabled. TEST_F(PasswordAutofillAgentTest, FillOnAccountSelectOnlyNoCredentialsOnPasswordClick) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( autofill::switches::kEnableFillOnAccountSelect); // Simulate the browser sending back the login info. @@ -1451,7 +1451,7 @@ TEST_F(PasswordAutofillAgentTest, // suggested. TEST_F(PasswordAutofillAgentTest, FillOnAccountSelectOnlyCredentialsOnPasswordClick) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( autofill::switches::kEnableFillOnAccountSelect); // Simulate the browser sending back the login info. @@ -1673,7 +1673,7 @@ TEST_F(PasswordAutofillAgentTest, FormFillDataMustHaveUsername) { } TEST_F(PasswordAutofillAgentTest, FillOnAccountSelectOnly) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( autofill::switches::kEnableFillOnAccountSelect); ClearUsernameAndPasswordFields(); @@ -1685,7 +1685,7 @@ TEST_F(PasswordAutofillAgentTest, FillOnAccountSelectOnly) { } TEST_F(PasswordAutofillAgentTest, FillOnAccountSelectOnlyReadonlyUsername) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( autofill::switches::kEnableFillOnAccountSelect); ClearUsernameAndPasswordFields(); @@ -1700,7 +1700,7 @@ TEST_F(PasswordAutofillAgentTest, FillOnAccountSelectOnlyReadonlyUsername) { } TEST_F(PasswordAutofillAgentTest, FillOnAccountSelectOnlyNoUsername) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( autofill::switches::kEnableFillOnAccountSelect); // Load a form with no username and update test data. diff --git a/chrome/renderer/benchmarking_extension.cc b/chrome/renderer/benchmarking_extension.cc index f7fe37d..555de01 100644 --- a/chrome/renderer/benchmarking_extension.cc +++ b/chrome/renderer/benchmarking_extension.cc @@ -113,8 +113,8 @@ class BenchmarkingWrapper : public v8::Extension { } static void IsSingleProcess(const v8::FunctionCallbackInfo<v8::Value>& args) { - args.GetReturnValue().Set( - CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)); + args.GetReturnValue().Set(base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kSingleProcess)); } static void HiResTime(const v8::FunctionCallbackInfo<v8::Value>& args) { diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc index 79bc401..48f26e1 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc @@ -352,7 +352,7 @@ void ChromeContentRendererClient::RenderThreadStarted() { thread->RegisterExtension(extensions_v8::ExternalExtension::Get()); thread->RegisterExtension(extensions_v8::LoadTimesExtension::Get()); - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kEnableBenchmarking)) thread->RegisterExtension(extensions_v8::BenchmarkingExtension::Get()); if (command_line->HasSwitch(switches::kEnableNetBenchmarking)) @@ -446,7 +446,8 @@ void ChromeContentRendererClient::RenderFrameCreated( new ChromeRenderFrameObserver(render_frame); bool should_whitelist_for_content_settings = - CommandLine::ForCurrentProcess()->HasSwitch(switches::kInstantProcess); + base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kInstantProcess); extensions::Dispatcher* ext_dispatcher = NULL; #if defined(ENABLE_EXTENSIONS) ext_dispatcher = extension_dispatcher_.get(); @@ -516,7 +517,7 @@ void ChromeContentRendererClient::RenderViewCreated( safe_browsing::MalwareDOMDetails::Create(render_view); #endif - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kInstantProcess)) new SearchBox(render_view); @@ -736,7 +737,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( bool is_nacl_unrestricted = false; if (is_nacl_mime_type) { is_nacl_unrestricted = - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableNaCl); } else if (is_pnacl_mime_type) { is_nacl_unrestricted = true; @@ -1181,7 +1182,8 @@ bool ChromeContentRendererClient::ShouldFork(WebFrame* frame, // process if it is an Instant url, or to another process if not. Conversely, // fork if this is a non-Instant process navigating to an Instant url, so that // such navigations can also be bucketed into an Instant renderer. - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInstantProcess) || + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kInstantProcess) || (search_bouncer_.get() && search_bouncer_->ShouldFork(url))) { *send_referrer = true; return true; @@ -1197,7 +1199,8 @@ bool ChromeContentRendererClient::ShouldFork(WebFrame* frame, // If this is the Signin process, fork all navigations originating from the // renderer. The destination page will then be bucketed back to this Signin // process if it is a Signin url, or to another process if not. - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSigninProcess)) { + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kSigninProcess)) { // We never want to allow non-signin pages to fork-on-POST to a // signin-related action URL. We'll need to handle this carefully once // http://crbug.com/101395 is fixed. The CHECK ensures we don't forget. @@ -1470,7 +1473,7 @@ bool ChromeContentRendererClient::AllowPepperMediaStreamAPI( return true; } // Allow access for tests. - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnablePepperTesting)) { return true; } @@ -1499,7 +1502,7 @@ bool ChromeContentRendererClient::ShouldEnableSiteIsolationPolicy() const { // SiteIsolationPolicy for a renderer process that does not have the extension // flag on. #if defined(ENABLE_EXTENSIONS) - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); return !command_line->HasSwitch(extensions::switches::kExtensionProcess); #else return true; @@ -1516,7 +1519,7 @@ ChromeContentRendererClient::CreateWorkerPermissionClientProxy( bool ChromeContentRendererClient::IsPluginAllowedToUseDevChannelAPIs() { #if defined(ENABLE_PLUGINS) // Allow access for tests. - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnablePepperTesting)) { return true; } @@ -1534,7 +1537,7 @@ bool ChromeContentRendererClient::IsPluginAllowedToUseDevChannelAPIs() { bool ChromeContentRendererClient::IsPluginAllowedToUseCompositorAPI( const GURL& url) { #if defined(ENABLE_PLUGINS) && defined(ENABLE_EXTENSIONS) - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnablePepperTesting)) return true; if (IsExtensionOrSharedModuleWhitelisted(url, allowed_compositor_origins_)) @@ -1550,7 +1553,7 @@ bool ChromeContentRendererClient::IsPluginAllowedToUseCompositorAPI( bool ChromeContentRendererClient::IsPluginAllowedToUseVideoDecodeAPI( const GURL& url) { #if defined(ENABLE_PLUGINS) && defined(ENABLE_EXTENSIONS) - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnablePepperTesting)) return true; diff --git a/chrome/renderer/chrome_content_renderer_client_browsertest.cc b/chrome/renderer/chrome_content_renderer_client_browsertest.cc index 2b2a2de..fbaba81 100644 --- a/chrome/renderer/chrome_content_renderer_client_browsertest.cc +++ b/chrome/renderer/chrome_content_renderer_client_browsertest.cc @@ -37,7 +37,8 @@ typedef ChromeRenderViewTest InstantProcessNavigationTest; // bounced back to the browser to be rebucketed into a non-Instant renderer if // necessary. TEST_F(InstantProcessNavigationTest, ForkForNavigationsFromInstantProcess) { - CommandLine::ForCurrentProcess()->AppendSwitch(switches::kInstantProcess); + base::CommandLine::ForCurrentProcess()->AppendSwitch( + switches::kInstantProcess); bool unused; ChromeContentRendererClient* client = static_cast<ChromeContentRendererClient*>(content_renderer_client_.get()); diff --git a/chrome/renderer/chrome_render_process_observer.cc b/chrome/renderer/chrome_render_process_observer.cc index a648bef..2e8d4ee 100644 --- a/chrome/renderer/chrome_render_process_observer.cc +++ b/chrome/renderer/chrome_render_process_observer.cc @@ -253,7 +253,8 @@ ChromeRenderProcessObserver::ChromeRenderProcessObserver( ChromeContentRendererClient* client) : client_(client), webkit_initialized_(false) { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); #if defined(ENABLE_AUTOFILL_DIALOG) WebRuntimeFeatures::enableRequestAutocomplete(true); diff --git a/chrome/renderer/chrome_render_view_observer.cc b/chrome/renderer/chrome_render_view_observer.cc index 541115d..63749ae 100644 --- a/chrome/renderer/chrome_render_view_observer.cc +++ b/chrome/renderer/chrome_render_view_observer.cc @@ -167,7 +167,8 @@ ChromeRenderViewObserver::ChromeRenderViewObserver( extensions::kExtensionScheme)), phishing_classifier_(NULL), capture_timer_(false, false) { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (!command_line.HasSwitch(switches::kDisableClientSidePhishingDetection)) OnSetClientSidePhishingDetection(true); } diff --git a/chrome/renderer/extensions/app_bindings.cc b/chrome/renderer/extensions/app_bindings.cc index ccbd2e8..c13d741 100644 --- a/chrome/renderer/extensions/app_bindings.cc +++ b/chrome/renderer/extensions/app_bindings.cc @@ -34,7 +34,7 @@ namespace { bool IsCheckoutURL(const std::string& url_spec) { std::string checkout_url_prefix = - CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kAppsCheckoutURL); if (checkout_url_prefix.empty()) checkout_url_prefix = "https://checkout.google.com/"; diff --git a/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc b/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc index 602aab7..8625523 100644 --- a/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc +++ b/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc @@ -246,7 +246,7 @@ void ChromeExtensionsDispatcherDelegate::RequireAdditionalModules( if (context_type == extensions::Feature::BLESSED_EXTENSION_CONTEXT && is_within_platform_app && extensions::GetCurrentChannel() <= chrome::VersionInfo::CHANNEL_DEV && - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( extensions::switches::kEnableAppWindowControls)) { module_system->Require("windowControls"); } @@ -269,7 +269,8 @@ void ChromeExtensionsDispatcherDelegate::RequireAdditionalModules( void ChromeExtensionsDispatcherDelegate::OnActiveExtensionsUpdated( const std::set<std::string>& extension_ids) { // In single-process mode, the browser process reports the active extensions. - if (CommandLine::ForCurrentProcess()->HasSwitch(::switches::kSingleProcess)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + ::switches::kSingleProcess)) return; crash_keys::SetActiveExtensions(extension_ids); } diff --git a/chrome/renderer/extensions/renderer_permissions_policy_delegate_unittest.cc b/chrome/renderer/extensions/renderer_permissions_policy_delegate_unittest.cc index 783fa13..c71ccb8 100644 --- a/chrome/renderer/extensions/renderer_permissions_policy_delegate_unittest.cc +++ b/chrome/renderer/extensions/renderer_permissions_policy_delegate_unittest.cc @@ -73,7 +73,8 @@ TEST_F(RendererPermissionsPolicyDelegateTest, CannotScriptSigninProcess) { << error; // Pretend we are in the signin process. We should not be able to execute // script. - CommandLine::ForCurrentProcess()->AppendSwitch(switches::kSigninProcess); + base::CommandLine::ForCurrentProcess()->AppendSwitch( + switches::kSigninProcess); EXPECT_FALSE(extension->permissions_data()->CanAccessPage( extension.get(), kSigninUrl, kSigninUrl, -1, -1, &error)) << error; diff --git a/chrome/renderer/net/net_error_helper.cc b/chrome/renderer/net/net_error_helper.cc index be5b4d1..ba6de47 100644 --- a/chrome/renderer/net/net_error_helper.cc +++ b/chrome/renderer/net/net_error_helper.cc @@ -77,7 +77,7 @@ NetErrorHelper::NetErrorHelper(RenderFrame* render_frame) : RenderFrameObserver(render_frame), content::RenderFrameObserverTracker<NetErrorHelper>(render_frame) { RenderThread::Get()->AddObserver(this); - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); bool auto_reload_enabled = command_line->HasSwitch(switches::kEnableOfflineAutoReload); bool auto_reload_visible_only = @@ -180,7 +180,7 @@ void NetErrorHelper::GenerateLocalizedErrorPage( if (template_html.empty()) { NOTREACHED() << "unable to load template."; } else { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); bool load_stale_cache_enabled = command_line->HasSwitch(switches::kEnableOfflineLoadStaleCache); @@ -216,7 +216,7 @@ void NetErrorHelper::EnablePageHelperFunctions() { void NetErrorHelper::UpdateErrorPage(const blink::WebURLError& error, bool is_failed_post) { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); bool load_stale_cache_enabled = command_line->HasSwitch(switches::kEnableOfflineLoadStaleCache); diff --git a/chrome/renderer/printing/print_web_view_helper.cc b/chrome/renderer/printing/print_web_view_helper.cc index d50f076..28d4bd6 100644 --- a/chrome/renderer/printing/print_web_view_helper.cc +++ b/chrome/renderer/printing/print_web_view_helper.cc @@ -803,7 +803,7 @@ PrintWebViewHelper::PrintWebViewHelper(content::RenderView* render_view) is_loading_(false), is_scripted_preview_delayed_(false), weak_ptr_factory_(this) { - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisablePrintPreview)) { DisablePreview(); } diff --git a/chrome/renderer/safe_browsing/phishing_classifier_browsertest.cc b/chrome/renderer/safe_browsing/phishing_classifier_browsertest.cc index 949d548..6c17a9c 100644 --- a/chrome/renderer/safe_browsing/phishing_classifier_browsertest.cc +++ b/chrome/renderer/safe_browsing/phishing_classifier_browsertest.cc @@ -51,7 +51,7 @@ class PhishingClassifierTest : public InProcessBrowserTest { page_term_login_(features::kPageTerm + std::string("login")) { } - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kSingleProcess); #if defined(OS_WIN) // Don't want to try to create a GPU process. diff --git a/chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc b/chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc index f015560..85dc9b5 100644 --- a/chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc +++ b/chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc @@ -141,7 +141,7 @@ class PhishingClassifierDelegateTest : public InProcessBrowserTest { } protected: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kSingleProcess); #if defined(OS_WIN) // Don't want to try to create a GPU process. diff --git a/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc b/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc index c71ef5f..04aac8a 100644 --- a/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc +++ b/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc @@ -73,7 +73,7 @@ class PhishingDOMFeatureExtractorTest : public InProcessBrowserTest { ~PhishingDOMFeatureExtractorTest() override {} - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kSingleProcess); #if defined(OS_WIN) // Don't want to try to create a GPU process. diff --git a/chrome/renderer/spellchecker/spellcheck_provider.cc b/chrome/renderer/spellchecker/spellcheck_provider.cc index 2775a1c..8afc7fa 100644 --- a/chrome/renderer/spellchecker/spellcheck_provider.cc +++ b/chrome/renderer/spellchecker/spellcheck_provider.cc @@ -178,7 +178,8 @@ void SpellCheckProvider::requestCheckingOfText( } WebString SpellCheckProvider::autoCorrectWord(const WebString& word) { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (command_line.HasSwitch(switches::kEnableSpellingAutoCorrect)) { UMA_HISTOGRAM_COUNTS("SpellCheck.api.autocorrect", word.length()); return spellcheck_->GetAutoCorrectionWord(word, routing_id()); diff --git a/chrome/renderer/web_apps.cc b/chrome/renderer/web_apps.cc index 636d407..e684a70 100644 --- a/chrome/renderer/web_apps.cc +++ b/chrome/renderer/web_apps.cc @@ -147,10 +147,10 @@ void ParseWebAppFromWebDocument(WebFrame* frame, // "apple-touch-icon-precomposed". if (LowerCaseEqualsASCII(rel, "icon") || LowerCaseEqualsASCII(rel, "shortcut icon") || - (!CommandLine::ForCurrentProcess()-> - HasSwitch(switches::kDisableNewBookmarkApps) && - (LowerCaseEqualsASCII(rel, "apple-touch-icon") || - LowerCaseEqualsASCII(rel, "apple-touch-icon-precomposed")))) { + (!base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableNewBookmarkApps) && + (LowerCaseEqualsASCII(rel, "apple-touch-icon") || + LowerCaseEqualsASCII(rel, "apple-touch-icon-precomposed")))) { AddInstallIcon(elem, &app_info->icons); } } else if (elem.hasHTMLTagName("meta") && elem.hasAttribute("name")) { diff --git a/chrome/service/cloud_print/cloud_print_proxy.cc b/chrome/service/cloud_print/cloud_print_proxy.cc index 812e824..60dbb87 100644 --- a/chrome/service/cloud_print/cloud_print_proxy.cc +++ b/chrome/service/cloud_print/cloud_print_proxy.cc @@ -32,9 +32,10 @@ void LaunchBrowserProcessWithSwitch(const std::string& switch_string) { if (exe_path.empty()) { NOTREACHED() << "Unable to get browser process binary name."; } - CommandLine cmd_line(exe_path); + base::CommandLine cmd_line(exe_path); - const CommandLine& process_command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& process_command_line = + *base::CommandLine::ForCurrentProcess(); base::FilePath user_data_dir = process_command_line.GetSwitchValuePath(switches::kUserDataDir); if (!user_data_dir.empty()) @@ -234,7 +235,7 @@ void CloudPrintProxy::OnAuthenticated( service_prefs_->WritePrefs(); // When this switch used we don't want connector continue running, we just // need authentication. - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kCloudPrintSetupProxy)) { ShutdownBackend(); if (client_) { diff --git a/chrome/service/cloud_print/cloud_print_proxy_backend.cc b/chrome/service/cloud_print/cloud_print_proxy_backend.cc index f364a13..233ff2e 100644 --- a/chrome/service/cloud_print/cloud_print_proxy_backend.cc +++ b/chrome/service/cloud_print/cloud_print_proxy_backend.cc @@ -340,7 +340,7 @@ void CloudPrintProxyBackend::Core::InitNotifications( notifier_options.auth_mechanism = "X-OAUTH2"; notifier_options.try_ssltcp_first = true; notifier_options.xmpp_host_port = net::HostPortPair::FromString( - CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kCloudPrintXmppEndpoint)); push_client_ = notifier::PushClient::CreateDefault(notifier_options); push_client_->AddObserver(this); diff --git a/chrome/service/cloud_print/print_system_win.cc b/chrome/service/cloud_print/print_system_win.cc index ed304c76..2d78735 100644 --- a/chrome/service/cloud_print/print_system_win.cc +++ b/chrome/service/cloud_print/print_system_win.cc @@ -661,7 +661,7 @@ PrintSystemWin::PrintSystemWin() : use_cdd_(true) { } PrintSystem::PrintSystemResult PrintSystemWin::Init() { - use_cdd_ = !CommandLine::ForCurrentProcess()->HasSwitch( + use_cdd_ = !base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableCloudPrintXps); if (!use_cdd_) diff --git a/chrome/service/service_process.cc b/chrome/service/service_process.cc index da6c823..5c0f8d3 100644 --- a/chrome/service/service_process.cc +++ b/chrome/service/service_process.cc @@ -79,7 +79,7 @@ void ServiceIOThread::CleanUp() { // environment block so they are accessible in the early stages of the // chrome executable's lifetime. void PrepareRestartOnCrashEnviroment( - const CommandLine &parsed_command_line) { + const base::CommandLine& parsed_command_line) { scoped_ptr<base::Environment> env(base::Environment::Create()); // Clear this var so child processes don't show the dialog by default. env->UnSetVar(env_vars::kShowRestart); @@ -123,7 +123,7 @@ ServiceProcess::ServiceProcess() } bool ServiceProcess::Initialize(base::MessageLoopForUI* message_loop, - const CommandLine& command_line, + const base::CommandLine& command_line, ServiceProcessState* state) { #if defined(USE_GLIB) // g_type_init has been deprecated since version 2.35. @@ -309,7 +309,7 @@ ServiceProcess::GetServiceURLRequestContextGetter() { void ServiceProcess::OnServiceEnabled() { enabled_services_++; if ((1 == enabled_services_) && - !CommandLine::ForCurrentProcess()->HasSwitch( + !base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kNoServiceAutorun)) { if (!service_process_state_->AddToAutoRun()) { // TODO(scottbyer/sanjeevr/dmaclach): Handle error condition diff --git a/chrome/service/service_process_unittest.cc b/chrome/service/service_process_unittest.cc index de4f6a8..f4f592a 100644 --- a/chrome/service/service_process_unittest.cc +++ b/chrome/service/service_process_unittest.cc @@ -18,7 +18,7 @@ TEST(ServiceProcessTest, DISABLED_Run) { base::MessageLoopForUI main_message_loop; ServiceProcess process; ServiceProcessState state; - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); EXPECT_TRUE(process.Initialize(&main_message_loop, command_line, &state)); EXPECT_TRUE(process.Teardown()); } diff --git a/chrome/test/base/chrome_process_util_mac.cc b/chrome/test/base/chrome_process_util_mac.cc index 431fb65..a4bf316 100644 --- a/chrome/test/base/chrome_process_util_mac.cc +++ b/chrome/test/base/chrome_process_util_mac.cc @@ -33,7 +33,7 @@ MacChromeProcessInfoList GetRunningMacProcessInfo( // Invoke it std::string ps_output; - if (!base::GetAppOutput(CommandLine(cmdline), &ps_output)) + if (!base::GetAppOutput(base::CommandLine(cmdline), &ps_output)) return result; // All the pids might have exited // Process the results diff --git a/chrome/test/base/chrome_test_launcher.cc b/chrome/test/base/chrome_test_launcher.cc index e4c70f0..3cbe4a1 100644 --- a/chrome/test/base/chrome_test_launcher.cc +++ b/chrome/test/base/chrome_test_launcher.cc @@ -57,15 +57,15 @@ class ChromeTestLauncherDelegate : public content::TestLauncherDelegate { } bool AdjustChildProcessCommandLine( - CommandLine* command_line, + base::CommandLine* command_line, const base::FilePath& temp_data_dir) override { - CommandLine new_command_line(command_line->GetProgram()); - CommandLine::SwitchMap switches = command_line->GetSwitches(); + base::CommandLine new_command_line(command_line->GetProgram()); + base::CommandLine::SwitchMap switches = command_line->GetSwitches(); // Strip out user-data-dir if present. We will add it back in again later. switches.erase(switches::kUserDataDir); - for (CommandLine::SwitchMap::const_iterator iter = switches.begin(); + for (base::CommandLine::SwitchMap::const_iterator iter = switches.begin(); iter != switches.end(); ++iter) { new_command_line.AppendSwitchNative((*iter).first, (*iter).second); } @@ -86,7 +86,7 @@ class ChromeTestLauncherDelegate : public content::TestLauncherDelegate { void AdjustDefaultParallelJobs(int* default_jobs) override { #if defined(OS_WIN) - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kAshBrowserTests)) { *default_jobs = 1; fprintf(stdout, diff --git a/chrome/test/base/in_process_browser_test.cc b/chrome/test/base/in_process_browser_test.cc index e6dbc70..5b01038e 100644 --- a/chrome/test/base/in_process_browser_test.cc +++ b/chrome/test/base/in_process_browser_test.cc @@ -153,7 +153,7 @@ void InProcessBrowserTest::SetUp() { // Browser tests will create their own g_browser_process later. DCHECK(!g_browser_process); - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); // Auto-reload breaks many browser tests, which assume error pages won't be // reloaded out from under them. Tests that expect or desire this behavior can @@ -205,7 +205,8 @@ void InProcessBrowserTest::SetUp() { // Although Ash officially is only supported for users on Win7+, we still run // ash_unittests on Vista builders, so we still need to initialize COM. if (version >= base::win::VERSION_VISTA && - CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) { + base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) { com_initializer_.reset(new base::win::ScopedCOMInitializer()); ui::win::CreateATLModuleIfNeeded(); if (version >= base::win::VERSION_WIN8) @@ -216,7 +217,8 @@ void InProcessBrowserTest::SetUp() { BrowserTestBase::SetUp(); } -void InProcessBrowserTest::PrepareTestCommandLine(CommandLine* command_line) { +void InProcessBrowserTest::PrepareTestCommandLine( + base::CommandLine* command_line) { // Propagate commandline settings from test_launcher_utils. test_launcher_utils::PrepareBrowserCommandLineForTests(command_line); @@ -259,7 +261,7 @@ void InProcessBrowserTest::PrepareTestCommandLine(CommandLine* command_line) { } bool InProcessBrowserTest::CreateUserDataDirectory() { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); base::FilePath user_data_dir = command_line->GetSwitchValuePath(switches::kUserDataDir); if (user_data_dir.empty()) { @@ -364,10 +366,11 @@ void InProcessBrowserTest::AddBlankTabAndShow(Browser* browser) { } #if !defined(OS_MACOSX) -CommandLine InProcessBrowserTest::GetCommandLineForRelaunch() { - CommandLine new_command_line(CommandLine::ForCurrentProcess()->GetProgram()); - CommandLine::SwitchMap switches = - CommandLine::ForCurrentProcess()->GetSwitches(); +base::CommandLine InProcessBrowserTest::GetCommandLineForRelaunch() { + base::CommandLine new_command_line( + base::CommandLine::ForCurrentProcess()->GetProgram()); + base::CommandLine::SwitchMap switches = + base::CommandLine::ForCurrentProcess()->GetSwitches(); switches.erase(switches::kUserDataDir); switches.erase(content::kSingleProcessTestsFlag); switches.erase(switches::kSingleProcess); @@ -377,8 +380,8 @@ CommandLine InProcessBrowserTest::GetCommandLineForRelaunch() { PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); new_command_line.AppendSwitchPath(switches::kUserDataDir, user_data_dir); - for (CommandLine::SwitchMap::const_iterator iter = switches.begin(); - iter != switches.end(); ++iter) { + for (base::CommandLine::SwitchMap::const_iterator iter = switches.begin(); + iter != switches.end(); ++iter) { new_command_line.AppendSwitchNative((*iter).first, (*iter).second); } return new_command_line; diff --git a/chrome/test/base/test_launcher_utils.cc b/chrome/test/base/test_launcher_utils.cc index a856173..bfc9d2b 100644 --- a/chrome/test/base/test_launcher_utils.cc +++ b/chrome/test/base/test_launcher_utils.cc @@ -20,7 +20,7 @@ namespace test_launcher_utils { -void PrepareBrowserCommandLineForTests(CommandLine* command_line) { +void PrepareBrowserCommandLineForTests(base::CommandLine* command_line) { // Turn off tip loading for tests; see http://crbug.com/17725. command_line->AppendSwitch(switches::kDisableWebResources); diff --git a/chrome/test/base/ui_test_utils.cc b/chrome/test/base/ui_test_utils.cc index d98cd4b..0d8dbf6 100644 --- a/chrome/test/base/ui_test_utils.cc +++ b/chrome/test/base/ui_test_utils.cc @@ -275,7 +275,7 @@ bool GetRelativeBuildDirectory(base::FilePath* build_dir) { // built files (nexes, etc). TestServer expects a path relative to the source // root. base::FilePath exe_dir = - CommandLine::ForCurrentProcess()->GetProgram().DirName(); + base::CommandLine::ForCurrentProcess()->GetProgram().DirName(); base::FilePath src_dir; if (!PathService::Get(base::DIR_SOURCE_ROOT, &src_dir)) return false; diff --git a/chrome/test/chromedriver/capabilities.cc b/chrome/test/chromedriver/capabilities.cc index 548b951..bde4eb7 100644 --- a/chrome/test/chromedriver/capabilities.cc +++ b/chrome/test/chromedriver/capabilities.cc @@ -203,7 +203,7 @@ Status ParseProxy(const base::Value& option, Capabilities* capabilities) { } else if (proxy_type == "system") { // Chrome default. } else if (proxy_type == "pac") { - CommandLine::StringType proxy_pac_url; + base::CommandLine::StringType proxy_pac_url; if (!proxy_dict->GetString("proxyAutoconfigUrl", &proxy_pac_url)) return Status(kUnknownError, "'proxyAutoconfigUrl' must be a string"); capabilities->switches.SetSwitch("proxy-pac-url", proxy_pac_url); @@ -506,7 +506,7 @@ size_t Switches::GetSize() const { return switch_map_.size(); } -void Switches::AppendToCommandLine(CommandLine* command) const { +void Switches::AppendToCommandLine(base::CommandLine* command) const { for (SwitchMap::const_iterator iter = switch_map_.begin(); iter != switch_map_.end(); ++iter) { diff --git a/chrome/test/chromedriver/capabilities_unittest.cc b/chrome/test/chromedriver/capabilities_unittest.cc index b538b9b..61f467b 100644 --- a/chrome/test/chromedriver/capabilities_unittest.cc +++ b/chrome/test/chromedriver/capabilities_unittest.cc @@ -12,7 +12,7 @@ TEST(Switches, Empty) { Switches switches; - CommandLine cmd(CommandLine::NO_PROGRAM); + base::CommandLine cmd(base::CommandLine::NO_PROGRAM); switches.AppendToCommandLine(&cmd); ASSERT_EQ(0u, cmd.GetSwitches().size()); ASSERT_EQ("", switches.ToString()); @@ -25,7 +25,7 @@ TEST(Switches, NoValue) { ASSERT_TRUE(switches.HasSwitch("hello")); ASSERT_EQ("", switches.GetSwitchValue("hello")); - CommandLine cmd(CommandLine::NO_PROGRAM); + base::CommandLine cmd(base::CommandLine::NO_PROGRAM); switches.AppendToCommandLine(&cmd); ASSERT_TRUE(cmd.HasSwitch("hello")); ASSERT_EQ(FILE_PATH_LITERAL(""), cmd.GetSwitchValueNative("hello")); @@ -39,7 +39,7 @@ TEST(Switches, Value) { ASSERT_TRUE(switches.HasSwitch("hello")); ASSERT_EQ("there", switches.GetSwitchValue("hello")); - CommandLine cmd(CommandLine::NO_PROGRAM); + base::CommandLine cmd(base::CommandLine::NO_PROGRAM); switches.AppendToCommandLine(&cmd); ASSERT_TRUE(cmd.HasSwitch("hello")); ASSERT_EQ(FILE_PATH_LITERAL("there"), cmd.GetSwitchValueNative("hello")); @@ -79,7 +79,7 @@ TEST(Switches, Multiple) { switches.SetSwitch("switch"); switches.SetSwitch("hello", "there"); - CommandLine cmd(CommandLine::NO_PROGRAM); + base::CommandLine cmd(base::CommandLine::NO_PROGRAM); switches.AppendToCommandLine(&cmd); ASSERT_TRUE(cmd.HasSwitch("switch")); ASSERT_TRUE(cmd.HasSwitch("hello")); diff --git a/chrome/test/chromedriver/chrome/chrome_desktop_impl.cc b/chrome/test/chromedriver/chrome/chrome_desktop_impl.cc index d3b4bd2..0746865 100644 --- a/chrome/test/chromedriver/chrome/chrome_desktop_impl.cc +++ b/chrome/test/chromedriver/chrome/chrome_desktop_impl.cc @@ -67,7 +67,7 @@ ChromeDesktopImpl::ChromeDesktopImpl( ScopedVector<DevToolsEventListener>& devtools_event_listeners, scoped_ptr<PortReservation> port_reservation, base::Process process, - const CommandLine& command, + const base::CommandLine& command, base::ScopedTempDir* user_data_dir, base::ScopedTempDir* extension_dir) : ChromeImpl(http_client.Pass(), @@ -173,6 +173,6 @@ Status ChromeDesktopImpl::QuitImpl() { return Status(kOk); } -const CommandLine& ChromeDesktopImpl::command() const { +const base::CommandLine& ChromeDesktopImpl::command() const { return command_; } diff --git a/chrome/test/chromedriver/chrome_launcher.cc b/chrome/test/chromedriver/chrome_launcher.cc index 825ab0c..03a5e1f 100644 --- a/chrome/test/chromedriver/chrome_launcher.cc +++ b/chrome/test/chromedriver/chrome_launcher.cc @@ -87,7 +87,7 @@ Status UnpackAutomationExtension(const base::FilePath& temp_dir, Status PrepareCommandLine(uint16 port, const Capabilities& capabilities, - CommandLine* prepared_command, + base::CommandLine* prepared_command, base::ScopedTempDir* user_data_dir, base::ScopedTempDir* extension_dir, std::vector<std::string>* extension_bg_pages) { @@ -100,7 +100,7 @@ Status PrepareCommandLine(uint16 port, base::StringPrintf("no chrome binary at %" PRFilePath, program.value().c_str())); } - CommandLine command(program); + base::CommandLine command(program); Switches switches; for (size_t i = 0; i < arraysize(kCommonSwitches); ++i) @@ -274,7 +274,7 @@ Status LaunchDesktopChrome( const Capabilities& capabilities, ScopedVector<DevToolsEventListener>* devtools_event_listeners, scoped_ptr<Chrome>* chrome) { - CommandLine command(CommandLine::NO_PROGRAM); + base::CommandLine command(base::CommandLine::NO_PROGRAM); base::ScopedTempDir user_data_dir; base::ScopedTempDir extension_dir; std::vector<std::string> extension_bg_pages; @@ -316,7 +316,7 @@ Status LaunchDesktopChrome( #if defined(OS_POSIX) base::FileHandleMappingVector no_stderr; base::ScopedFD devnull; - if (!CommandLine::ForCurrentProcess()->HasSwitch("verbose")) { + if (!base::CommandLine::ForCurrentProcess()->HasSwitch("verbose")) { // Redirect stderr to /dev/null, so that Chrome log spew doesn't confuse // users. devnull.reset(HANDLE_EINTR(open("/dev/null", O_WRONLY))); diff --git a/chrome/test/chromedriver/chrome_launcher_unittest.cc b/chrome/test/chromedriver/chrome_launcher_unittest.cc index 4e2c4df..3abf86c 100644 --- a/chrome/test/chromedriver/chrome_launcher_unittest.cc +++ b/chrome/test/chromedriver/chrome_launcher_unittest.cc @@ -122,9 +122,9 @@ TEST(ProcessExtensions, MultipleExtensionsNoBgPages) { false, &switches, &bg_pages); ASSERT_TRUE(status.IsOk()); ASSERT_TRUE(switches.HasSwitch("load-extension")); - CommandLine::StringType ext_paths = switches.GetSwitchValueNative( - "load-extension"); - std::vector<CommandLine::StringType> ext_path_list; + base::CommandLine::StringType ext_paths = + switches.GetSwitchValueNative("load-extension"); + std::vector<base::CommandLine::StringType> ext_path_list; base::SplitString(ext_paths, FILE_PATH_LITERAL(','), &ext_path_list); ASSERT_EQ(2u, ext_path_list.size()); ASSERT_TRUE(base::PathExists(base::FilePath(ext_path_list[0]))); diff --git a/chrome/test/chromedriver/logging.cc b/chrome/test/chromedriver/logging.cc index 240ac14..b6941a6 100644 --- a/chrome/test/chromedriver/logging.cc +++ b/chrome/test/chromedriver/logging.cc @@ -203,7 +203,7 @@ bool InitLogging() { InitLogging(&InternalIsVLogOn); g_start_time = base::TimeTicks::Now().ToInternalValue(); - CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); if (cmd_line->HasSwitch("log-path")) { g_log_level = Log::kInfo; base::FilePath log_path = cmd_line->GetSwitchValuePath("log-path"); diff --git a/chrome/test/chromedriver/server/chromedriver_server.cc b/chrome/test/chromedriver/server/chromedriver_server.cc index 26f105d..2d73020 100644 --- a/chrome/test/chromedriver/server/chromedriver_server.cc +++ b/chrome/test/chromedriver/server/chromedriver_server.cc @@ -206,10 +206,10 @@ void RunServer(uint16 port, } // namespace int main(int argc, char *argv[]) { - CommandLine::Init(argc, argv); + base::CommandLine::Init(argc, argv); base::AtExitManager at_exit; - CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); #if defined(OS_LINUX) // Select the locale from the environment by passing an empty string instead diff --git a/chrome/test/gpu/webgl_infobar_browsertest.cc b/chrome/test/gpu/webgl_infobar_browsertest.cc index 74fc80f..2992aa9 100644 --- a/chrome/test/gpu/webgl_infobar_browsertest.cc +++ b/chrome/test/gpu/webgl_infobar_browsertest.cc @@ -66,7 +66,8 @@ IN_PROC_BROWSER_TEST_F(WebGLInfoBarTest, DISABLED_ContextLossRaisesInfoBar) { #undef MAYBE_ContextLossRaisesInfoBard #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif @@ -98,7 +99,8 @@ IN_PROC_BROWSER_TEST_F(WebGLInfoBarTest, DISABLED_ContextLossRaisesInfoBar) { IN_PROC_BROWSER_TEST_F(WebGLInfoBarTest, DISABLED_ContextLossInfoBarReload) { #if defined(OS_WIN) && defined(USE_ASH) // Disable this test in Metro+Ash for now (http://crbug.com/262796). - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshBrowserTests)) return; #endif diff --git a/chrome/test/logging/win/test_log_collector.cc b/chrome/test/logging/win/test_log_collector.cc index 3587e6a..ec582a5 100644 --- a/chrome/test/logging/win/test_log_collector.cc +++ b/chrome/test/logging/win/test_log_collector.cc @@ -198,7 +198,7 @@ void TestLogCollector::Initialize(testing::UnitTest* unit_test) { listeners.Append( new EventListener(this, listeners.Release(default_result_printer))); - also_emit_success_logs_ = CommandLine::ForCurrentProcess()->HasSwitch( + also_emit_success_logs_ = base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kAlsoEmitSuccessLogs); unit_test_ = unit_test; diff --git a/chrome/test/nacl/nacl_browsertest.cc b/chrome/test/nacl/nacl_browsertest.cc index 605fdeb..7bda130 100644 --- a/chrome/test/nacl/nacl_browsertest.cc +++ b/chrome/test/nacl/nacl_browsertest.cc @@ -265,7 +265,7 @@ IN_PROC_BROWSER_TEST_F(NaClBrowserTestStatic, RelativeManifest) { // Test with the NaCl debug flag turned on. class NaClBrowserTestPnaclDebug : public NaClBrowserTestPnacl { public: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { NaClBrowserTestPnacl::SetUpCommandLine(command_line); // Turn on debugging to influence the PNaCl URL loaded command_line->AppendSwitch(switches::kEnableNaClDebug); @@ -296,7 +296,7 @@ class NaClBrowserTestPnaclDebug : public NaClBrowserTestPnacl { int debug_stub_port) { // We call a python script that speaks to the debug stub, and // lets the app continue, so that the load progress event completes. - CommandLine cmd(base::FilePath(FILE_PATH_LITERAL("python"))); + base::CommandLine cmd(base::FilePath(FILE_PATH_LITERAL("python"))); base::FilePath script; PathService::Get(chrome::DIR_TEST_DATA, &script); script = script.AppendASCII("nacl/debug_stub_browser_tests.py"); @@ -329,7 +329,7 @@ class NaClBrowserTestPnaclDebug : public NaClBrowserTestPnacl { // so that nothing is actually debugged. class NaClBrowserTestPnaclDebugMasked : public NaClBrowserTestPnaclDebug { public: - void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(base::CommandLine* command_line) override { NaClBrowserTestPnaclDebug::SetUpCommandLine(command_line); command_line->AppendSwitchASCII(switches::kNaClDebugMask, "!<all_urls>"); diff --git a/chrome/test/nacl/nacl_browsertest_util.cc b/chrome/test/nacl/nacl_browsertest_util.cc index a06f370..6248d8a 100644 --- a/chrome/test/nacl/nacl_browsertest_util.cc +++ b/chrome/test/nacl/nacl_browsertest_util.cc @@ -325,7 +325,7 @@ void NaClBrowserTestPnaclTransitionalNonSfi::SetUpCommandLine( } void NaClBrowserTestNewlibExtension::SetUpCommandLine( - CommandLine* command_line) { + base::CommandLine* command_line) { NaClBrowserTestBase::SetUpCommandLine(command_line); base::FilePath src_root; ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &src_root)); @@ -343,7 +343,7 @@ void NaClBrowserTestNewlibExtension::SetUpCommandLine( } void NaClBrowserTestGLibcExtension::SetUpCommandLine( - CommandLine* command_line) { + base::CommandLine* command_line) { NaClBrowserTestBase::SetUpCommandLine(command_line); base::FilePath src_root; ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &src_root)); diff --git a/chrome/test/perf/browser_perf_test.cc b/chrome/test/perf/browser_perf_test.cc index bd1ddf7..6e03a62 100644 --- a/chrome/test/perf/browser_perf_test.cc +++ b/chrome/test/perf/browser_perf_test.cc @@ -15,7 +15,7 @@ BrowserPerfTest::BrowserPerfTest() { BrowserPerfTest::~BrowserPerfTest() { } -void BrowserPerfTest::SetUpCommandLine(CommandLine* command_line) { +void BrowserPerfTest::SetUpCommandLine(base::CommandLine* command_line) { // Reduce performance test variance by disabling background networking. command_line->AppendSwitch(switches::kDisableBackgroundNetworking); } diff --git a/chrome/test/ppapi/ppapi_browsertest.cc b/chrome/test/ppapi/ppapi_browsertest.cc index 7e1b8e2..e7e3adb 100644 --- a/chrome/test/ppapi/ppapi_browsertest.cc +++ b/chrome/test/ppapi/ppapi_browsertest.cc @@ -1490,7 +1490,7 @@ class PackagedAppTest : public ExtensionBrowserTest { AppLaunchParams params(browser()->profile(), extension, extensions::LAUNCH_CONTAINER_NONE, NEW_WINDOW, extensions::SOURCE_TEST); - params.command_line = *CommandLine::ForCurrentProcess(); + params.command_line = *base::CommandLine::ForCurrentProcess(); OpenApplication(params); } diff --git a/chrome/test/remoting/remote_desktop_browsertest.cc b/chrome/test/remoting/remote_desktop_browsertest.cc index a053d5e3..a18778a 100644 --- a/chrome/test/remoting/remote_desktop_browsertest.cc +++ b/chrome/test/remoting/remote_desktop_browsertest.cc @@ -584,7 +584,7 @@ void RemoteDesktopBrowserTest::DisableDNSLookupForThisTest() { } void RemoteDesktopBrowserTest::ParseCommandLine() { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); // The test framework overrides any command line user-data-dir // argument with a /tmp/.org.chromium.Chromium.XXXXXX directory. @@ -603,7 +603,7 @@ void RemoteDesktopBrowserTest::ParseCommandLine() { override_user_data_dir); } - CommandLine::StringType accounts_file = + base::CommandLine::StringType accounts_file = command_line->GetSwitchValueNative(kAccountsFile); std::string account_type = command_line->GetSwitchValueASCII(kAccountType); if (!accounts_file.empty()) { diff --git a/chrome/tools/crash_service/main.cc b/chrome/tools/crash_service/main.cc index 7194f9e..94844ab 100644 --- a/chrome/tools/crash_service/main.cc +++ b/chrome/tools/crash_service/main.cc @@ -39,7 +39,7 @@ int __stdcall wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd_line, // Manages the destruction of singletons. base::AtExitManager exit_manager; - CommandLine::Init(0, NULL); + base::CommandLine::Init(0, NULL); chrome::RegisterPathProvider(); diff --git a/chrome/tools/profile_reset/jtl_compiler_frontend.cc b/chrome/tools/profile_reset/jtl_compiler_frontend.cc index 88ddebc..634d3a7 100644 --- a/chrome/tools/profile_reset/jtl_compiler_frontend.cc +++ b/chrome/tools/profile_reset/jtl_compiler_frontend.cc @@ -60,8 +60,8 @@ const char* ResolveErrorCode(JtlCompiler::CompileError::ErrorCode code) { } // namespace int main(int argc, char* argv[]) { - CommandLine::Init(argc, argv); - CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + base::CommandLine::Init(argc, argv); + base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); if (!cmd_line->HasSwitch(kInputPath) || !cmd_line->HasSwitch(kHashSeed) || !cmd_line->HasSwitch(kOutputPath)) { std::cerr << "Usage: " << argv[0] << " <required switches>" << std::endl; diff --git a/chrome/tools/safe_browsing/sb_sigutil.cc b/chrome/tools/safe_browsing/sb_sigutil.cc index b8562e0..89af624 100644 --- a/chrome/tools/safe_browsing/sb_sigutil.cc +++ b/chrome/tools/safe_browsing/sb_sigutil.cc @@ -25,9 +25,9 @@ static const char kExecutable[] = "executable"; static const char kOutputFile[] = "output"; int main(int argc, char* argv[]) { - CommandLine::Init(argc, argv); + base::CommandLine::Init(argc, argv); - CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); if (!cmd_line->HasSwitch(kExecutable)) { LOG(ERROR) << "Must specify executable to open with --executable"; return 1; diff --git a/chrome/utility/importer/firefox_importer_unittest_utils_mac.cc b/chrome/utility/importer/firefox_importer_unittest_utils_mac.cc index 2ae60ea..cadedd2 100644 --- a/chrome/utility/importer/firefox_importer_unittest_utils_mac.cc +++ b/chrome/utility/importer/firefox_importer_unittest_utils_mac.cc @@ -38,7 +38,7 @@ const char kTestChannelID[] = "T1"; // child. bool LaunchNSSDecrypterChildProcess(const base::FilePath& nss_path, IPC::Channel* channel, base::ProcessHandle* handle) { - CommandLine cl(*CommandLine::ForCurrentProcess()); + base::CommandLine cl(*base::CommandLine::ForCurrentProcess()); cl.AppendSwitchASCII(switches::kTestChildProcess, "NSSDecrypterChildProcess"); // Set env variable needed for FF encryption libs to load. diff --git a/chromeos/chromeos_switches.cc b/chromeos/chromeos_switches.cc index b9da8ce..ff0dc0a 100644 --- a/chromeos/chromeos_switches.cc +++ b/chromeos/chromeos_switches.cc @@ -285,8 +285,7 @@ const char kEnableCaptivePortalBypassProxy[] = "enable-captive-portal-bypass-proxy"; bool WakeOnWifiEnabled() { - return !CommandLine::ForCurrentProcess()->HasSwitch( - kDisableWakeOnWifi); + return !base::CommandLine::ForCurrentProcess()->HasSwitch(kDisableWakeOnWifi); } } // namespace switches |