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

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

Issue 2487983003: Part 2.3: Is policy list subsumed under subsuming policy? (Closed)
Patch Set: Properly handling scheme-source to scheme-source matching 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 119921624da02cdff03ede62c515a9ff99f63e55..0dc7edfe695d0a9dd6408fa42f92f6b20251dff6 100644
--- a/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp
+++ b/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp
@@ -575,8 +575,19 @@ HeapVector<Member<CSPSource>> SourceListDirective::getIntersectCSPSources(
for (const auto& aCspSource : m_list) {
Member<CSPSource> matchedCspSource(nullptr);
for (const auto& bCspSource : otherVector) {
- if ((matchedCspSource = bCspSource->intersect(aCspSource)))
+ if (aCspSource->isSchemeOnly() && bCspSource->isSchemeOnly()) {
Mike West 2016/11/17 10:58:31 Nit: I guess I reviewed this earlier, but looking
+ if (Member<CSPSource> intersection =
+ bCspSource->intersect(aCspSource)) {
+ matchedCspSource = intersection;
+ break;
+ }
+ }
+ if (bCspSource->subsumes(aCspSource)) {
amalika 2016/11/09 17:53:46 We always want to preserve the CSPSource we are cu
+ matchedCspSource = aCspSource;
break;
+ }
+ if (Member<CSPSource> intersection = bCspSource->intersect(aCspSource))
+ matchedCspSource = intersection;
}
if (matchedCspSource)
normalized.append(matchedCspSource);

Powered by Google App Engine
This is Rietveld 408576698