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 | 10 |
11 namespace WTF { | 11 namespace WTF { |
12 class String; | 12 class String; |
13 }; | 13 }; |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 | 16 |
17 class Document; | 17 class Document; |
18 class Element; | 18 class Element; |
19 class KURL; | 19 class KURL; |
20 class Resource; | 20 class Resource; |
21 | 21 |
22 class CORE_EXPORT SubresourceIntegrity { | 22 class CORE_EXPORT SubresourceIntegrity { |
23 public: | 23 public: |
24 enum IntegrityParseResult { | 24 enum IntegrityParseResult { |
25 IntegrityParseValidResult, | 25 IntegrityParseValidResult, |
26 IntegrityParseNoValidResult | 26 IntegrityParseNoValidResult |
27 }; | 27 }; |
28 | 28 |
29 static bool CheckSubresourceIntegrity(const Element&, const WTF::String& con
tent, const KURL& resourceUrl, const Resource&); | 29 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&); |
30 | 31 |
31 private: | 32 private: |
32 // FIXME: After the merge with the Chromium repo, this should be refactored | 33 // FIXME: After the merge with the Chromium repo, this should be refactored |
33 // to use FRIEND_TEST in base/gtest_prod_util.h. | 34 // to use FRIEND_TEST in base/gtest_prod_util.h. |
34 friend class SubresourceIntegrityTest; | 35 friend class SubresourceIntegrityTest; |
35 friend class SubresourceIntegrityTest_Parsing_Test; | 36 friend class SubresourceIntegrityTest_Parsing_Test; |
36 friend class SubresourceIntegrityTest_ParseAlgorithm_Test; | 37 friend class SubresourceIntegrityTest_ParseAlgorithm_Test; |
37 friend class SubresourceIntegrityTest_Prioritization_Test; | 38 friend class SubresourceIntegrityTest_Prioritization_Test; |
38 | 39 |
39 enum AlgorithmParseResult { | 40 enum AlgorithmParseResult { |
(...skipping 10 matching lines...) Expand all Loading... |
50 static HashAlgorithm getPrioritizedHashFunction(HashAlgorithm, HashAlgorithm
); | 51 static HashAlgorithm getPrioritizedHashFunction(HashAlgorithm, HashAlgorithm
); |
51 static AlgorithmParseResult parseAlgorithm(const UChar*& begin, const UChar*
end, HashAlgorithm&); | 52 static AlgorithmParseResult parseAlgorithm(const UChar*& begin, const UChar*
end, HashAlgorithm&); |
52 static bool parseDigest(const UChar*& begin, const UChar* end, String& diges
t); | 53 static bool parseDigest(const UChar*& begin, const UChar* end, String& diges
t); |
53 | 54 |
54 static IntegrityParseResult parseIntegrityAttribute(const WTF::String& attri
bute, WTF::Vector<IntegrityMetadata>& metadataList, Document&); | 55 static IntegrityParseResult parseIntegrityAttribute(const WTF::String& attri
bute, WTF::Vector<IntegrityMetadata>& metadataList, Document&); |
55 }; | 56 }; |
56 | 57 |
57 } // namespace blink | 58 } // namespace blink |
58 | 59 |
59 #endif | 60 #endif |
OLD | NEW |