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 089c93804adc460dfe6f6d0413e881ac2f9acfa6..119921624da02cdff03ede62c515a9ff99f63e55 100644 |
--- a/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp |
+++ b/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp |
@@ -569,6 +569,21 @@ bool SourceListDirective::hasSourceMatchInList( |
return false; |
} |
+HeapVector<Member<CSPSource>> SourceListDirective::getIntersectCSPSources( |
+ HeapVector<Member<CSPSource>> otherVector) { |
+ HeapVector<Member<CSPSource>> normalized; |
+ for (const auto& aCspSource : m_list) { |
+ Member<CSPSource> matchedCspSource(nullptr); |
+ for (const auto& bCspSource : otherVector) { |
+ if ((matchedCspSource = bCspSource->intersect(aCspSource))) |
+ break; |
+ } |
+ if (matchedCspSource) |
+ normalized.append(matchedCspSource); |
+ } |
+ return normalized; |
+} |
+ |
DEFINE_TRACE(SourceListDirective) { |
visitor->trace(m_policy); |
visitor->trace(m_list); |