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

Side by Side Diff: extensions/common/csp_validator.cc

Issue 1223153003: Move JoinString to the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: windows 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/common/csp_validator.h" 5 #include "extensions/common/csp_validator.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/strings/string_split.h" 9 #include "base/strings/string_split.h"
10 #include "base/strings/string_tokenizer.h" 10 #include "base/strings/string_tokenizer.h"
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 manifest_errors::kInvalidCSPMissingSecureSrc, kScriptSrc))); 290 manifest_errors::kInvalidCSPMissingSecureSrc, kScriptSrc)));
291 } 291 }
292 if (!object_src_status.seen_in_policy && !allow_insecure_object_src) { 292 if (!object_src_status.seen_in_policy && !allow_insecure_object_src) {
293 sane_csp_parts.push_back(kObjectSrcDefaultDirective); 293 sane_csp_parts.push_back(kObjectSrcDefaultDirective);
294 if (warnings) 294 if (warnings)
295 warnings->push_back(CSPInstallWarning(ErrorUtils::FormatErrorMessage( 295 warnings->push_back(CSPInstallWarning(ErrorUtils::FormatErrorMessage(
296 manifest_errors::kInvalidCSPMissingSecureSrc, kObjectSrc))); 296 manifest_errors::kInvalidCSPMissingSecureSrc, kObjectSrc)));
297 } 297 }
298 } 298 }
299 299
300 return JoinString(sane_csp_parts, ' '); 300 return base::JoinString(sane_csp_parts, " ");
301 } 301 }
302 302
303 bool ContentSecurityPolicyIsSandboxed( 303 bool ContentSecurityPolicyIsSandboxed(
304 const std::string& policy, Manifest::Type type) { 304 const std::string& policy, Manifest::Type type) {
305 // See http://www.w3.org/TR/CSP/#parse-a-csp-policy for parsing algorithm. 305 // See http://www.w3.org/TR/CSP/#parse-a-csp-policy for parsing algorithm.
306 std::vector<std::string> directives; 306 std::vector<std::string> directives;
307 base::SplitString(policy, ';', &directives); 307 base::SplitString(policy, ';', &directives);
308 308
309 bool seen_sandbox = false; 309 bool seen_sandbox = false;
310 310
(...skipping 26 matching lines...) Expand all
337 } 337 }
338 } 338 }
339 } 339 }
340 340
341 return seen_sandbox; 341 return seen_sandbox;
342 } 342 }
343 343
344 } // namespace csp_validator 344 } // namespace csp_validator
345 345
346 } // namespace extensions 346 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/api/sockets/sockets_manifest_permission.cc ('k') | extensions/common/features/base_feature_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698