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/heap/Handle.h" |
11 #include "platform/network/ContentSecurityPolicyParsers.h" | 12 #include "platform/network/ContentSecurityPolicyParsers.h" |
12 #include "wtf/HashSet.h" | 13 #include "wtf/HashSet.h" |
13 #include "wtf/text/WTFString.h" | 14 #include "wtf/text/WTFString.h" |
14 | 15 |
15 namespace blink { | 16 namespace blink { |
16 | 17 |
17 class ContentSecurityPolicy; | 18 class ContentSecurityPolicy; |
18 class KURL; | 19 class KURL; |
19 | 20 |
20 class CORE_EXPORT CSPSourceList { | 21 class CORE_EXPORT CSPSourceList { |
(...skipping 24 matching lines...) Expand all Loading... |
45 | 46 |
46 void addSourceSelf(); | 47 void addSourceSelf(); |
47 void addSourceStar(); | 48 void addSourceStar(); |
48 void addSourceUnsafeInline(); | 49 void addSourceUnsafeInline(); |
49 void addSourceUnsafeEval(); | 50 void addSourceUnsafeEval(); |
50 void addSourceNonce(const String& nonce); | 51 void addSourceNonce(const String& nonce); |
51 void addSourceHash(const ContentSecurityPolicyHashAlgorithm&, const DigestVa
lue& hash); | 52 void addSourceHash(const ContentSecurityPolicyHashAlgorithm&, const DigestVa
lue& hash); |
52 | 53 |
53 bool hasSourceMatchInList(const KURL&, ContentSecurityPolicy::RedirectStatus
) const; | 54 bool hasSourceMatchInList(const KURL&, ContentSecurityPolicy::RedirectStatus
) const; |
54 | 55 |
55 ContentSecurityPolicy* m_policy; | 56 // TODO(Oilpan): consider moving ContentSecurityPolicy auxilliary objects to
the heap. |
| 57 RawPtrWillBeUntracedMember<ContentSecurityPolicy> m_policy; |
56 Vector<CSPSource> m_list; | 58 Vector<CSPSource> m_list; |
57 String m_directiveName; | 59 String m_directiveName; |
58 bool m_allowSelf; | 60 bool m_allowSelf; |
59 bool m_allowStar; | 61 bool m_allowStar; |
60 bool m_allowInline; | 62 bool m_allowInline; |
61 bool m_allowEval; | 63 bool m_allowEval; |
62 HashSet<String> m_nonces; | 64 HashSet<String> m_nonces; |
63 HashSet<CSPHashValue> m_hashes; | 65 HashSet<CSPHashValue> m_hashes; |
64 uint8_t m_hashAlgorithmsUsed; | 66 uint8_t m_hashAlgorithmsUsed; |
65 }; | 67 }; |
66 | 68 |
67 | 69 |
68 } // namespace blink | 70 } // namespace blink |
69 | 71 |
70 #endif | 72 #endif |
OLD | NEW |