| 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 CSPSourceList_h | 5 #ifndef CSPSourceList_h |
| 6 #define CSPSourceList_h | 6 #define CSPSourceList_h |
| 7 | 7 |
| 8 #include "core/frame/csp/CSPSource.h" | 8 #include "core/frame/csp/CSPSource.h" |
| 9 #include "platform/Crypto.h" | 9 #include "platform/Crypto.h" |
| 10 #include "platform/network/ContentSecurityPolicyParsers.h" | 10 #include "platform/network/ContentSecurityPolicyParsers.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 bool matches(const KURL&) const; | 26 bool matches(const KURL&) const; |
| 27 bool allowInline() const; | 27 bool allowInline() const; |
| 28 bool allowEval() const; | 28 bool allowEval() const; |
| 29 bool allowNonce(const String&) const; | 29 bool allowNonce(const String&) const; |
| 30 bool allowHash(const CSPHashValue&) const; | 30 bool allowHash(const CSPHashValue&) const; |
| 31 uint8_t hashAlgorithmsUsed() const; | 31 uint8_t hashAlgorithmsUsed() const; |
| 32 | 32 |
| 33 bool isHashOrNoncePresent() const; | 33 bool isHashOrNoncePresent() const; |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 bool parseSource(const UChar* begin, const UChar* end, String& scheme, Strin
g& host, int& port, String& path, bool& hostHasWildcard, bool& portHasWildcard); | 36 bool parseSource(const UChar* begin, const UChar* end, String& scheme, Strin
g& host, int& port, String& path, CSPSource::WildcardDisposition&, CSPSource::Wi
ldcardDisposition&); |
| 37 bool parseScheme(const UChar* begin, const UChar* end, String& scheme); | 37 bool parseScheme(const UChar* begin, const UChar* end, String& scheme); |
| 38 bool parseHost(const UChar* begin, const UChar* end, String& host, bool& hos
tHasWildcard); | 38 bool parseHost(const UChar* begin, const UChar* end, String& host, CSPSource
::WildcardDisposition&); |
| 39 bool parsePort(const UChar* begin, const UChar* end, int& port, bool& portHa
sWildcard); | 39 bool parsePort(const UChar* begin, const UChar* end, int& port, CSPSource::W
ildcardDisposition&); |
| 40 bool parsePath(const UChar* begin, const UChar* end, String& path); | 40 bool parsePath(const UChar* begin, const UChar* end, String& path); |
| 41 bool parseNonce(const UChar* begin, const UChar* end, String& nonce); | 41 bool parseNonce(const UChar* begin, const UChar* end, String& nonce); |
| 42 bool parseHash(const UChar* begin, const UChar* end, DigestValue& hash, Cont
entSecurityPolicyHashAlgorithm&); | 42 bool parseHash(const UChar* begin, const UChar* end, DigestValue& hash, Cont
entSecurityPolicyHashAlgorithm&); |
| 43 | 43 |
| 44 void addSourceSelf(); | 44 void addSourceSelf(); |
| 45 void addSourceStar(); | 45 void addSourceStar(); |
| 46 void addSourceUnsafeInline(); | 46 void addSourceUnsafeInline(); |
| 47 void addSourceUnsafeEval(); | 47 void addSourceUnsafeEval(); |
| 48 void addSourceNonce(const String& nonce); | 48 void addSourceNonce(const String& nonce); |
| 49 void addSourceHash(const ContentSecurityPolicyHashAlgorithm&, const DigestVa
lue& hash); | 49 void addSourceHash(const ContentSecurityPolicyHashAlgorithm&, const DigestVa
lue& hash); |
| 50 | 50 |
| 51 ContentSecurityPolicy* m_policy; | 51 ContentSecurityPolicy* m_policy; |
| 52 Vector<CSPSource> m_list; | 52 Vector<CSPSource> m_list; |
| 53 String m_directiveName; | 53 String m_directiveName; |
| 54 bool m_allowSelf; | 54 bool m_allowSelf; |
| 55 bool m_allowStar; | 55 bool m_allowStar; |
| 56 bool m_allowInline; | 56 bool m_allowInline; |
| 57 bool m_allowEval; | 57 bool m_allowEval; |
| 58 HashSet<String> m_nonces; | 58 HashSet<String> m_nonces; |
| 59 HashSet<CSPHashValue> m_hashes; | 59 HashSet<CSPHashValue> m_hashes; |
| 60 uint8_t m_hashAlgorithmsUsed; | 60 uint8_t m_hashAlgorithmsUsed; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 | 63 |
| 64 } // namespace blink | 64 } // namespace blink |
| 65 | 65 |
| 66 #endif | 66 #endif |
| OLD | NEW |