diff options
Diffstat (limited to 'extensions/browser')
-rw-r--r-- | extensions/browser/api/declarative_webrequest/webrequest_condition_attribute.cc | 11 | ||||
-rw-r--r-- | extensions/browser/api/web_request/web_request_permissions.cc | 10 |
2 files changed, 12 insertions, 9 deletions
diff --git a/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute.cc b/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute.cc index 615090a..430a05c 100644 --- a/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute.cc +++ b/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute.cc @@ -330,7 +330,7 @@ class HeaderMatcher { const std::string data_; const MatchType type_; - const bool case_sensitive_; + const base::CompareCase case_sensitive_; DISALLOW_COPY_AND_ASSIGN(StringMatchTest); }; @@ -422,14 +422,14 @@ bool HeaderMatcher::StringMatchTest::Matches( const std::string& str) const { switch (type_) { case kPrefix: - return base::StartsWithASCII(str, data_, case_sensitive_); + return base::StartsWith(str, data_, case_sensitive_); case kSuffix: return base::EndsWith(str, data_, case_sensitive_); case kEquals: return str.size() == data_.size() && - base::StartsWithASCII(str, data_, case_sensitive_); + base::StartsWith(str, data_, case_sensitive_); case kContains: - if (!case_sensitive_) { + if (case_sensitive_ == base::CompareCase::INSENSITIVE_ASCII) { return std::search(str.begin(), str.end(), data_.begin(), data_.end(), CaseInsensitiveCompareASCII<char>()) != str.end(); } else { @@ -446,7 +446,8 @@ HeaderMatcher::StringMatchTest::StringMatchTest(const std::string& data, bool case_sensitive) : data_(data), type_(type), - case_sensitive_(case_sensitive) {} + case_sensitive_(case_sensitive ? base::CompareCase::SENSITIVE + : base::CompareCase::INSENSITIVE_ASCII) {} // HeaderMatcher::HeaderMatchTest implementation. diff --git a/extensions/browser/api/web_request/web_request_permissions.cc b/extensions/browser/api/web_request/web_request_permissions.cc index 2f57d63..fd73304 100644 --- a/extensions/browser/api/web_request/web_request_permissions.cc +++ b/extensions/browser/api/web_request/web_request_permissions.cc @@ -30,12 +30,12 @@ bool IsSensitiveURL(const GURL& url) { const std::string host = url.host(); const char kGoogleCom[] = ".google.com"; const char kClient[] = "clients"; - if (base::EndsWith(host, kGoogleCom, true)) { + if (base::EndsWith(host, kGoogleCom, base::CompareCase::SENSITIVE)) { // Check for "clients[0-9]*.google.com" hosts. // This protects requests to several internal services such as sync, // extension update pings, captive portal detection, fraudulent certificate // reporting, autofill and others. - if (base::StartsWithASCII(host, kClient, true)) { + if (base::StartsWith(host, kClient, base::CompareCase::SENSITIVE)) { bool match = true; for (std::string::const_iterator i = host.begin() + strlen(kClient), end = host.end() - strlen(kGoogleCom); i != end; ++i) { @@ -50,10 +50,12 @@ bool IsSensitiveURL(const GURL& url) { // others. sensitive_chrome_url = sensitive_chrome_url || - base::EndsWith(url.host(), ".clients.google.com", true) || + base::EndsWith(url.host(), ".clients.google.com", + base::CompareCase::SENSITIVE) || url.host() == "sb-ssl.google.com" || (url.host() == "chrome.google.com" && - base::StartsWithASCII(url.path(), "/webstore", true)); + base::StartsWith(url.path(), "/webstore", + base::CompareCase::SENSITIVE)); } GURL::Replacements replacements; replacements.ClearQuery(); |