Chromium Code Reviews| 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 8b4f56a8cd2dd52cc361c3fa09aca2de1441474c..b15695222e44f06b606878beb0868751bf8471d4 100644 |
| --- a/third_party/WebKit/Source/core/frame/csp/CSPSource.h |
| +++ b/third_party/WebKit/Source/core/frame/csp/CSPSource.h |
| @@ -31,15 +31,34 @@ class CORE_EXPORT CSPSource : public GarbageCollectedFinalized<CSPSource> { |
| bool matches(const KURL&, |
| ResourceRequest::RedirectStatus = |
| ResourceRequest::RedirectStatus::NoRedirect) const; |
| + // Check whether this CSPSource is subsumed under a given CSPSource for a |
| + // subsumption algorithm described here: |
| + // https://w3c.github.io/webappsec-csp/embedded/#subsume-policy |
| + bool isSubsumedBy(CSPSource*); |
| + // Retrieve the most common information from the two CSPSources if isSimilar |
| + // is true for the two. Otherwise, return nullptr. |
| + CSPSource* getCommon(CSPSource*); |
| DECLARE_TRACE(); |
| private: |
| + FRIEND_TEST_ALL_PREFIXES(CSPSourceTest, IsSimilar); |
| + |
| bool schemeMatches(const String&) const; |
| bool hostMatches(const String&) const; |
| bool pathMatches(const String&) const; |
| bool portMatches(int, const String&) const; |
| bool isSchemeOnly() const; |
| + bool isPathEmptyOrSlashOnly() const; |
| + // Check if either one of the two matches the scheme, host, port, path of the |
| + // other. More detailed explanation here: |
| + // https://docs.google.com/document/d/1xwTxpB_sWYaTrOBJEPSXtfWKO4M2k9Xya7o0zcd6Dec/edit#heading=h.9efhej5pg0hj |
|
Mike West
2016/11/04 09:48:10
1. This needs to be a publicly accessible link. `g
|
| + bool isSimilar(CSPSource* other); |
| + |
| + bool isWildcardsSubsumedBy(CSPSource* other); |
| + bool isSchemeSubsumedBy(CSPSource* other); |
| + bool isPortSubsumedBy(CSPSource* other); |
| + bool isPathSubsumedBy(CSPSource* other); |
| Member<ContentSecurityPolicy> m_policy; |
| String m_scheme; |