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

Unified Diff: extensions/common/csp_validator.cc

Issue 1242023005: Remove legacy StartsWithASCII function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y 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
« no previous file with comments | « extensions/browser/warning_set.cc ('k') | extensions/common/extension.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/csp_validator.cc
diff --git a/extensions/common/csp_validator.cc b/extensions/common/csp_validator.cc
index a984e3d5c6319b3771be076212a1d1bf162dadeb..1fe22178854f13df8826df4c0e1eea293a353dea 100644
--- a/extensions/common/csp_validator.cc
+++ b/extensions/common/csp_validator.cc
@@ -57,7 +57,8 @@ struct DirectiveStatus {
bool isNonWildcardTLD(const std::string& url,
const std::string& scheme_and_separator,
bool should_check_rcd) {
- if (!base::StartsWithASCII(url, scheme_and_separator, true))
+ if (!base::StartsWith(url, scheme_and_separator,
+ base::CompareCase::SENSITIVE))
return false;
size_t start_of_host = scheme_and_separator.length();
@@ -133,14 +134,17 @@ void GetSecureDirectiveValues(const std::string& directive_name,
base::LowerCaseEqualsASCII(source, "blob:") ||
base::LowerCaseEqualsASCII(source, "filesystem:") ||
base::LowerCaseEqualsASCII(source, "http://localhost") ||
- base::StartsWithASCII(source, "http://127.0.0.1:", true) ||
- base::StartsWithASCII(source, "http://localhost:", true) ||
+ base::StartsWith(source, "http://127.0.0.1:",
+ base::CompareCase::SENSITIVE) ||
+ base::StartsWith(source, "http://localhost:",
+ base::CompareCase::SENSITIVE) ||
isNonWildcardTLD(source, "https://", true) ||
isNonWildcardTLD(source, "chrome://", false) ||
isNonWildcardTLD(source, std::string(extensions::kExtensionScheme) +
url::kStandardSchemeSeparator,
false) ||
- base::StartsWithASCII(source, "chrome-extension-resource:", true)) {
+ base::StartsWith(source, "chrome-extension-resource:",
+ base::CompareCase::SENSITIVE)) {
is_secure_csp_token = true;
} else if ((options & OPTIONS_ALLOW_UNSAFE_EVAL) &&
source == "'unsafe-eval'") {
« no previous file with comments | « extensions/browser/warning_set.cc ('k') | extensions/common/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698