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 eef9c62fb00e3d4e9e96e65f3443fd979bbb851b..5b5625d989815bc9656598884106cff7f92cf53f 100644 |
--- a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp |
+++ b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp |
@@ -1216,8 +1216,11 @@ SourceListDirectiveVector CSPDirectiveList::getSourceVector( |
const CSPDirectiveListVector& policies) { |
SourceListDirectiveVector sourceListDirectives; |
for (const auto& policy : policies) { |
- if (SourceListDirective* directive = policy->operativeDirective(type)) |
+ if (SourceListDirective* directive = policy->operativeDirective(type)) { |
+ if (directive->isNone()) |
+ return SourceListDirectiveVector(1, directive); |
sourceListDirectives.append(directive); |
+ } |
} |
return sourceListDirectives; |
@@ -1248,7 +1251,7 @@ bool CSPDirectiveList::subsumes(const CSPDirectiveListVector& other) { |
// Embedding-CSP. |
SourceListDirectiveVector requiredList = |
getSourceVector(directive, CSPDirectiveListVector(1, this)); |
- if (requiredList.size() == 0) |
+ if (!requiredList.size()) |
continue; |
SourceListDirective* required = requiredList[0]; |
// Aggregate all serialized source lists of the returned CSP into a vector |