| 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 29 matching lines...) Expand all Loading... |
| 40 bool allowInline() const; | 40 bool allowInline() const; |
| 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); |
| 51 |
| 50 bool parseSource(const UChar* begin, | 52 bool parseSource(const UChar* begin, |
| 51 const UChar* end, | 53 const UChar* end, |
| 52 String& scheme, | 54 String& scheme, |
| 53 String& host, | 55 String& host, |
| 54 int& port, | 56 int& port, |
| 55 String& path, | 57 String& path, |
| 56 CSPSource::WildcardDisposition&, | 58 CSPSource::WildcardDisposition&, |
| 57 CSPSource::WildcardDisposition&); | 59 CSPSource::WildcardDisposition&); |
| 58 bool parseScheme(const UChar* begin, const UChar* end, String& scheme); | 60 bool parseScheme(const UChar* begin, const UChar* end, String& scheme); |
| 59 bool parseHost(const UChar* begin, | 61 bool parseHost(const UChar* begin, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 75 void addSourceStar(); | 77 void addSourceStar(); |
| 76 void addSourceUnsafeInline(); | 78 void addSourceUnsafeInline(); |
| 77 void addSourceUnsafeEval(); | 79 void addSourceUnsafeEval(); |
| 78 void addSourceStrictDynamic(); | 80 void addSourceStrictDynamic(); |
| 79 void addSourceUnsafeHashedAttributes(); | 81 void addSourceUnsafeHashedAttributes(); |
| 80 void addSourceNonce(const String& nonce); | 82 void addSourceNonce(const String& nonce); |
| 81 void addSourceHash(const ContentSecurityPolicyHashAlgorithm&, | 83 void addSourceHash(const ContentSecurityPolicyHashAlgorithm&, |
| 82 const DigestValue& hash); | 84 const DigestValue& hash); |
| 83 | 85 |
| 84 bool hasSourceMatchInList(const KURL&, ResourceRequest::RedirectStatus) const; | 86 bool hasSourceMatchInList(const KURL&, ResourceRequest::RedirectStatus) const; |
| 87 HeapVector<Member<CSPSource>> getIntersectCSPSources( |
| 88 HeapVector<Member<CSPSource>> other); |
| 85 | 89 |
| 86 Member<ContentSecurityPolicy> m_policy; | 90 Member<ContentSecurityPolicy> m_policy; |
| 87 HeapVector<Member<CSPSource>> m_list; | 91 HeapVector<Member<CSPSource>> m_list; |
| 88 String m_directiveName; | 92 String m_directiveName; |
| 89 bool m_allowSelf; | 93 bool m_allowSelf; |
| 90 bool m_allowStar; | 94 bool m_allowStar; |
| 91 bool m_allowInline; | 95 bool m_allowInline; |
| 92 bool m_allowEval; | 96 bool m_allowEval; |
| 93 bool m_allowDynamic; | 97 bool m_allowDynamic; |
| 94 bool m_allowHashedAttributes; | 98 bool m_allowHashedAttributes; |
| 95 HashSet<String> m_nonces; | 99 HashSet<String> m_nonces; |
| 96 HashSet<CSPHashValue> m_hashes; | 100 HashSet<CSPHashValue> m_hashes; |
| 97 uint8_t m_hashAlgorithmsUsed; | 101 uint8_t m_hashAlgorithmsUsed; |
| 98 }; | 102 }; |
| 99 | 103 |
| 100 } // namespace blink | 104 } // namespace blink |
| 101 | 105 |
| 102 #endif | 106 #endif |
| OLD | NEW |