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

Unified Diff: chrome/browser/enumerate_modules_model_win.cc

Issue 1220653002: Fix some case-insensitive cases for StartsWith (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: grt's review comments, Mac fix Created 5 years, 6 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
« no previous file with comments | « no previous file | chrome/common/variations/experiment_labels.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/enumerate_modules_model_win.cc
diff --git a/chrome/browser/enumerate_modules_model_win.cc b/chrome/browser/enumerate_modules_model_win.cc
index 4a23e1ddf37a4f7bcb0721a4dd221cf97e8bb83f..acfecc03cf05c225e4d7479e0e9c93e6797bf071 100644
--- a/chrome/browser/enumerate_modules_model_win.cc
+++ b/chrome/browser/enumerate_modules_model_win.cc
@@ -689,8 +689,10 @@ void ModuleEnumerator::CollapsePath(Module* entry) {
base::string16 location = entry->location;
for (PathMapping::const_iterator mapping = path_mapping_.begin();
mapping != path_mapping_.end(); ++mapping) {
- base::string16 prefix = mapping->first;
- if (base::StartsWith(location, prefix, false)) {
+ const base::string16& prefix = mapping->first;
+ if (base::StartsWith(base::i18n::ToLower(location),
+ base::i18n::ToLower(prefix),
+ base::CompareCase::SENSITIVE)) {
base::string16 new_location = mapping->second +
location.substr(prefix.length() - 1);
size_t length = new_location.length() - mapping->second.length();
@@ -734,8 +736,10 @@ void ModuleEnumerator::MatchAgainstBlacklist() {
// for blacklisting individually. Mark them as suspicious if we haven't
// classified them as bad yet.
if (module->status == NOT_MATCHED || module->status == GOOD) {
- if (base::StartsWith(module->location, L"%temp%", false) ||
- base::StartsWith(module->location, L"%tmp%", false)) {
+ if (base::StartsWith(module->location, L"%temp%",
+ base::CompareCase::INSENSITIVE_ASCII) ||
+ base::StartsWith(module->location, L"%tmp%",
+ base::CompareCase::INSENSITIVE_ASCII)) {
module->status = SUSPECTED_BAD;
}
}
« no previous file with comments | « no previous file | chrome/common/variations/experiment_labels.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698