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

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

Issue 2487983003: Part 2.3: Is policy list subsumed under subsuming policy? (Closed)
Patch Set: Adding a comment 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/CSPSource.cpp
diff --git a/third_party/WebKit/Source/core/frame/csp/CSPSource.cpp b/third_party/WebKit/Source/core/frame/csp/CSPSource.cpp
index eb38d8933829fba94e2d62753e131e8ee8d820ec..badd121b42fb58f00ff9b7a6fb6336432a1d05e9 100644
--- a/third_party/WebKit/Source/core/frame/csp/CSPSource.cpp
+++ b/third_party/WebKit/Source/core/frame/csp/CSPSource.cpp
@@ -145,6 +145,13 @@ CSPSource* CSPSource::intersect(CSPSource* other) {
return nullptr;
String scheme = other->schemeMatches(m_scheme) ? m_scheme : other->m_scheme;
+ if (isSchemeOnly() || other->isSchemeOnly()) {
+ CSPSource* stricter = isSchemeOnly() ? other : this;
+ return new CSPSource(m_policy, scheme, stricter->m_host, stricter->m_port,
+ stricter->m_path, stricter->m_hostWildcard,
+ stricter->m_portWildcard);
+ }
+
String host = m_hostWildcard == NoWildcard ? m_host : other->m_host;
String path = other->pathMatches(m_path) ? m_path : other->m_path;
int port = (other->m_portWildcard == HasWildcard || !other->m_port)

Powered by Google App Engine
This is Rietveld 408576698