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

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

Issue 2401573003: CSP: Fix 'strict-dynamic' with multiple policies. (Closed)
Patch Set: Tests compile. Created 4 years, 2 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.cpp
diff --git a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp
index b83b8399a6cb56c3fe9169ea8f9c767aac78aaba..5f322228b86033265431fb90ee109fcc30ff6cb8 100644
--- a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp
+++ b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp
@@ -520,11 +520,14 @@ bool CSPDirectiveList::allowInlineEventHandlers(
bool CSPDirectiveList::allowInlineScript(
const String& contextURL,
const String& nonce,
+ ParserDisposition parserDisposition,
const WTF::OrdinalNumber& contextLine,
ContentSecurityPolicy::ReportingStatus reportingStatus,
const String& content) const {
if (isMatchingNoncePresent(operativeDirective(m_scriptSrc.get()), nonce))
return true;
+ if (parserDisposition == NotParserInserted && allowDynamic())
+ return true;
if (reportingStatus == ContentSecurityPolicy::SendReport)
return checkInlineAndReportViolation(
operativeDirective(m_scriptSrc.get()),
@@ -584,10 +587,13 @@ bool CSPDirectiveList::allowPluginType(
bool CSPDirectiveList::allowScriptFromSource(
const KURL& url,
const String& nonce,
+ ParserDisposition parserDisposition,
ResourceRequest::RedirectStatus redirectStatus,
ContentSecurityPolicy::ReportingStatus reportingStatus) const {
if (isMatchingNoncePresent(operativeDirective(m_scriptSrc.get()), nonce))
return true;
+ if (parserDisposition == NotParserInserted && allowDynamic())
+ return true;
return reportingStatus == ContentSecurityPolicy::SendReport
? checkSourceAndReportViolation(
operativeDirective(m_scriptSrc.get()), url,

Powered by Google App Engine
This is Rietveld 408576698