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

Unified Diff: extensions/common/csp_validator.cc

Issue 1278973003: Revert of Update SplitString calls to new form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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/common/csp_validator.cc
diff --git a/extensions/common/csp_validator.cc b/extensions/common/csp_validator.cc
index d19b983b9e722e0a81924cb71a6e765ad7313573..1fe22178854f13df8826df4c0e1eea293a353dea 100644
--- a/extensions/common/csp_validator.cc
+++ b/extensions/common/csp_validator.cc
@@ -240,8 +240,8 @@
int options,
std::vector<InstallWarning>* warnings) {
// See http://www.w3.org/TR/CSP/#parse-a-csp-policy for parsing algorithm.
- std::vector<std::string> directives = base::SplitString(
- policy, ";", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
+ std::vector<std::string> directives;
+ base::SplitString(policy, ';', &directives);
DirectiveStatus default_src_status(kDefaultSrc);
DirectiveStatus script_src_status(kScriptSrc);
@@ -307,9 +307,13 @@
bool ContentSecurityPolicyIsSandboxed(
const std::string& policy, Manifest::Type type) {
// See http://www.w3.org/TR/CSP/#parse-a-csp-policy for parsing algorithm.
+ std::vector<std::string> directives;
+ base::SplitString(policy, ';', &directives);
+
bool seen_sandbox = false;
- for (const std::string& input : base::SplitString(
- policy, ";", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) {
+
+ for (size_t i = 0; i < directives.size(); ++i) {
+ std::string& input = directives[i];
base::StringTokenizer tokenizer(input, " \t\r\n");
if (!tokenizer.GetNext())
continue;

Powered by Google App Engine
This is Rietveld 408576698