diff options
author | kkosztyo.u-szeged <kkosztyo.u-szeged@partner.samsung.com> | 2014-12-03 00:48:51 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-03 08:49:19 +0000 |
commit | c3348259183454d20a97f875ed70316776332d78 (patch) | |
tree | c4e6937415c3e29e865b84a1873844bc65471ca8 | |
parent | fb2f68482dc71520565da63c4fa51bc209f482a9 (diff) | |
download | chromium_src-c3348259183454d20a97f875ed70316776332d78.zip chromium_src-c3348259183454d20a97f875ed70316776332d78.tar.gz chromium_src-c3348259183454d20a97f875ed70316776332d78.tar.bz2 |
Prefix CommandLine usage with base namespace (Part 8: components)
Prefix all CommandLine usage in the components/ directory's following subdirectories:
autofill, cloud_devices, crash, data_reduction_proxy and dom_distiller
with the base:: namespace.
BUG=422426
Review URL: https://codereview.chromium.org/762723003
Cr-Commit-Position: refs/heads/master@{#306576}
21 files changed, 71 insertions, 55 deletions
diff --git a/components/autofill/content/browser/content_autofill_driver.cc b/components/autofill/content/browser/content_autofill_driver.cc index d6ecdd3..992b862 100644 --- a/components/autofill/content/browser/content_autofill_driver.cc +++ b/components/autofill/content/browser/content_autofill_driver.cc @@ -94,7 +94,7 @@ void ContentAutofillDriver::DetectAccountCreationForms( void ContentAutofillDriver::SendAutofillTypePredictionsToRenderer( const std::vector<FormStructure*>& forms) { - if (!CommandLine::ForCurrentProcess()->HasSwitch( + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kShowAutofillTypePredictions)) return; diff --git a/components/autofill/content/browser/content_autofill_driver_unittest.cc b/components/autofill/content/browser/content_autofill_driver_unittest.cc index 76fbf7c..ffbee12 100644 --- a/components/autofill/content/browser/content_autofill_driver_unittest.cc +++ b/components/autofill/content/browser/content_autofill_driver_unittest.cc @@ -265,7 +265,7 @@ TEST_F(ContentAutofillDriverTest, } TEST_F(ContentAutofillDriverTest, TypePredictionsSentToRendererWhenEnabled) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kShowAutofillTypePredictions); FormData form; diff --git a/components/autofill/content/browser/wallet/wallet_service_url.cc b/components/autofill/content/browser/wallet/wallet_service_url.cc index 89338c8..3b0c2d5 100644 --- a/components/autofill/content/browser/wallet/wallet_service_url.cc +++ b/components/autofill/content/browser/wallet/wallet_service_url.cc @@ -33,7 +33,8 @@ const char kSandboxWalletSecureServiceUrl[] = bool IsWalletProductionEnabled() { // If the command line flag exists, it takes precedence. - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); std::string sandbox_enabled( command_line->GetSwitchValueASCII(switches::kWalletServiceUseSandbox)); if (!sandbox_enabled.empty()) @@ -52,7 +53,8 @@ bool IsWalletProductionEnabled() { } GURL GetWalletHostUrl() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); std::string wallet_service_hostname = command_line.GetSwitchValueASCII(switches::kWalletServiceUrl); if (!wallet_service_hostname.empty()) @@ -72,7 +74,8 @@ GURL GetBaseAutocheckoutUrl(size_t user_index) { } GURL GetBaseSecureUrl() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); std::string wallet_secure_url = command_line.GetSwitchValueASCII(switches::kWalletSecureServiceUrl); if (!wallet_secure_url.empty()) @@ -83,7 +86,8 @@ GURL GetBaseSecureUrl() { } GURL GetBaseEncryptedFrontendUrl(size_t user_index) { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); GURL base_url = IsWalletProductionEnabled() || command_line.HasSwitch(switches::kWalletServiceUrl) ? GetWalletHostUrl() : GetBaseSecureUrl(); diff --git a/components/autofill/content/browser/wallet/wallet_service_url_unittest.cc b/components/autofill/content/browser/wallet/wallet_service_url_unittest.cc index d2f562d..de289e6 100644 --- a/components/autofill/content/browser/wallet/wallet_service_url_unittest.cc +++ b/components/autofill/content/browser/wallet/wallet_service_url_unittest.cc @@ -13,7 +13,7 @@ namespace autofill { namespace wallet { TEST(WalletServiceSandboxUrl, CheckSandboxUrls) { - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kWalletServiceUseSandbox, "1"); EXPECT_EQ( @@ -50,7 +50,7 @@ TEST(WalletServiceSandboxUrl, CheckSandboxUrls) { } TEST(WalletServiceSandboxUrl, CheckProdUrls) { - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kWalletServiceUseSandbox, "0"); EXPECT_EQ("https://wallet.google.com/online/v2/u/1/wallet/" @@ -91,7 +91,7 @@ TEST(WalletServiceUrl, DefaultsToProd) { EXPECT_FALSE(IsUsingProd()); #endif - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); command_line->AppendSwitch(::switches::kReduceSecurityForTesting); EXPECT_FALSE(IsUsingProd()); @@ -100,7 +100,7 @@ TEST(WalletServiceUrl, DefaultsToProd) { } TEST(WalletServiceUrl, IsUsingProd) { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); command_line->AppendSwitchASCII(switches::kWalletServiceUseSandbox, "1"); EXPECT_FALSE(IsUsingProd()); @@ -117,7 +117,7 @@ TEST(WalletServiceUrl, IsUsingProd) { TEST(WalletServiceUrl, IsSignInContinueUrl) { EXPECT_TRUE(GetSignInContinueUrl().SchemeIsSecure()); - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); command_line->AppendSwitchASCII(switches::kWalletServiceUseSandbox, "1"); // authuser query param is respected. diff --git a/components/autofill/content/renderer/password_generation_agent.cc b/components/autofill/content/renderer/password_generation_agent.cc index df2a7b5..9de6021 100644 --- a/components/autofill/content/renderer/password_generation_agent.cc +++ b/components/autofill/content/renderer/password_generation_agent.cc @@ -279,7 +279,7 @@ void PasswordGenerationAgent::DetermineGenerationElement() { return; } - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kLocalHeuristicsOnlyForPasswordGeneration)) { DVLOG(2) << "Bypassing additional checks."; } else if (not_blacklisted_password_form_origins_.empty() || diff --git a/components/autofill/core/browser/autofill_external_delegate_unittest.cc b/components/autofill/core/browser/autofill_external_delegate_unittest.cc index 267bc5f..251d738 100644 --- a/components/autofill/core/browser/autofill_external_delegate_unittest.cc +++ b/components/autofill/core/browser/autofill_external_delegate_unittest.cc @@ -462,7 +462,7 @@ TEST_F(AutofillExternalDelegateUnitTest, FillCreditCardForm) { } TEST_F(AutofillExternalDelegateUnitTest, ExternalDelegateHideWarning) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kRespectAutocompleteOffForAutofill); // Set up a field that shouldn't get autocompleted or display warnings. diff --git a/components/autofill/core/browser/autofill_manager_unittest.cc b/components/autofill/core/browser/autofill_manager_unittest.cc index 7912ab3..7fb4f20 100644 --- a/components/autofill/core/browser/autofill_manager_unittest.cc +++ b/components/autofill/core/browser/autofill_manager_unittest.cc @@ -2465,7 +2465,7 @@ TEST_F(AutofillManagerTest, AutocompleteSuggestionsWhenAutofillDisabled) { // Duplicate of the below test with the respect-autocomplete-off-autofill // switch. TEST_F(AutofillManagerTest, AutocompleteOffRespected) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kRespectAutocompleteOffForAutofill); TestAutofillClient client; diff --git a/components/autofill/core/browser/form_structure.cc b/components/autofill/core/browser/form_structure.cc index 3e91915..daaad18 100644 --- a/components/autofill/core/browser/form_structure.cc +++ b/components/autofill/core/browser/form_structure.cc @@ -246,7 +246,7 @@ HtmlFieldType FieldTypeFromAutocompleteAttributeValue( // content_switches.h isn't accessible from here, hence we have // to copy the string literal. This should be removed soon anyway. if (autocomplete_attribute_value == "address" && - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( "enable-experimental-web-platform-features")) { return HTML_TYPE_FULL_ADDRESS; } diff --git a/components/autofill/core/browser/form_structure_unittest.cc b/components/autofill/core/browser/form_structure_unittest.cc index 8353f28..e897d05 100644 --- a/components/autofill/core/browser/form_structure_unittest.cc +++ b/components/autofill/core/browser/form_structure_unittest.cc @@ -135,7 +135,7 @@ TEST(FormStructureTest, AutofillCount) { form_structure->DetermineHeuristicTypes(TestAutofillMetrics()); EXPECT_EQ(2U, form_structure->autofill_count()); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kRespectAutocompleteOffForAutofill); form_structure.reset(new FormStructure(form)); diff --git a/components/autofill/core/common/password_generation_util.cc b/components/autofill/core/common/password_generation_util.cc index 95f4f60..bdbd20b 100644 --- a/components/autofill/core/common/password_generation_util.cc +++ b/components/autofill/core/common/password_generation_util.cc @@ -48,7 +48,7 @@ bool IsPasswordGenerationEnabled() { std::string group_name = base::FieldTrialList::FindFullName("PasswordGeneration"); - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kDisablePasswordGeneration)) return false; diff --git a/components/cloud_devices/common/cloud_devices_urls.cc b/components/cloud_devices/common/cloud_devices_urls.cc index 9e1090e..1b875b1 100644 --- a/components/cloud_devices/common/cloud_devices_urls.cc +++ b/components/cloud_devices/common/cloud_devices_urls.cc @@ -40,7 +40,8 @@ const char kCloudDevicesUrl[] = "https://www.googleapis.com/clouddevices/v1"; // point at the Google Cloud Print service. This can be overridden by the // command line or by the user preferences. GURL GetCloudPrintURL() { - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); GURL cloud_print_url( command_line->GetSwitchValueASCII(switches::kCloudPrintURL)); if (cloud_print_url.is_empty()) @@ -102,7 +103,8 @@ GURL GetCloudPrintManageDeviceURL(const std::string& device_id) { } GURL GetCloudDevicesURL() { - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); GURL cloud_print_url( command_line->GetSwitchValueASCII(switches::kCloudDevicesURL)); if (cloud_print_url.is_empty()) diff --git a/components/crash/app/breakpad_linux.cc b/components/crash/app/breakpad_linux.cc index f3e9e21..7267bda 100644 --- a/components/crash/app/breakpad_linux.cc +++ b/components/crash/app/breakpad_linux.cc @@ -205,7 +205,7 @@ size_t LengthWithoutTrailingSpaces(const char* str, size_t len) { return len; } -void SetClientIdFromCommandLine(const CommandLine& command_line) { +void SetClientIdFromCommandLine(const base::CommandLine& command_line) { // Get the guid from the command line switch. std::string switch_value = command_line.GetSwitchValueASCII(switches::kEnableCrashReporter); @@ -769,7 +769,7 @@ void EnableNonBrowserCrashDumping(const std::string& process_type, // This will guarantee that the BuildInfo has been initialized and subsequent // calls will not require memory allocation. base::android::BuildInfo::GetInstance(); - SetClientIdFromCommandLine(*CommandLine::ForCurrentProcess()); + SetClientIdFromCommandLine(*base::CommandLine::ForCurrentProcess()); // On Android, the current sandboxing uses process isolation, in which the // child process runs with a different UID. That breaks the normal crash @@ -1635,7 +1635,8 @@ void InitCrashReporter(const std::string& process_type) { InitMicrodumpCrashHandlerIfNecessary(process_type); #endif // Determine the process type and take appropriate action. - const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& parsed_command_line = + *base::CommandLine::ForCurrentProcess(); if (parsed_command_line.HasSwitch(switches::kDisableBreakpad)) return; @@ -1680,7 +1681,8 @@ void InitCrashReporter(const std::string& process_type) { #if defined(OS_ANDROID) void InitNonBrowserCrashReporterForAndroid(const std::string& process_type) { - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); // Handler registration is LIFO. Install the microdump handler first, such // that if conventional minidump crash reporting is enabled below, it takes diff --git a/components/crash/app/breakpad_mac.mm b/components/crash/app/breakpad_mac.mm index 695a232..80f8b17 100644 --- a/components/crash/app/breakpad_mac.mm +++ b/components/crash/app/breakpad_mac.mm @@ -167,7 +167,7 @@ void InitCrashReporter(const std::string& process_type) { NSBundle* main_bundle = base::mac::FrameworkBundle(); bool is_browser = !base::mac::IsBackgroundOnlyProcess(); bool enable_breakpad = false; - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (is_browser) { // Since the configuration management infrastructure is possibly not diff --git a/components/crash/app/breakpad_win.cc b/components/crash/app/breakpad_win.cc index 862174c..1c3af66 100644 --- a/components/crash/app/breakpad_win.cc +++ b/components/crash/app/breakpad_win.cc @@ -456,7 +456,7 @@ static void InitPipeNameEnvVar(bool is_per_user_install) { GetCrashReporterClient()->ReportingIsEnforcedByPolicy( &crash_reporting_enabled); - const CommandLine& command = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command = *base::CommandLine::ForCurrentProcess(); bool use_crash_service = !controlled_by_policy && (command.HasSwitch(switches::kNoErrorDialogs) || GetCrashReporterClient()->IsRunningUnattended()); @@ -501,7 +501,7 @@ void InitDefaultCrashCallback(LPTOP_LEVEL_EXCEPTION_FILTER filter) { } void InitCrashReporter(const std::string& process_type_switch) { - const CommandLine& command = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command = *base::CommandLine::ForCurrentProcess(); if (command.HasSwitch(switches::kDisableBreakpad)) return; @@ -523,8 +523,8 @@ void InitCrashReporter(const std::string& process_type_switch) { CrashKeysWin* keeper = new CrashKeysWin(); google_breakpad::CustomClientInfo* custom_info = - keeper->GetCustomInfo(exe_path, process_type, - GetProfileType(), CommandLine::ForCurrentProcess(), + keeper->GetCustomInfo(exe_path, process_type, GetProfileType(), + base::CommandLine::ForCurrentProcess(), GetCrashReporterClient()); google_breakpad::ExceptionHandler::MinidumpCallback callback = NULL; diff --git a/components/crash/tools/crash_service.cc b/components/crash/tools/crash_service.cc index 7e1798f..23d5ec66 100644 --- a/components/crash/tools/crash_service.cc +++ b/components/crash/tools/crash_service.cc @@ -178,7 +178,7 @@ bool CrashService::Initialize(const base::FilePath& operating_dir, // reports per day quota. Does not seem to serve any other purpose. base::FilePath checkpoint_path = operating_dir.Append(kCheckPointFile); - CommandLine& cmd_line = *CommandLine::ForCurrentProcess(); + base::CommandLine& cmd_line = *base::CommandLine::ForCurrentProcess(); base::FilePath dumps_path_to_use = dumps_path; diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_auth_request_handler.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_auth_request_handler.cc index 44ae252..e6dea8c 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_auth_request_handler.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_auth_request_handler.cc @@ -48,7 +48,8 @@ const char* GetString(Client client) { // static bool DataReductionProxyAuthRequestHandler::IsKeySetOnCommandLine() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); return command_line.HasSwitch( data_reduction_proxy::switches::kDataReductionProxyKey); } @@ -214,7 +215,8 @@ void DataReductionProxyAuthRequestHandler::InitAuthentication( } std::string DataReductionProxyAuthRequestHandler::GetDefaultKey() const { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); std::string key = command_line.GetSwitchValueASCII(switches::kDataReductionProxyKey); // Android and iOS get the default key from a preprocessor constant. All other diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc index e6e7c72..9ce68a4 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc @@ -79,7 +79,8 @@ int64 GetInt64PrefValue(const base::ListValue& list_value, size_t index) { } bool IsEnabledOnCommandLine() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); return command_line.HasSwitch( data_reduction_proxy::switches::kEnableDataReductionProxy); } diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc index f0c7bbf..19b61e5 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc @@ -41,7 +41,7 @@ TEST_F(DataReductionProxySettingsTest, TestGetDataReductionProxyOrigin) { } TEST_F(DataReductionProxySettingsTest, TestGetDataReductionProxyDevOrigin) { - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kDataReductionProxyDev, expected_params_->DefaultDevOrigin()); ResetSettings(true, true, false, true, false); std::string result = @@ -76,12 +76,12 @@ TEST_F(DataReductionProxySettingsTest, TestSetProxyConfigs) { TestDataReductionProxyParams::HAS_EVERYTHING & ~TestDataReductionProxyParams::HAS_DEV_ORIGIN & ~TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN); - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kDataReductionProxyAlt, drp_params.DefaultAltOrigin()); - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kDataReductionProxyAltFallback, drp_params.DefaultAltFallbackOrigin()); - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kDataReductionSSLProxy, drp_params.DefaultSSLOrigin()); ResetSettings(true, true, true, true, false); TestDataReductionProxyConfig* config = @@ -377,7 +377,7 @@ TEST_F(DataReductionProxySettingsTest, TestEnableProxyFromCommandLine) { MockSettings* settings = static_cast<MockSettings*>(settings_.get()); EXPECT_CALL(*settings, RecordStartupState(PROXY_ENABLED)); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDataReductionProxy); CheckInitDataReductionProxy(true); } @@ -401,7 +401,7 @@ TEST_F(DataReductionProxySettingsTest, CheckInitMetricsWhenNotAllowed) { // should be unavailable. base::MessageLoopForUI loop; // Clear the command line. Setting flags can force the proxy to be allowed. - CommandLine::ForCurrentProcess()->InitFromArgv(0, NULL); + base::CommandLine::ForCurrentProcess()->InitFromArgv(0, NULL); ResetSettings(false, false, false, false, false); MockSettings* settings = static_cast<MockSettings*>(settings_.get()); diff --git a/components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc b/components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc index 12a463c..743c844 100644 --- a/components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc +++ b/components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc @@ -49,7 +49,7 @@ namespace data_reduction_proxy { bool DataReductionProxyParams::IsIncludedInAlternativeFieldTrial() { const std::string group_name = base::FieldTrialList::FindFullName( "DataCompressionProxyAlternativeConfiguration"); - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( data_reduction_proxy::switches::kEnableDataReductionProxyAlt)) { return true; } @@ -241,7 +241,8 @@ bool DataReductionProxyParams::Init(bool allowed, } void DataReductionProxyParams::InitWithoutChecks() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); std::string origin; if (!command_line.HasSwitch(switches::kDisableDataReductionProxyDev)) { origin = command_line.GetSwitchValueASCII( @@ -384,7 +385,8 @@ bool DataReductionProxyParams::IsBypassedByDataReductionProxyLocalRules( } std::string DataReductionProxyParams::GetDefaultDevOrigin() const { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (command_line.HasSwitch(switches::kDisableDataReductionProxyDev)) return std::string(); if (command_line.HasSwitch(switches::kEnableDataReductionProxyDev) || @@ -396,7 +398,8 @@ std::string DataReductionProxyParams::GetDefaultDevOrigin() const { } std::string DataReductionProxyParams::GetDefaultDevFallbackOrigin() const { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (command_line.HasSwitch(switches::kDisableDataReductionProxyDev)) return std::string(); if (command_line.HasSwitch(switches::kEnableDataReductionProxyDev) || diff --git a/components/data_reduction_proxy/core/common/data_reduction_proxy_params_unittest.cc b/components/data_reduction_proxy/core/common/data_reduction_proxy_params_unittest.cc index 6df5d3b..edcb216 100644 --- a/components/data_reduction_proxy/core/common/data_reduction_proxy_params_unittest.cc +++ b/components/data_reduction_proxy/core/common/data_reduction_proxy_params_unittest.cc @@ -81,22 +81,22 @@ TEST_F(DataReductionProxyParamsTest, NoDevOrigin) { } TEST_F(DataReductionProxyParamsTest, Flags) { - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kDataReductionProxy, TestDataReductionProxyParams::FlagOrigin()); - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kDataReductionProxyFallback, TestDataReductionProxyParams::FlagFallbackOrigin()); - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kDataReductionSSLProxy, TestDataReductionProxyParams::FlagSSLOrigin()); - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kDataReductionProxyAlt, TestDataReductionProxyParams::FlagAltOrigin()); - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kDataReductionProxyAltFallback, TestDataReductionProxyParams::FlagAltFallbackOrigin()); - CommandLine::ForCurrentProcess()->AppendSwitchASCII( + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kDataReductionProxyProbeURL, TestDataReductionProxyParams::FlagProbeURL()); TestDataReductionProxyParams params( diff --git a/components/dom_distiller/standalone/content_extractor.cc b/components/dom_distiller/standalone/content_extractor.cc index 3842d08..6c0e75b 100644 --- a/components/dom_distiller/standalone/content_extractor.cc +++ b/components/dom_distiller/standalone/content_extractor.cc @@ -225,7 +225,7 @@ class ContentExtractionRequest : public ViewRequestDelegate { } static ScopedVector<ContentExtractionRequest> CreateForCommandLine( - const CommandLine& command_line, + const base::CommandLine& command_line, UrlToDomainMap* url_to_domain_map) { ScopedVector<ContentExtractionRequest> requests; if (command_line.HasSwitch(kUrlSwitch)) { @@ -304,7 +304,7 @@ class ContentExtractor : public ContentBrowserTest { // Change behavior of the default host resolver to avoid DNS lookup errors, so // we can make network calls. void SetUpOnMainThread() override { - if (!CommandLine::ForCurrentProcess()->HasSwitch(kDisableDnsSwitch)) { + if (!base::CommandLine::ForCurrentProcess()->HasSwitch(kDisableDnsSwitch)) { EnableDNSLookupForThisTest(); } CHECK(db_dir_.CreateUniqueTempDir()); @@ -317,7 +317,8 @@ class ContentExtractor : public ContentBrowserTest { // Creates the DomDistillerService and creates and starts the extraction // request. void Start() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); UrlToDomainMap url_to_domain_map; requests_ = ContentExtractionRequest::CreateForCommandLine( command_line, &url_to_domain_map); @@ -367,18 +368,19 @@ class ContentExtractor : public ContentBrowserTest { } void DoArticleOutput() { + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); for (size_t i = 0; i < requests_.size(); ++i) { const DistilledArticleProto& article = requests_[i]->GetArticleCopy(); - if (CommandLine::ForCurrentProcess()->HasSwitch(kShouldOutputBinary)) { + if (command_line.HasSwitch(kShouldOutputBinary)) { WriteProtobufWithSize(article, protobuf_output_stream_.get()); } else { output_data_ += GetReadableArticleString(article) + "\n"; } } - if (CommandLine::ForCurrentProcess()->HasSwitch(kOutputFile)) { - base::FilePath filename = - CommandLine::ForCurrentProcess()->GetSwitchValuePath(kOutputFile); + if (command_line.HasSwitch(kOutputFile)) { + base::FilePath filename = command_line.GetSwitchValuePath(kOutputFile); ASSERT_EQ( (int)output_data_.size(), base::WriteFile(filename, output_data_.c_str(), output_data_.size())); |