Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CSPSource_h | 5 #ifndef CSPSource_h |
| 6 #define CSPSource_h | 6 #define CSPSource_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/frame/csp/ContentSecurityPolicy.h" | 9 #include "core/frame/csp/ContentSecurityPolicy.h" |
| 10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 31 bool matches(const KURL&, | 31 bool matches(const KURL&, |
| 32 ResourceRequest::RedirectStatus = | 32 ResourceRequest::RedirectStatus = |
| 33 ResourceRequest::RedirectStatus::NoRedirect) const; | 33 ResourceRequest::RedirectStatus::NoRedirect) const; |
| 34 | 34 |
| 35 // Returns true if this CSPSource subsumes the other, as defined by the | 35 // Returns true if this CSPSource subsumes the other, as defined by the |
| 36 // algorithm at https://w3c.github.io/webappsec-csp/embedded/#subsume-policy | 36 // algorithm at https://w3c.github.io/webappsec-csp/embedded/#subsume-policy |
| 37 bool subsumes(CSPSource*); | 37 bool subsumes(CSPSource*); |
| 38 // Retrieve the most restrictive information from the two CSPSources if | 38 // Retrieve the most restrictive information from the two CSPSources if |
| 39 // isSimilar is true for the two. Otherwise, return nullptr. | 39 // isSimilar is true for the two. Otherwise, return nullptr. |
| 40 CSPSource* intersect(CSPSource*); | 40 CSPSource* intersect(CSPSource*); |
| 41 static bool firstSubsumesSecond(HeapVector<Member<CSPSource>>, | |
|
Mike West
2016/11/10 15:04:54
Why not just `std::vector<CSPSource*>`?
Also, ple
| |
| 42 HeapVector<Member<CSPSource>>); | |
| 41 | 43 |
| 42 DECLARE_TRACE(); | 44 DECLARE_TRACE(); |
| 43 | 45 |
| 44 private: | 46 private: |
| 45 FRIEND_TEST_ALL_PREFIXES(CSPSourceTest, IsSimilar); | 47 FRIEND_TEST_ALL_PREFIXES(CSPSourceTest, IsSimilar); |
| 46 FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, GetIntersectCSPSources); | 48 FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, GetIntersectCSPSources); |
| 47 | 49 |
| 48 bool schemeMatches(const String&) const; | 50 bool schemeMatches(const String&) const; |
| 49 bool hostMatches(const String&) const; | 51 bool hostMatches(const String&) const; |
| 50 bool pathMatches(const String&) const; | 52 bool pathMatches(const String&) const; |
| 51 // Protocol is necessary to determine default port if it is zero. | 53 // Protocol is necessary to determine default port if it is zero. |
| 52 bool portMatches(int port, const String& protocol) const; | 54 bool portMatches(int port, const String& protocol) const; |
| 53 bool isSchemeOnly() const; | 55 bool isSchemeOnly() const; |
| 54 bool isSimilar(CSPSource* other); | 56 bool isSimilar(CSPSource* other); |
| 55 | 57 |
| 56 Member<ContentSecurityPolicy> m_policy; | 58 Member<ContentSecurityPolicy> m_policy; |
| 57 String m_scheme; | 59 String m_scheme; |
| 58 String m_host; | 60 String m_host; |
| 59 int m_port; | 61 int m_port; |
| 60 String m_path; | 62 String m_path; |
| 61 | 63 |
| 62 WildcardDisposition m_hostWildcard; | 64 WildcardDisposition m_hostWildcard; |
| 63 WildcardDisposition m_portWildcard; | 65 WildcardDisposition m_portWildcard; |
| 64 }; | 66 }; |
| 65 | 67 |
| 66 } // namespace blink | 68 } // namespace blink |
| 67 | 69 |
| 68 #endif | 70 #endif |
| OLD | NEW |