Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Unified Diff: third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp

Issue 2470083002: Part 2.1: Is policy list subsumed under subsuming policy? (Closed)
Patch Set: Rebasing on master Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698