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 119921624da02cdff03ede62c515a9ff99f63e55..888a95f4d9d551d1ff86ab3386917b2d380d48a0 100644 |
--- a/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp |
+++ b/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp |
@@ -569,6 +569,20 @@ bool SourceListDirective::hasSourceMatchInList( |
return false; |
} |
+bool SourceListDirective::subsumes( |
+ HeapVector<Member<SourceListDirective>> other) { |
+ // TODO(amalika): Handle here special keywords. |
+ if (!m_list.size() || !other.size()) |
+ return !m_list.size(); |
+ |
+ HeapVector<Member<CSPSource>> normalizedA = other[0]->m_list; |
+ for (size_t i = 1; i < other.size(); i++) { |
+ normalizedA = other[i]->getIntersectCSPSources(normalizedA); |
+ } |
+ |
+ return CSPSource::firstSubsumesSecond(m_list, normalizedA); |
+} |
+ |
HeapVector<Member<CSPSource>> SourceListDirective::getIntersectCSPSources( |
HeapVector<Member<CSPSource>> otherVector) { |
HeapVector<Member<CSPSource>> normalized; |