| 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 "platform/network/ContentSecurityPolicyParsers.h" | 9 #include "platform/network/ContentSecurityPolicyParsers.h" |
| 9 #include "wtf/HashSet.h" | 10 #include "wtf/HashSet.h" |
| 10 #include "wtf/text/WTFString.h" | 11 #include "wtf/text/WTFString.h" |
| 11 | 12 |
| 12 namespace WebCore { | 13 namespace WebCore { |
| 13 | 14 |
| 14 class ContentSecurityPolicy; | 15 class ContentSecurityPolicy; |
| 15 class CSPSource; | |
| 16 class KURL; | 16 class KURL; |
| 17 | 17 |
| 18 class CSPSourceList { | 18 class CSPSourceList { |
| 19 WTF_MAKE_NONCOPYABLE(CSPSourceList); | 19 WTF_MAKE_NONCOPYABLE(CSPSourceList); |
| 20 public: | 20 public: |
| 21 CSPSourceList(ContentSecurityPolicy*, const String& directiveName); | 21 CSPSourceList(ContentSecurityPolicy*, const String& directiveName); |
| 22 | 22 |
| 23 void parse(const UChar* begin, const UChar* end); | 23 void parse(const UChar* begin, const UChar* end); |
| 24 | 24 |
| 25 bool matches(const KURL&); | 25 bool matches(const KURL&) const; |
| 26 bool allowInline() const; | 26 bool allowInline() const; |
| 27 bool allowEval() const; | 27 bool allowEval() const; |
| 28 bool allowNonce(const String&) const; | 28 bool allowNonce(const String&) const; |
| 29 bool allowHash(const CSPHashValue&) const; | 29 bool allowHash(const CSPHashValue&) const; |
| 30 uint8_t hashAlgorithmsUsed() const; | 30 uint8_t hashAlgorithmsUsed() const; |
| 31 | 31 |
| 32 bool isHashOrNoncePresent() const; | 32 bool isHashOrNoncePresent() const; |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 bool parseSource(const UChar* begin, const UChar* end, String& scheme, Strin
g& host, int& port, String& path, bool& hostHasWildcard, bool& portHasWildcard); | 35 bool parseSource(const UChar* begin, const UChar* end, String& scheme, Strin
g& host, int& port, String& path, bool& hostHasWildcard, bool& portHasWildcard); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 55 bool m_allowEval; | 55 bool m_allowEval; |
| 56 HashSet<String> m_nonces; | 56 HashSet<String> m_nonces; |
| 57 HashSet<CSPHashValue> m_hashes; | 57 HashSet<CSPHashValue> m_hashes; |
| 58 uint8_t m_hashAlgorithmsUsed; | 58 uint8_t m_hashAlgorithmsUsed; |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 | 61 |
| 62 } // namespace WebCore | 62 } // namespace WebCore |
| 63 | 63 |
| 64 #endif | 64 #endif |
| OLD | NEW |