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

Unified Diff: extensions/browser/api/web_request/web_request_permissions.cc

Issue 1233043003: Remove some legacy versions of StartsWith and EndsWith. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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: extensions/browser/api/web_request/web_request_permissions.cc
diff --git a/extensions/browser/api/web_request/web_request_permissions.cc b/extensions/browser/api/web_request/web_request_permissions.cc
index 2f57d63f253ac91ea7c50876f67a9658aba86f0e..fd73304e17ace4cc22c45edd7cf531d7f07b6589 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();
« no previous file with comments | « extensions/browser/api/declarative_webrequest/webrequest_condition_attribute.cc ('k') | extensions/common/user_script.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698