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

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

Issue 1923273002: CSP: Allow hashed inline event handlers only with 'unsafe-hashed-attributes' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/ContentSecurityPolicy.h
diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.h b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.h
index 2e410f6762c0e130527f12d576d01020407d981b..f9e2466d95675d1a93b71e7a8f64bfc3863f3baa 100644
--- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.h
+++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.h
@@ -129,6 +129,11 @@ public:
URLViolation
};
+ enum class InlineType {
+ Block,
+ Attribute
+ };
+
static ContentSecurityPolicy* create()
{
return new ContentSecurityPolicy();
@@ -146,7 +151,7 @@ public:
PassOwnPtr<Vector<CSPHeaderAndType>> headers() const;
bool allowJavaScriptURLs(const String& contextURL, const WTF::OrdinalNumber& contextLine, ReportingStatus = SendReport) const;
- bool allowInlineEventHandlers(const String& contextURL, const WTF::OrdinalNumber& contextLine, ReportingStatus = SendReport) const;
+ bool allowInlineEventHandler(const String& source, const String& contextURL, const WTF::OrdinalNumber& contextLine, ReportingStatus = SendReport) const;
bool allowInlineScript(const String& contextURL, const WTF::OrdinalNumber& contextLine, const String& scriptContent, ReportingStatus = SendReport) const;
bool allowInlineStyle(const String& contextURL, const WTF::OrdinalNumber& contextLine, const String& styleContent, ReportingStatus = SendReport) const;
// When the reporting status is |SendReport|, the |ExceptionStatus|
@@ -193,8 +198,8 @@ public:
// issue a load and be safe disabling any further CSP checks.
bool allowScriptWithNonce(const String& nonce) const;
bool allowStyleWithNonce(const String& nonce) const;
- bool allowScriptWithHash(const String& source) const;
- bool allowStyleWithHash(const String& source) const;
+ bool allowScriptWithHash(const String& source, InlineType) const;
+ bool allowStyleWithHash(const String& source, InlineType) const;
bool allowRequest(WebURLRequest::RequestContext, const KURL&, RedirectStatus = DidNotRedirect, ReportingStatus = SendReport) const;

Powered by Google App Engine
This is Rietveld 408576698