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 SubresourceIntegrity_h | 5 #ifndef SubresourceIntegrity_h |
6 #define SubresourceIntegrity_h | 6 #define SubresourceIntegrity_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "platform/Crypto.h" | 9 #include "platform/Crypto.h" |
| 10 #include "wtf/Allocator.h" |
10 | 11 |
11 namespace WTF { | 12 namespace WTF { |
12 class String; | 13 class String; |
13 }; | 14 }; |
14 | 15 |
15 namespace blink { | 16 namespace blink { |
16 | 17 |
17 class Document; | 18 class Document; |
18 class Element; | 19 class Element; |
19 class KURL; | 20 class KURL; |
20 class Resource; | 21 class Resource; |
21 | 22 |
22 class CORE_EXPORT SubresourceIntegrity { | 23 class CORE_EXPORT SubresourceIntegrity { |
| 24 STATIC_ONLY(SubresourceIntegrity); |
23 public: | 25 public: |
24 enum IntegrityParseResult { | 26 enum IntegrityParseResult { |
25 IntegrityParseValidResult, | 27 IntegrityParseValidResult, |
26 IntegrityParseNoValidResult | 28 IntegrityParseNoValidResult |
27 }; | 29 }; |
28 | 30 |
29 static bool CheckSubresourceIntegrity(const Element&, const WTF::String& con
tent, const KURL& resourceUrl, const Resource&); | 31 static bool CheckSubresourceIntegrity(const Element&, const WTF::String& con
tent, const KURL& resourceUrl, const Resource&); |
30 static bool CheckSubresourceIntegrity(const String&, const WTF::String& cont
ent, const KURL& resourceUrl, Document&, WTF::String&); | 32 static bool CheckSubresourceIntegrity(const String&, const WTF::String& cont
ent, const KURL& resourceUrl, Document&, WTF::String&); |
31 | 33 |
32 private: | 34 private: |
(...skipping 18 matching lines...) Expand all Loading... |
51 static HashAlgorithm getPrioritizedHashFunction(HashAlgorithm, HashAlgorithm
); | 53 static HashAlgorithm getPrioritizedHashFunction(HashAlgorithm, HashAlgorithm
); |
52 static AlgorithmParseResult parseAlgorithm(const UChar*& begin, const UChar*
end, HashAlgorithm&); | 54 static AlgorithmParseResult parseAlgorithm(const UChar*& begin, const UChar*
end, HashAlgorithm&); |
53 static bool parseDigest(const UChar*& begin, const UChar* end, String& diges
t); | 55 static bool parseDigest(const UChar*& begin, const UChar* end, String& diges
t); |
54 | 56 |
55 static IntegrityParseResult parseIntegrityAttribute(const WTF::String& attri
bute, WTF::Vector<IntegrityMetadata>& metadataList, Document&); | 57 static IntegrityParseResult parseIntegrityAttribute(const WTF::String& attri
bute, WTF::Vector<IntegrityMetadata>& metadataList, Document&); |
56 }; | 58 }; |
57 | 59 |
58 } // namespace blink | 60 } // namespace blink |
59 | 61 |
60 #endif | 62 #endif |
OLD | NEW |