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 SourceListDirective_h | 5 #ifndef SourceListDirective_h |
6 #define SourceListDirective_h | 6 #define SourceListDirective_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/frame/csp/CSPDirective.h" | 9 #include "core/frame/csp/CSPDirective.h" |
10 #include "core/frame/csp/CSPSource.h" | 10 #include "core/frame/csp/CSPSource.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 bool allowEval() const; | 41 bool allowEval() const; |
42 bool allowDynamic() const; | 42 bool allowDynamic() const; |
43 bool allowNonce(const String& nonce) const; | 43 bool allowNonce(const String& nonce) const; |
44 bool allowHash(const CSPHashValue&) const; | 44 bool allowHash(const CSPHashValue&) const; |
45 bool allowHashedAttributes() const; | 45 bool allowHashedAttributes() const; |
46 bool isHashOrNoncePresent() const; | 46 bool isHashOrNoncePresent() const; |
47 uint8_t hashAlgorithmsUsed() const; | 47 uint8_t hashAlgorithmsUsed() const; |
48 | 48 |
49 private: | 49 private: |
50 FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, GetIntersectCSPSources); | 50 FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, GetIntersectCSPSources); |
| 51 FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, |
| 52 GetIntersectCSPSourcesSchemes); |
51 | 53 |
52 bool parseSource(const UChar* begin, | 54 bool parseSource(const UChar* begin, |
53 const UChar* end, | 55 const UChar* end, |
54 String& scheme, | 56 String& scheme, |
55 String& host, | 57 String& host, |
56 int& port, | 58 int& port, |
57 String& path, | 59 String& path, |
58 CSPSource::WildcardDisposition&, | 60 CSPSource::WildcardDisposition&, |
59 CSPSource::WildcardDisposition&); | 61 CSPSource::WildcardDisposition&); |
60 bool parseScheme(const UChar* begin, const UChar* end, String& scheme); | 62 bool parseScheme(const UChar* begin, const UChar* end, String& scheme); |
(...skipping 18 matching lines...) Expand all Loading... |
79 void addSourceUnsafeEval(); | 81 void addSourceUnsafeEval(); |
80 void addSourceStrictDynamic(); | 82 void addSourceStrictDynamic(); |
81 void addSourceUnsafeHashedAttributes(); | 83 void addSourceUnsafeHashedAttributes(); |
82 void addSourceNonce(const String& nonce); | 84 void addSourceNonce(const String& nonce); |
83 void addSourceHash(const ContentSecurityPolicyHashAlgorithm&, | 85 void addSourceHash(const ContentSecurityPolicyHashAlgorithm&, |
84 const DigestValue& hash); | 86 const DigestValue& hash); |
85 | 87 |
86 bool hasSourceMatchInList(const KURL&, ResourceRequest::RedirectStatus) const; | 88 bool hasSourceMatchInList(const KURL&, ResourceRequest::RedirectStatus) const; |
87 HeapVector<Member<CSPSource>> getIntersectCSPSources( | 89 HeapVector<Member<CSPSource>> getIntersectCSPSources( |
88 HeapVector<Member<CSPSource>> other); | 90 HeapVector<Member<CSPSource>> other); |
| 91 HashMap<String, CSPSource*> getIntersectSchemesOnly( |
| 92 HeapVector<Member<CSPSource>> other); |
89 | 93 |
90 Member<ContentSecurityPolicy> m_policy; | 94 Member<ContentSecurityPolicy> m_policy; |
91 HeapVector<Member<CSPSource>> m_list; | 95 HeapVector<Member<CSPSource>> m_list; |
92 String m_directiveName; | 96 String m_directiveName; |
93 bool m_allowSelf; | 97 bool m_allowSelf; |
94 bool m_allowStar; | 98 bool m_allowStar; |
95 bool m_allowInline; | 99 bool m_allowInline; |
96 bool m_allowEval; | 100 bool m_allowEval; |
97 bool m_allowDynamic; | 101 bool m_allowDynamic; |
98 bool m_allowHashedAttributes; | 102 bool m_allowHashedAttributes; |
99 HashSet<String> m_nonces; | 103 HashSet<String> m_nonces; |
100 HashSet<CSPHashValue> m_hashes; | 104 HashSet<CSPHashValue> m_hashes; |
101 uint8_t m_hashAlgorithmsUsed; | 105 uint8_t m_hashAlgorithmsUsed; |
102 }; | 106 }; |
103 | 107 |
104 } // namespace blink | 108 } // namespace blink |
105 | 109 |
106 #endif | 110 #endif |
OLD | NEW |