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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // Returns true if the first list subsumes the second, as defined by the | 43 // Returns true if the first list subsumes the second, as defined by the |
44 // algorithm at | 44 // algorithm at |
45 // https://w3c.github.io/webappsec-csp/embedded/#subsume-source-list | 45 // https://w3c.github.io/webappsec-csp/embedded/#subsume-source-list |
46 static bool firstSubsumesSecond(HeapVector<Member<CSPSource>>, | 46 static bool firstSubsumesSecond(HeapVector<Member<CSPSource>>, |
47 HeapVector<Member<CSPSource>>); | 47 HeapVector<Member<CSPSource>>); |
48 | 48 |
49 DECLARE_TRACE(); | 49 DECLARE_TRACE(); |
50 | 50 |
51 private: | 51 private: |
52 FRIEND_TEST_ALL_PREFIXES(CSPSourceTest, IsSimilar); | 52 FRIEND_TEST_ALL_PREFIXES(CSPSourceTest, IsSimilar); |
| 53 FRIEND_TEST_ALL_PREFIXES(CSPSourceTest, Intersect); |
| 54 FRIEND_TEST_ALL_PREFIXES(CSPSourceTest, IntersectSchemesOnly); |
53 FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, GetIntersectCSPSources); | 55 FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, GetIntersectCSPSources); |
54 FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, | 56 FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, |
55 GetIntersectCSPSourcesSchemes); | 57 GetIntersectCSPSourcesSchemes); |
56 FRIEND_TEST_ALL_PREFIXES(CSPSourceTest, Intersect); | 58 FRIEND_TEST_ALL_PREFIXES(CSPDirectiveListTest, GetSourceVector); |
57 FRIEND_TEST_ALL_PREFIXES(CSPSourceTest, IntersectSchemesOnly); | 59 FRIEND_TEST_ALL_PREFIXES(CSPDirectiveListTest, OperativeDirectiveGivenType); |
58 | 60 |
59 bool schemeMatches(const String&) const; | 61 bool schemeMatches(const String&) const; |
60 bool hostMatches(const String&) const; | 62 bool hostMatches(const String&) const; |
61 bool pathMatches(const String&) const; | 63 bool pathMatches(const String&) const; |
62 // Protocol is necessary to determine default port if it is zero. | 64 // Protocol is necessary to determine default port if it is zero. |
63 bool portMatches(int port, const String& protocol) const; | 65 bool portMatches(int port, const String& protocol) const; |
64 bool isSimilar(CSPSource* other); | 66 bool isSimilar(CSPSource* other); |
65 | 67 |
66 Member<ContentSecurityPolicy> m_policy; | 68 Member<ContentSecurityPolicy> m_policy; |
67 String m_scheme; | 69 String m_scheme; |
68 String m_host; | 70 String m_host; |
69 int m_port; | 71 int m_port; |
70 String m_path; | 72 String m_path; |
71 | 73 |
72 WildcardDisposition m_hostWildcard; | 74 WildcardDisposition m_hostWildcard; |
73 WildcardDisposition m_portWildcard; | 75 WildcardDisposition m_portWildcard; |
74 }; | 76 }; |
75 | 77 |
76 } // namespace blink | 78 } // namespace blink |
77 | 79 |
78 #endif | 80 #endif |
OLD | NEW |