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

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

Issue 2562953002: Part 5.2: Is policy list subsumed under subsuming policy? (Closed)
Patch Set: More test cases, removing .get() on members Created 4 years 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/CSPDirectiveList.cpp
diff --git a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp
index f202d21f93fa784410b74e0e3d971ba9f764278b..a262a5edc86865d9159e1f3778b73e098a6e5a37 100644
--- a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp
+++ b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp
@@ -1264,7 +1264,16 @@ bool CSPDirectiveList::subsumes(const CSPDirectiveListVector& other) {
return false;
}
- return true;
+ if (!hasPluginTypes())
+ return true;
+
+ HeapVector<Member<MediaListDirective>> pluginTypesOther;
+ for (const auto& policy : other) {
+ if (policy->hasPluginTypes())
amalika 2016/12/13 14:42:08 Changing to hasPluginTypes()
+ pluginTypesOther.append(policy->m_pluginTypes);
+ }
+
+ return m_pluginTypes->subsumes(pluginTypesOther);
}
DEFINE_TRACE(CSPDirectiveList) {

Powered by Google App Engine
This is Rietveld 408576698