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

Unified Diff: third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h

Issue 2006653005: Fix bug where a second CSP without script-src would cause failure (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Address estark's comments Created 4 years, 7 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: third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h
diff --git a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h
index 0f1ded564a052f2492dec655d4bb9b8b84451590..2d8526603ec2884861b66614046accd1b018329a 100644
--- a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h
+++ b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h
@@ -25,6 +25,12 @@ class ContentSecurityPolicy;
class CORE_EXPORT CSPDirectiveList : public GarbageCollectedFinalized<CSPDirectiveList> {
WTF_MAKE_NONCOPYABLE(CSPDirectiveList);
public:
+ enum class NoncePolicyDisposition {
+ NoDirective = 0,
+ Allowed,
+ Denied
+ };
+
static CSPDirectiveList* create(ContentSecurityPolicy*, const UChar* begin, const UChar* end, ContentSecurityPolicyHeaderType, ContentSecurityPolicyHeaderSource);
void parse(const UChar* begin, const UChar* end);
@@ -59,8 +65,8 @@ public:
// because a child frame can't manipulate the URL of a cross-origin
// parent.
bool allowAncestors(LocalFrame*, const KURL&, ContentSecurityPolicy::ReportingStatus) const;
- bool allowScriptNonce(const String&) const;
- bool allowStyleNonce(const String&) const;
+ NoncePolicyDisposition allowScriptNonce(const String&) const;
+ NoncePolicyDisposition allowStyleNonce(const String&) const;
bool allowScriptHash(const CSPHashValue&, ContentSecurityPolicy::InlineType) const;
bool allowStyleHash(const CSPHashValue&, ContentSecurityPolicy::InlineType) const;
bool allowDynamic() const;

Powered by Google App Engine
This is Rietveld 408576698