| 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/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/frame/csp/CSPSource.h" | 9 #include "core/frame/csp/CSPSource.h" |
| 10 #include "platform/Crypto.h" | 10 #include "platform/Crypto.h" |
| 11 #include "platform/network/ContentSecurityPolicyParsers.h" | 11 #include "platform/network/ContentSecurityPolicyParsers.h" |
| 12 #include "wtf/HashSet.h" | 12 #include "wtf/HashSet.h" |
| 13 #include "wtf/text/WTFString.h" | 13 #include "wtf/text/WTFString.h" |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 class ContentSecurityPolicy; | 17 class ContentSecurityPolicy; |
| 18 class KURL; | 18 class KURL; |
| 19 | 19 |
| 20 class CORE_EXPORT CSPSourceList { | 20 class CORE_EXPORT CSPSourceList { |
| 21 DISALLOW_ALLOCATION(); |
| 21 WTF_MAKE_NONCOPYABLE(CSPSourceList); | 22 WTF_MAKE_NONCOPYABLE(CSPSourceList); |
| 22 public: | 23 public: |
| 23 CSPSourceList(ContentSecurityPolicy*, const String& directiveName); | 24 CSPSourceList(ContentSecurityPolicy*, const String& directiveName); |
| 24 | 25 |
| 25 void parse(const UChar* begin, const UChar* end); | 26 void parse(const UChar* begin, const UChar* end); |
| 26 | 27 |
| 27 bool matches(const KURL&, ContentSecurityPolicy::RedirectStatus = ContentSec
urityPolicy::DidNotRedirect) const; | 28 bool matches(const KURL&, ContentSecurityPolicy::RedirectStatus = ContentSec
urityPolicy::DidNotRedirect) const; |
| 28 bool allowInline() const; | 29 bool allowInline() const; |
| 29 bool allowEval() const; | 30 bool allowEval() const; |
| 30 bool allowNonce(const String&) const; | 31 bool allowNonce(const String&) const; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 58 bool m_allowEval; | 59 bool m_allowEval; |
| 59 HashSet<String> m_nonces; | 60 HashSet<String> m_nonces; |
| 60 HashSet<CSPHashValue> m_hashes; | 61 HashSet<CSPHashValue> m_hashes; |
| 61 uint8_t m_hashAlgorithmsUsed; | 62 uint8_t m_hashAlgorithmsUsed; |
| 62 }; | 63 }; |
| 63 | 64 |
| 64 | 65 |
| 65 } // namespace blink | 66 } // namespace blink |
| 66 | 67 |
| 67 #endif | 68 #endif |
| OLD | NEW |