diff options
author | brettw <brettw@chromium.org> | 2015-07-16 16:57:33 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-16 23:58:34 +0000 |
commit | 955093110ad64d5ec6f5426991efaa4a680b5d6f (patch) | |
tree | 19368cdb8861595640715e1072789959729efc2d /components | |
parent | 387e05a79c7ae346ba7db36977ddfca7ca6f10a3 (diff) | |
download | chromium_src-955093110ad64d5ec6f5426991efaa4a680b5d6f.zip chromium_src-955093110ad64d5ec6f5426991efaa4a680b5d6f.tar.gz chromium_src-955093110ad64d5ec6f5426991efaa4a680b5d6f.tar.bz2 |
Remove legacy StartsWithASCII function.
This replaces it with base::StartsWith and the appropriate case flag. Since the existing version only ever did case-insensitive tests in ASCII, there should be no behavior change.
BUG=506255
TBR=jam
Review URL: https://codereview.chromium.org/1242023005
Cr-Commit-Position: refs/heads/master@{#339175}
Diffstat (limited to 'components')
25 files changed, 71 insertions, 45 deletions
diff --git a/components/autofill/content/renderer/form_autofill_util.cc b/components/autofill/content/renderer/form_autofill_util.cc index b2259ed..b6c54ac 100644 --- a/components/autofill/content/renderer/form_autofill_util.cc +++ b/components/autofill/content/renderer/form_autofill_util.cc @@ -1312,7 +1312,8 @@ bool UnownedFormElementsAndFieldSetsToFormData( std::string lang; if (!html_element.isNull()) lang = html_element.getAttribute("lang").utf8(); - if ((lang.empty() || base::StartsWithASCII(lang, "en", false)) && + if ((lang.empty() || + base::StartsWith(lang, "en", base::CompareCase::INSENSITIVE_ASCII)) && !MatchesPattern(document.title(), base::UTF8ToUTF16("payment|checkout|address|delivery|shipping"))) { return false; diff --git a/components/autofill/core/browser/autofill_download_manager.cc b/components/autofill/core/browser/autofill_download_manager.cc index efcabc7..c92217a 100644 --- a/components/autofill/core/browser/autofill_download_manager.cc +++ b/components/autofill/core/browser/autofill_download_manager.cc @@ -272,9 +272,9 @@ void AutofillDownloadManager::OnURLFetchComplete( case kHttpBadGateway: if (!source->GetResponseHeaders()->EnumerateHeader(NULL, "server", &server_header) || - base::StartsWithASCII(server_header.c_str(), - kAutofillQueryServerNameStartInHeader, - false) != 0) + base::StartsWith(server_header.c_str(), + kAutofillQueryServerNameStartInHeader, + base::CompareCase::INSENSITIVE_ASCII) != 0) break; // Bad gateway was received from Autofill servers. Fall through to back // off. diff --git a/components/autofill/core/browser/form_structure.cc b/components/autofill/core/browser/form_structure.cc index bb7889e..07f579f 100644 --- a/components/autofill/core/browser/form_structure.cc +++ b/components/autofill/core/browser/form_structure.cc @@ -72,7 +72,7 @@ const int kNumberOfMismatchesThreshold = 3; bool IsAutofillFieldMetadataEnabled() { const std::string group_name = base::FieldTrialList::FindFullName("AutofillFieldMetadata"); - return base::StartsWithASCII(group_name, "Enabled", true); + return base::StartsWith(group_name, "Enabled", base::CompareCase::SENSITIVE); } // Helper for |EncodeUploadRequest()| that creates a bit field corresponding to @@ -1151,7 +1151,8 @@ void FormStructure::ParseFieldTypesFromAutocompleteAttributes( // The preceding token, if any, may be a named section. const std::string kSectionPrefix = "section-"; if (!tokens.empty() && - base::StartsWithASCII(tokens.back(), kSectionPrefix, true)) { + base::StartsWith(tokens.back(), kSectionPrefix, + base::CompareCase::SENSITIVE)) { // Prepend this section name to the suffix set in the preceding block. section = tokens.back().substr(kSectionPrefix.size()) + section; tokens.pop_back(); diff --git a/components/cloud_devices/common/cloud_devices_urls.cc b/components/cloud_devices/common/cloud_devices_urls.cc index beaf705..5a9a15e4 100644 --- a/components/cloud_devices/common/cloud_devices_urls.cc +++ b/components/cloud_devices/common/cloud_devices_urls.cc @@ -85,7 +85,8 @@ bool IsCloudPrintURL(const GURL& url) { GURL cloud_print_url = GetCloudPrintURL(); return url.host() == cloud_print_url.host() && url.scheme() == cloud_print_url.scheme() && - base::StartsWithASCII(url.path(), cloud_print_url.path(), true); + base::StartsWith(url.path(), cloud_print_url.path(), + base::CompareCase::SENSITIVE); } GURL GetCloudPrintEnableURL(const std::string& proxy_id) { diff --git a/components/content_settings/core/common/content_settings_pattern_parser.cc b/components/content_settings/core/common/content_settings_pattern_parser.cc index cbdd260..7a5ca79 100644 --- a/components/content_settings/core/common/content_settings_pattern_parser.cc +++ b/components/content_settings/core/common/content_settings_pattern_parser.cc @@ -130,7 +130,8 @@ void PatternParser::Parse(const std::string& pattern_spec, host_component.len); if (host == kHostWildcard) { builder->WithDomainWildcard(); - } else if (base::StartsWithASCII(host, kDomainWildcard, true)) { + } else if (base::StartsWith(host, kDomainWildcard, + base::CompareCase::SENSITIVE)) { host = host.substr(kDomainWildcardLength); builder->WithDomainWildcard(); builder->WithHost(host); diff --git a/components/cronet/android/test/native_test_server.cc b/components/cronet/android/test/native_test_server.cc index 022b1c5..908ddb0 100644 --- a/components/cronet/android/test/native_test_server.cc +++ b/components/cronet/android/test/native_test_server.cc @@ -102,7 +102,8 @@ scoped_ptr<net::test_server::HttpResponse> NativeTestServerRequestHandler( return response.Pass(); } - if (base::StartsWithASCII(request.relative_url, kEchoHeaderPath, true)) { + if (base::StartsWith(request.relative_url, kEchoHeaderPath, + base::CompareCase::SENSITIVE)) { GURL url = g_test_server->GetURL(request.relative_url); auto it = request.headers.find(url.query()); if (it != request.headers.end()) { @@ -141,7 +142,8 @@ scoped_ptr<net::test_server::HttpResponse> SdchRequestHandler( DCHECK(get_data_dir); dir_path = dir_path.Append(FILE_PATH_LITERAL("test")); - if (base::StartsWithASCII(request.relative_url, kSdchPath, true)) { + if (base::StartsWith(request.relative_url, kSdchPath, + base::CompareCase::SENSITIVE)) { base::FilePath file_path = dir_path.Append("sdch/index"); scoped_ptr<CustomHttpResponse> response = ConstructResponseBasedOnFile(file_path).Pass(); @@ -162,7 +164,8 @@ scoped_ptr<net::test_server::HttpResponse> SdchRequestHandler( return response.Pass(); } - if (base::StartsWithASCII(request.relative_url, kSdchTestPath, true)) { + if (base::StartsWith(request.relative_url, kSdchTestPath, + base::CompareCase::SENSITIVE)) { auto avail_dictionary_header = request.headers.find("Avail-Dictionary"); if (avail_dictionary_header != request.headers.end()) { base::FilePath file_path = dir_path.Append( diff --git a/components/enhanced_bookmarks/enhanced_bookmark_model_unittest.cc b/components/enhanced_bookmarks/enhanced_bookmark_model_unittest.cc index 15e9dfe..d953a27 100644 --- a/components/enhanced_bookmarks/enhanced_bookmark_model_unittest.cc +++ b/components/enhanced_bookmarks/enhanced_bookmark_model_unittest.cc @@ -369,7 +369,8 @@ TEST_F(EnhancedBookmarkModelTest, TestDoubleEncodeDecode) { TEST_F(EnhancedBookmarkModelTest, TestRemoteId) { const BookmarkNode* node = AddBookmark(); // Verify that the remote id starts with the correct prefix. - EXPECT_TRUE(base::StartsWithASCII(model_->GetRemoteId(node), "ebc_", true)); + EXPECT_TRUE(base::StartsWith(model_->GetRemoteId(node), "ebc_", + base::CompareCase::SENSITIVE)); // Getting the remote id for nodes that don't have them should return the // empty string. diff --git a/components/favicon/core/favicon_driver_impl.cc b/components/favicon/core/favicon_driver_impl.cc index 9007569..bd22f7b 100644 --- a/components/favicon/core/favicon_driver_impl.cc +++ b/components/favicon/core/favicon_driver_impl.cc @@ -30,7 +30,7 @@ bool IsIconNTPEnabled() { if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableIconNtp)) return true; - return base::StartsWithASCII(group_name, "Enabled", true); + return base::StartsWith(group_name, "Enabled", base::CompareCase::SENSITIVE); } #if defined(OS_ANDROID) || defined(OS_IOS) diff --git a/components/gcm_driver/registration_info.cc b/components/gcm_driver/registration_info.cc index 90bf4e34..6fd9266 100644 --- a/components/gcm_driver/registration_info.cc +++ b/components/gcm_driver/registration_info.cc @@ -22,8 +22,8 @@ scoped_ptr<RegistrationInfo> RegistrationInfo::BuildFromString( std::string* registration_id) { scoped_ptr<RegistrationInfo> registration; - if (base::StartsWithASCII(serialzied_key, kInsanceIDSerializationPrefix, - true)) + if (base::StartsWith(serialzied_key, kInsanceIDSerializationPrefix, + base::CompareCase::SENSITIVE)) registration.reset(new InstanceIDTokenInfo); else registration.reset(new GCMRegistrationInfo); @@ -184,8 +184,8 @@ bool InstanceIDTokenInfo::Deserialize( if (serialized_key.empty() || serialized_value.empty()) return false; - if (!base::StartsWithASCII(serialized_key, kInsanceIDSerializationPrefix, - true)) + if (!base::StartsWith(serialized_key, kInsanceIDSerializationPrefix, + base::CompareCase::SENSITIVE)) return false; std::vector<std::string> fields = base::SplitString( diff --git a/components/google/core/browser/google_url_tracker.cc b/components/google/core/browser/google_url_tracker.cc index 770c9af..2ead364 100644 --- a/components/google/core/browser/google_url_tracker.cc +++ b/components/google/core/browser/google_url_tracker.cc @@ -97,7 +97,8 @@ void GoogleURLTracker::OnURLFetchComplete(const net::URLFetcher* source) { std::string url_str; source->GetResponseAsString(&url_str); base::TrimWhitespace(url_str, base::TRIM_ALL, &url_str); - if (!base::StartsWithASCII(url_str, ".google.", false)) + if (!base::StartsWith(url_str, ".google.", + base::CompareCase::INSENSITIVE_ASCII)) return; GURL url("https://www" + url_str); if (!url.is_valid() || (url.path().length() > 1) || url.has_query() || diff --git a/components/google/core/browser/google_util.cc b/components/google/core/browser/google_util.cc index 1eada34..2cdfe05 100644 --- a/components/google/core/browser/google_util.cc +++ b/components/google/core/browser/google_util.cc @@ -163,8 +163,8 @@ GURL CommandLineGoogleBaseURL() { bool StartsWithCommandLineGoogleBaseURL(const GURL& url) { GURL base_url(CommandLineGoogleBaseURL()); return base_url.is_valid() && - base::StartsWithASCII(url.possibly_invalid_spec(), base_url.spec(), - true); + base::StartsWith(url.possibly_invalid_spec(), base_url.spec(), + base::CompareCase::SENSITIVE); } bool IsGoogleHostname(const std::string& host, @@ -190,7 +190,8 @@ bool IsGoogleHomePageUrl(const GURL& url) { // Make sure the path is a known home page path. std::string path(url.path()); - return IsPathHomePageBase(path) || base::StartsWithASCII(path, "/ig", false); + return IsPathHomePageBase(path) || + base::StartsWith(path, "/ig", base::CompareCase::INSENSITIVE_ASCII); } bool IsGoogleSearchUrl(const GURL& url) { diff --git a/components/html_viewer/web_mime_registry_impl.cc b/components/html_viewer/web_mime_registry_impl.cc index a050693..caed089 100644 --- a/components/html_viewer/web_mime_registry_impl.cc +++ b/components/html_viewer/web_mime_registry_impl.cc @@ -44,7 +44,8 @@ WebMimeRegistryImpl::supportsImagePrefixedMIMEType( const blink::WebString& mime_type) { std::string ascii_mime_type = ToASCIIOrEmpty(mime_type); return (mime_util::IsSupportedImageMimeType(ascii_mime_type) || - (base::StartsWithASCII(ascii_mime_type, "image/", true) && + (base::StartsWith(ascii_mime_type, "image/", + base::CompareCase::SENSITIVE) && mime_util::IsSupportedNonImageMimeType(ascii_mime_type))) ? WebMimeRegistry::IsSupported : WebMimeRegistry::IsNotSupported; diff --git a/components/html_viewer/web_url_loader_impl.cc b/components/html_viewer/web_url_loader_impl.cc index 48d291f..0fa6b8e 100644 --- a/components/html_viewer/web_url_loader_impl.cc +++ b/components/html_viewer/web_url_loader_impl.cc @@ -30,10 +30,12 @@ blink::WebURLResponse::HTTPVersion StatusLineToHTTPVersion( if (status_line.is_null()) return blink::WebURLResponse::HTTP_0_9; - if (base::StartsWithASCII(status_line, "HTTP/1.0", true)) + if (base::StartsWith(status_line.get(), "HTTP/1.0", + base::CompareCase::SENSITIVE)) return blink::WebURLResponse::HTTP_1_0; - if (base::StartsWithASCII(status_line, "HTTP/1.1", true)) + if (base::StartsWith(status_line.get(), "HTTP/1.1", + base::CompareCase::SENSITIVE)) return blink::WebURLResponse::HTTP_1_1; return blink::WebURLResponse::Unknown; diff --git a/components/invalidation/impl/gcm_network_channel_unittest.cc b/components/invalidation/impl/gcm_network_channel_unittest.cc index 8efb2f47..e07788e 100644 --- a/components/invalidation/impl/gcm_network_channel_unittest.cc +++ b/components/invalidation/impl/gcm_network_channel_unittest.cc @@ -233,7 +233,8 @@ void TestNetworkChannelURLFetcher::AddExtraRequestHeader( net::FakeURLFetcher::AddExtraRequestHeader(header_line); std::string header_name("echo-token: "); std::string echo_token; - if (base::StartsWithASCII(header_line, header_name, false)) { + if (base::StartsWith(header_line, header_name, + base::CompareCase::INSENSITIVE_ASCII)) { echo_token = header_line; base::ReplaceFirstSubstringAfterOffset( &echo_token, 0, header_name, std::string()); diff --git a/components/mime_util/mime_util.cc b/components/mime_util/mime_util.cc index ef5e0da..49bf49d 100644 --- a/components/mime_util/mime_util.cc +++ b/components/mime_util/mime_util.cc @@ -161,10 +161,11 @@ bool MimeUtil::IsSupportedNonImageMimeType(const std::string& mime_type) const { #if !defined(OS_IOS) media::IsSupportedMediaMimeType(mime_type) || #endif - (base::StartsWithASCII(mime_type, "text/", - false /* case insensitive */) && + (base::StartsWith(mime_type, "text/", + base::CompareCase::INSENSITIVE_ASCII) && !IsUnsupportedTextMimeType(mime_type)) || - (base::StartsWithASCII(mime_type, "application/", false) && + (base::StartsWith(mime_type, "application/", + base::CompareCase::INSENSITIVE_ASCII) && net::MatchesMimeType("application/*+json", mime_type)); } @@ -179,7 +180,8 @@ bool MimeUtil::IsSupportedJavascriptMimeType( } bool MimeUtil::IsSupportedMimeType(const std::string& mime_type) const { - return (base::StartsWithASCII(mime_type, "image/", false) && + return (base::StartsWith(mime_type, "image/", + base::CompareCase::INSENSITIVE_ASCII) && IsSupportedImageMimeType(mime_type)) || IsSupportedNonImageMimeType(mime_type); } diff --git a/components/nacl/renderer/ppb_nacl_private_impl.cc b/components/nacl/renderer/ppb_nacl_private_impl.cc index e40bdd3..3d67fc701 100644 --- a/components/nacl/renderer/ppb_nacl_private_impl.cc +++ b/components/nacl/renderer/ppb_nacl_private_impl.cc @@ -610,7 +610,8 @@ std::string PnaclComponentURLToFilename(const std::string& url) { // generated from ManifestResolveKey or PnaclResources::ReadResourceInfo. // So, it's safe to just use string parsing operations here instead of // URL-parsing ones. - DCHECK(base::StartsWithASCII(url, kPNaClTranslatorBaseUrl, true)); + DCHECK(base::StartsWith(url, kPNaClTranslatorBaseUrl, + base::CompareCase::SENSITIVE)); std::string r = url.substr(std::string(kPNaClTranslatorBaseUrl).length()); // Use white-listed-chars. diff --git a/components/password_manager/core/browser/affiliation_utils.cc b/components/password_manager/core/browser/affiliation_utils.cc index bd4bc5b..2b16e8b 100644 --- a/components/password_manager/core/browser/affiliation_utils.cc +++ b/components/password_manager/core/browser/affiliation_utils.cc @@ -302,7 +302,8 @@ bool IsAffiliationBasedMatchingEnabled(const base::CommandLine& command_line) { return false; if (command_line.HasSwitch(switches::kEnableAffiliationBasedMatching)) return true; - return base::StartsWithASCII(group_name, "Enabled", /*case_sensitive=*/false); + return base::StartsWith(group_name, "Enabled", + base::CompareCase::INSENSITIVE_ASCII); } bool IsPropagatingPasswordChangesToWebCredentialsEnabled( diff --git a/components/password_manager/core/browser/password_form_manager.cc b/components/password_manager/core/browser/password_form_manager.cc index 7815782..f6738f8 100644 --- a/components/password_manager/core/browser/password_form_manager.cc +++ b/components/password_manager/core/browser/password_form_manager.cc @@ -170,7 +170,7 @@ PasswordFormManager::MatchResultMask PasswordFormManager::DoesManage( origins_match = observed_form_.origin.host() == form.origin.host() && observed_form_.origin.port() == form.origin.port() && - base::StartsWithASCII(new_path, old_path, /*case_sensitive=*/true); + base::StartsWith(new_path, old_path, base::CompareCase::SENSITIVE); } if (!origins_match) @@ -400,7 +400,8 @@ void PasswordFormManager::OnRequestDone( // instead of explicitly handling empty path matches. bool is_credential_protected = observed_form_.scheme == PasswordForm::SCHEME_HTML && - base::StartsWithASCII("/", login->origin.path(), true) && + base::StartsWith("/", login->origin.path(), + base::CompareCase::SENSITIVE) && credential_scores[i] > 0 && !login->blacklisted_by_user; // Passwords generated on a signup form must show on a login form even if // there are better-matching saved credentials. TODO(gcasto): We don't diff --git a/components/proximity_auth/cryptauth/fake_secure_message_delegate.cc b/components/proximity_auth/cryptauth/fake_secure_message_delegate.cc index d05361c..4251e19 100644 --- a/components/proximity_auth/cryptauth/fake_secure_message_delegate.cc +++ b/components/proximity_auth/cryptauth/fake_secure_message_delegate.cc @@ -76,7 +76,8 @@ bool Verify(const std::string& signature, signing_key = key; } else { std::string prefix = kPrivateKeyPrefix; - bool is_private_key = base::StartsWithASCII(key, prefix, true); + bool is_private_key = + base::StartsWith(key, prefix, base::CompareCase::SENSITIVE); signing_key = is_private_key ? key.substr(prefix.size()) : prefix + key; } @@ -113,7 +114,7 @@ void FakeSecureMessageDelegate::DeriveKey(const std::string& private_key, // private key so it is equal to its corresponding public key. std::string prefix(kPrivateKeyPrefix); std::string normalized_private_key = - base::StartsWithASCII(private_key, prefix, true) + base::StartsWith(private_key, prefix, base::CompareCase::SENSITIVE) ? private_key.substr(prefix.size()) : private_key; diff --git a/components/suggestions/suggestions_service.cc b/components/suggestions/suggestions_service.cc index ee9e9d2..2cac424 100644 --- a/components/suggestions/suggestions_service.cc +++ b/components/suggestions/suggestions_service.cc @@ -178,8 +178,9 @@ void SuggestionsService::UndoBlacklistURL( // static bool SuggestionsService::GetBlacklistedUrl(const net::URLFetcher& request, GURL* url) { - bool is_blacklist_request = base::StartsWithASCII( - request.GetOriginalURL().spec(), kSuggestionsBlacklistURLPrefix, true); + bool is_blacklist_request = base::StartsWith( + request.GetOriginalURL().spec(), kSuggestionsBlacklistURLPrefix, + base::CompareCase::SENSITIVE); if (!is_blacklist_request) return false; // Extract the blacklisted URL from the blacklist request. diff --git a/components/translate/core/browser/translate_prefs.cc b/components/translate/core/browser/translate_prefs.cc index 24547005..571241a 100644 --- a/components/translate/core/browser/translate_prefs.cc +++ b/components/translate/core/browser/translate_prefs.cc @@ -511,7 +511,8 @@ void TranslatePrefs::CreateBlockedLanguages( TranslateDownloadManager::GetInstance()->application_locale(); std::string ui_lang = TranslateDownloadManager::GetLanguageCode(app_locale); bool is_ui_english = - ui_lang == "en" || base::StartsWithASCII(ui_lang, "en-", false); + ui_lang == "en" || + base::StartsWith(ui_lang, "en-", base::CompareCase::INSENSITIVE_ASCII); for (std::vector<std::string>::const_iterator it = accept_languages.begin(); it != accept_languages.end(); ++it) { diff --git a/components/translate/core/language_detection/language_detection_util.cc b/components/translate/core/language_detection/language_detection_util.cc index 1440714..fe2befe 100644 --- a/components/translate/core/language_detection/language_detection_util.cc +++ b/components/translate/core/language_detection/language_detection_util.cc @@ -198,7 +198,8 @@ bool CanCLDComplementSubCode( // which dialect is used, CLD language has priority. // TODO(hajimehoshi): How about the other dialects like zh-MO? return page_language == "zh" && - base::StartsWithASCII(cld_language, "zh-", false); + base::StartsWith(cld_language, "zh-", + base::CompareCase::INSENSITIVE_ASCII); } } // namespace @@ -381,7 +382,8 @@ bool IsSameOrSimilarLanguages(const std::string& page_language, bool MaybeServerWrongConfiguration(const std::string& page_language, const std::string& cld_language) { // If |page_language| is not "en-*", respect it and just return false here. - if (!base::StartsWithASCII(page_language, "en", false)) + if (!base::StartsWith(page_language, "en", + base::CompareCase::INSENSITIVE_ASCII)) return false; // A server provides a language meta information representing "en-*". But it diff --git a/components/url_fixer/url_fixer.cc b/components/url_fixer/url_fixer.cc index 7c04272..c34ac90 100644 --- a/components/url_fixer/url_fixer.cc +++ b/components/url_fixer/url_fixer.cc @@ -436,8 +436,9 @@ std::string SegmentURLInternal(std::string* text, url::Parsed* parts) { if (!found_scheme) { // Couldn't determine the scheme, so just pick one. parts->scheme.reset(); - scheme = base::StartsWithASCII(*text, "ftp.", false) ? url::kFtpScheme - : url::kHttpScheme; + scheme = base::StartsWith(*text, "ftp.", + base::CompareCase::INSENSITIVE_ASCII) ? + url::kFtpScheme : url::kHttpScheme; } } @@ -528,7 +529,8 @@ GURL url_fixer::FixupURL(const std::string& text, if (scheme == kViewSourceScheme) { // Reject "view-source:view-source:..." to avoid deep recursion. std::string view_source(kViewSourceScheme + std::string(":")); - if (!base::StartsWithASCII(text, view_source + view_source, false)) { + if (!base::StartsWith(text, view_source + view_source, + base::CompareCase::INSENSITIVE_ASCII)) { return GURL(kViewSourceScheme + std::string(":") + FixupURL(trimmed.substr(scheme.length() + 1), desired_tld) .possibly_invalid_spec()); diff --git a/components/user_manager/user_image/default_user_images.cc b/components/user_manager/user_image/default_user_images.cc index d4edf09..58ceacb 100644 --- a/components/user_manager/user_image/default_user_images.cc +++ b/components/user_manager/user_image/default_user_images.cc @@ -79,7 +79,7 @@ bool IsDefaultImageString(const std::string& s, const std::string& prefix, int* image_id) { DCHECK(image_id); - if (!base::StartsWithASCII(s, prefix, true)) + if (!base::StartsWith(s, prefix, base::CompareCase::SENSITIVE)) return false; int image_index = -1; diff --git a/components/variations/net/variations_http_header_provider.cc b/components/variations/net/variations_http_header_provider.cc index 583d77a..f94ad2c 100644 --- a/components/variations/net/variations_http_header_provider.cc +++ b/components/variations/net/variations_http_header_provider.cc @@ -97,7 +97,7 @@ bool VariationsHttpHeaderProvider::SetDefaultVariationIds( default_trigger_id_set_.clear(); return false; } - bool trigger_id = base::StartsWithASCII(*it, "t", true); + bool trigger_id = base::StartsWith(*it, "t", base::CompareCase::SENSITIVE); // Remove the "t" prefix if it's there. std::string entry = trigger_id ? it->substr(1) : *it; |