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

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

Issue 2528423002: Part 3.5: Is policy list subsumed under subsuming policy? (Closed)
Patch Set: Removing debugging 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/csp/CSPDirectiveListTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 eef9c62fb00e3d4e9e96e65f3443fd979bbb851b..5b5625d989815bc9656598884106cff7f92cf53f 100644
--- a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp
+++ b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp
@@ -1216,8 +1216,11 @@ SourceListDirectiveVector CSPDirectiveList::getSourceVector(
const CSPDirectiveListVector& policies) {
SourceListDirectiveVector sourceListDirectives;
for (const auto& policy : policies) {
- if (SourceListDirective* directive = policy->operativeDirective(type))
+ if (SourceListDirective* directive = policy->operativeDirective(type)) {
+ if (directive->isNone())
+ return SourceListDirectiveVector(1, directive);
sourceListDirectives.append(directive);
+ }
}
return sourceListDirectives;
@@ -1248,7 +1251,7 @@ bool CSPDirectiveList::subsumes(const CSPDirectiveListVector& other) {
// Embedding-CSP.
SourceListDirectiveVector requiredList =
getSourceVector(directive, CSPDirectiveListVector(1, this));
- if (requiredList.size() == 0)
+ if (!requiredList.size())
continue;
SourceListDirective* required = requiredList[0];
// Aggregate all serialized source lists of the returned CSP into a vector
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/csp/CSPDirectiveListTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698