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

Unified Diff: net/base/net_util_icu.cc

Issue 1215933004: New new versions of Starts/EndsWith and SplitString in net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@starts_with
Patch Set: 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: net/base/net_util_icu.cc
diff --git a/net/base/net_util_icu.cc b/net/base/net_util_icu.cc
index 0ece5eac227c5a965f2608d225ec8a56b6c7b4ba..259baba33bd41ef781afe121579857c95b602dc2 100644
--- a/net/base/net_util_icu.cc
+++ b/net/base/net_util_icu.cc
@@ -679,8 +679,8 @@ base::string16 FormatUrlWithAdjustments(
// Reject "view-source:view-source:..." to avoid deep recursion.
const char kViewSourceTwice[] = "view-source:view-source:";
if (url.SchemeIs(kViewSource) &&
- !base::StartsWithASCII(url.possibly_invalid_spec(), kViewSourceTwice,
- false)) {
+ !base::StartsWith(url.possibly_invalid_spec(), kViewSourceTwice,
+ base::CompareCase::INSENSITIVE_ASCII)) {
return FormatViewSourceUrl(url, languages, format_types,
unescape_rules, new_parsed, prefix_end,
adjustments);
@@ -704,9 +704,10 @@ base::string16 FormatUrlWithAdjustments(
// all input fields), the meaning would be changed. (In fact, often the
// formatted URL is directly pre-filled into an input field.) For this reason
// we avoid stripping "http://" in this case.
- bool omit_http = (format_types & kFormatUrlOmitHTTP) &&
- base::EqualsASCII(url_string, kHTTP) &&
- !base::StartsWithASCII(url.host(), kFTP, true);
+ bool omit_http =
+ (format_types & kFormatUrlOmitHTTP) &&
+ base::EqualsASCII(url_string, kHTTP) &&
+ !base::StartsWith(url.host(), kFTP, base::CompareCase::SENSITIVE);
new_parsed->scheme = parsed.scheme;
// Username & password.

Powered by Google App Engine
This is Rietveld 408576698