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 b049bf6c87966def6e30c4eb3fb72696f106021d..450b56a948f5febb3768a8c477af9a1ea8132f60 100644 |
| --- a/third_party/WebKit/Source/core/frame/csp/CSPSource.h |
| +++ b/third_party/WebKit/Source/core/frame/csp/CSPSource.h |
| @@ -31,16 +31,32 @@ 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 |
|
jochen (gone - plz use gerrit)
2016/11/02 11:11:33
nit. add empty line before this one
|
| + // subsumption algorithm described here: |
| + // https://w3c.github.io/webappsec-csp/embedded/#subsume-policy |
| + bool isSubsumedBy(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; |
| // Protocol is necessary to determine default port if it is zero. |
| bool portMatches(int port, const String& protocol) 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 |
|
jochen (gone - plz use gerrit)
2016/11/02 11:11:33
if you put links in the source, please make this a
|
| + bool isSimilar(CSPSource* other); |
| + |
| + bool isWildcardsSubsumedBy(CSPSource* other); |
|
jochen (gone - plz use gerrit)
2016/11/02 11:11:33
isWildcard or areWildcards
|
| + bool isSchemeSubsumedBy(CSPSource* other); |
| + bool isPortSubsumedBy(CSPSource* other); |
| + bool isPathSubsumedBy(CSPSource* other); |
| Member<ContentSecurityPolicy> m_policy; |
| String m_scheme; |