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

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

Issue 2442513004: Part 1.1: Is policy list subsumed under subsuming policy? (Closed)
Patch Set: Separating functionalities Created 4 years, 2 months 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.h
diff --git a/third_party/WebKit/Source/core/frame/csp/CSPSource.h b/third_party/WebKit/Source/core/frame/csp/CSPSource.h
index d7295244feed27c8b4ac7bf5a0e9e0c5100e549c..796a8f75756949df7ec60791d037fe4d16669d05 100644
--- a/third_party/WebKit/Source/core/frame/csp/CSPSource.h
+++ b/third_party/WebKit/Source/core/frame/csp/CSPSource.h
@@ -31,6 +31,9 @@ class CORE_EXPORT CSPSource : public GarbageCollectedFinalized<CSPSource> {
bool matches(const KURL&,
ResourceRequest::RedirectStatus =
ResourceRequest::RedirectStatus::NoRedirect) const;
+ bool isSubsumed(CSPSource*);
Mike West 2016/10/26 11:40:30 Nit: Please add a comment here, and probably point
+ // Find the normalized CSPSource of the two.
Mike West 2016/10/26 11:40:30 1. What does "normalize" mean? 2. It would be grea
+ CSPSource* getCommon(CSPSource*);
DECLARE_TRACE();
@@ -41,6 +44,13 @@ class CORE_EXPORT CSPSource : public GarbageCollectedFinalized<CSPSource> {
bool portMatches(const KURL&) const;
bool isSchemeOnly() const;
+ bool schemeMatches(const String&) const;
+ bool hostMatches(const String&) const;
+ bool pathMatches(const String&) const;
+ bool portMatches(int, const String&) const;
Mike West 2016/10/26 11:40:30 Would you mind pulling this refactoring out into a
+
+ bool isSimilar(CSPSource* other);
Mike West 2016/10/26 11:40:30 It's probably worth adding unit tests for this pie
+
Member<ContentSecurityPolicy> m_policy;
String m_scheme;
String m_host;

Powered by Google App Engine
This is Rietveld 408576698