Index: third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp |
diff --git a/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp b/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp |
index 49fc73f111fdcfbcefb2640737c197d7aac7915b..6449cf9579a44c5258469eff9f25375582c74873 100644 |
--- a/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp |
+++ b/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp |
@@ -103,6 +103,12 @@ bool SourceListDirective::allowHashedAttributes() const { |
return m_allowHashedAttributes; |
} |
+bool SourceListDirective::isNone() const { |
+ return !m_list.size() && !m_allowSelf && !m_allowStar && !m_allowInline && |
+ !m_allowHashedAttributes && !m_allowEval && !m_allowDynamic && |
+ !m_nonces.size() && !m_hashes.size(); |
+} |
+ |
uint8_t SourceListDirective::hashAlgorithmsUsed() const { |
return m_hashAlgorithmsUsed; |
} |
@@ -595,8 +601,8 @@ bool SourceListDirective::allowAllInline() { |
bool SourceListDirective::subsumes( |
HeapVector<Member<SourceListDirective>> other) { |
// TODO(amalika): Handle here special keywords. |
- if (!m_list.size() || !other.size()) |
- return !m_list.size(); |
+ if (!other.size() || other[0]->isNone()) |
+ return other.size(); |
HeapVector<Member<CSPSource>> normalizedA = m_list; |
if (m_allowSelf && other[0]->m_policy->getSelfSource()) |