diff options
author | brettw <brettw@chromium.org> | 2015-07-01 12:26:54 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-01 19:28:35 +0000 |
commit | 94a2cc2c77b73aaaceae5de709c6b453f8fe2c0e (patch) | |
tree | 9326be0be8d8cd7813115464194f0182670e8f3c /net/base/net_util_icu.cc | |
parent | d3cb15365f7cca8be2d794be25be88f6a72771a4 (diff) | |
download | chromium_src-94a2cc2c77b73aaaceae5de709c6b453f8fe2c0e.zip chromium_src-94a2cc2c77b73aaaceae5de709c6b453f8fe2c0e.tar.gz chromium_src-94a2cc2c77b73aaaceae5de709c6b453f8fe2c0e.tar.bz2 |
Fix some case-insensitive cases for StartsWith.
This is not all callers so the old function is not deleted. Most calls are replaced with either StartsWith with the enum, or StartsWith(base::i18n::ToLower(...) for cases that need truely-internationalized case comparison (or when I wasn't sure).
The most interesting case is chrome/installer/util which can't depend on base/i18n and it wants Unicode case-insensitive compares. I replaced these with a call to the Win32 function CompareString
Add a missing protobuf dependency in components/storage_monitor that a try run turned up.
In a few cases there is some related cleanup when I touched code: SplitString calls in experiment_labels.cc (which I've been doing patches to update), for loop in gcapi_omaha_experiment.cc,
In some cases, a ToLower call was pulled out of a loop as in autofill_agent.cc. From this file I also removed a redundant comparison since the code checked it if was equal or a prefix, and a prefix returns true if it's equal.
BUG=506255
Review URL: https://codereview.chromium.org/1220653002
Cr-Commit-Position: refs/heads/master@{#337093}
Diffstat (limited to 'net/base/net_util_icu.cc')
-rw-r--r-- | net/base/net_util_icu.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/base/net_util_icu.cc b/net/base/net_util_icu.cc index 0c2644b..0ece5ea 100644 --- a/net/base/net_util_icu.cc +++ b/net/base/net_util_icu.cc @@ -794,7 +794,8 @@ base::string16 FormatUrlWithAdjustments( // If we need to strip out http do it after the fact. if (omit_http && - base::StartsWith(url_string, base::ASCIIToUTF16(kHTTP), true)) { + base::StartsWith(url_string, base::ASCIIToUTF16(kHTTP), + base::CompareCase::SENSITIVE)) { const size_t kHTTPSize = arraysize(kHTTP) - 1; url_string = url_string.substr(kHTTPSize); // Because offsets in the |adjustments| are already calculated with respect |