Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: components/url_fixer/url_fixer.cc

Issue 1242023005: Remove legacy StartsWithASCII function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/url_fixer/url_fixer.cc
diff --git a/components/url_fixer/url_fixer.cc b/components/url_fixer/url_fixer.cc
index 7c0427259df22d391779cd54a29e770cea785a61..c34ac90bb9890f34359e2019a729f2041e5502eb 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());

Powered by Google App Engine
This is Rietveld 408576698