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 "platform/Crypto.h" | 8 #include "platform/Crypto.h" |
9 | 9 |
10 namespace WTF { | 10 namespace WTF { |
11 class String; | 11 class String; |
12 }; | 12 }; |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
| 16 class Document; |
16 class Element; | 17 class Element; |
17 class KURL; | 18 class KURL; |
18 | 19 |
19 class SubresourceIntegrity { | 20 class SubresourceIntegrity { |
20 public: | 21 public: |
21 static bool CheckSubresourceIntegrity(const Element&, const WTF::String&, co
nst KURL& resourceUrl); | 22 static bool CheckSubresourceIntegrity(const Element&, const WTF::String&, co
nst KURL& resourceUrl); |
22 | 23 |
23 private: | 24 private: |
24 // FIXME: After the merge with the Chromium repo, this should be refactored | 25 // FIXME: After the merge with the Chromium repo, this should be refactored |
25 // to use FRIEND_TEST in base/gtest_prod_util.h. | 26 // to use FRIEND_TEST in base/gtest_prod_util.h. |
26 friend class SubresourceIntegrityTest_Parsing_Test; | 27 friend class SubresourceIntegrityTest; |
27 | 28 |
28 static bool parseIntegrityAttribute(const WTF::String& attribute, WTF::Strin
g& integrity, HashAlgorithm&); | 29 static bool parseAlgorithm(const UChar*& begin, const UChar* end, HashAlgori
thm&); |
| 30 static bool parseDigest(const UChar*& begin, const UChar* end, String& diges
t); |
| 31 |
| 32 static bool parseIntegrityAttribute(const WTF::String& attribute, WTF::Strin
g& integrity, HashAlgorithm&, Document&); |
29 }; | 33 }; |
30 | 34 |
31 } // namespace blink | 35 } // namespace blink |
32 | 36 |
33 #endif | 37 #endif |
OLD | NEW |