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..8eda58cb4020d88b8b7cb5c8bd437e3289bf2d64 100644 |
--- a/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp |
+++ b/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp |
@@ -569,6 +569,19 @@ bool SourceListDirective::hasSourceMatchInList( |
return false; |
} |
+bool SourceListDirective::subsumes( |
+ HeapVector<Member<SourceListDirective>> other) { |
+ if (other.size() == 0 || m_allowStar) |
Mike West
2016/11/10 15:04:55
Nit: `!other.size()`
|
+ return m_allowStar; |
+ HeapVector<Member<CSPSource>> aNormalized = other[0]->m_list; |
+ for (size_t i = 1; i < other.size(); i++) { |
+ // TODO(amalika): Handle here special keywords. |
+ aNormalized = other[i]->getIntersectCSPSources(aNormalized); |
+ } |
+ |
+ return CSPSource::firstSubsumesSecond(m_list, aNormalized); |
+} |
+ |
HeapVector<Member<CSPSource>> SourceListDirective::getIntersectCSPSources( |
HeapVector<Member<CSPSource>> otherVector) { |
HeapVector<Member<CSPSource>> normalized; |