| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // The algorothm is described more extensively here: | 51 // The algorothm is described more extensively here: |
| 52 // https://w3c.github.io/webappsec-csp/embedded/#subsume-source-list | 52 // https://w3c.github.io/webappsec-csp/embedded/#subsume-source-list |
| 53 bool subsumes(const HeapVector<Member<SourceListDirective>>&) const; | 53 bool subsumes(const HeapVector<Member<SourceListDirective>>&) const; |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, GetIntersectCSPSources); | 56 FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, GetIntersectCSPSources); |
| 57 FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, | 57 FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, |
| 58 GetIntersectCSPSourcesSchemes); | 58 GetIntersectCSPSourcesSchemes); |
| 59 FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, GetIntersectNonces); | 59 FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, GetIntersectNonces); |
| 60 FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, GetIntersectHashes); | 60 FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, GetIntersectHashes); |
| 61 FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, GetSources); |
| 61 FRIEND_TEST_ALL_PREFIXES(CSPDirectiveListTest, GetSourceVector); | 62 FRIEND_TEST_ALL_PREFIXES(CSPDirectiveListTest, GetSourceVector); |
| 62 FRIEND_TEST_ALL_PREFIXES(CSPDirectiveListTest, OperativeDirectiveGivenType); | 63 FRIEND_TEST_ALL_PREFIXES(CSPDirectiveListTest, OperativeDirectiveGivenType); |
| 63 | 64 |
| 64 bool parseSource(const UChar* begin, | 65 bool parseSource(const UChar* begin, |
| 65 const UChar* end, | 66 const UChar* end, |
| 66 String& scheme, | 67 String& scheme, |
| 67 String& host, | 68 String& host, |
| 68 int& port, | 69 int& port, |
| 69 String& path, | 70 String& path, |
| 70 CSPSource::WildcardDisposition&, | 71 CSPSource::WildcardDisposition&, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 101 bool hasSourceMatchInList(const KURL&, ResourceRequest::RedirectStatus) const; | 102 bool hasSourceMatchInList(const KURL&, ResourceRequest::RedirectStatus) const; |
| 102 HashSet<String> getIntersectNonces(const HashSet<String>& other) const; | 103 HashSet<String> getIntersectNonces(const HashSet<String>& other) const; |
| 103 HashSet<CSPHashValue> getIntersectHashes( | 104 HashSet<CSPHashValue> getIntersectHashes( |
| 104 const HashSet<CSPHashValue>& other) const; | 105 const HashSet<CSPHashValue>& other) const; |
| 105 HeapVector<Member<CSPSource>> getIntersectCSPSources( | 106 HeapVector<Member<CSPSource>> getIntersectCSPSources( |
| 106 const HeapVector<Member<CSPSource>>& other) const; | 107 const HeapVector<Member<CSPSource>>& other) const; |
| 107 HeapHashMap<String, Member<CSPSource>> getIntersectSchemesOnly( | 108 HeapHashMap<String, Member<CSPSource>> getIntersectSchemesOnly( |
| 108 const HeapVector<Member<CSPSource>>& other) const; | 109 const HeapVector<Member<CSPSource>>& other) const; |
| 109 bool subsumesNoncesAndHashes(const HashSet<String>& nonces, | 110 bool subsumesNoncesAndHashes(const HashSet<String>& nonces, |
| 110 const HashSet<CSPHashValue> hashes) const; | 111 const HashSet<CSPHashValue> hashes) const; |
| 112 HeapVector<Member<CSPSource>> getSources(Member<CSPSource>) const; |
| 111 | 113 |
| 112 Member<ContentSecurityPolicy> m_policy; | 114 Member<ContentSecurityPolicy> m_policy; |
| 113 HeapVector<Member<CSPSource>> m_list; | 115 HeapVector<Member<CSPSource>> m_list; |
| 114 String m_directiveName; | 116 String m_directiveName; |
| 115 bool m_allowSelf; | 117 bool m_allowSelf; |
| 116 bool m_allowStar; | 118 bool m_allowStar; |
| 117 bool m_allowInline; | 119 bool m_allowInline; |
| 118 bool m_allowEval; | 120 bool m_allowEval; |
| 119 bool m_allowDynamic; | 121 bool m_allowDynamic; |
| 120 bool m_allowHashedAttributes; | 122 bool m_allowHashedAttributes; |
| 121 HashSet<String> m_nonces; | 123 HashSet<String> m_nonces; |
| 122 HashSet<CSPHashValue> m_hashes; | 124 HashSet<CSPHashValue> m_hashes; |
| 123 uint8_t m_hashAlgorithmsUsed; | 125 uint8_t m_hashAlgorithmsUsed; |
| 124 }; | 126 }; |
| 125 | 127 |
| 126 } // namespace blink | 128 } // namespace blink |
| 127 | 129 |
| 128 #endif | 130 #endif |
| OLD | NEW |