Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Side by Side Diff: Source/core/frame/SubresourceIntegrity.h

Issue 656063002: Subresource Integrity: Improve parsing. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 friend class SubresourceIntegrityTest;
jww 2014/10/15 23:26:04 I still think it would be better to use the gtest_
Mike West 2014/10/16 06:17:21 Done.
25 // to use FRIEND_TEST in base/gtest_prod_util.h.
26 friend class SubresourceIntegrityTest_Parsing_Test;
27 26
28 static bool parseIntegrityAttribute(const WTF::String& attribute, WTF::Strin g& integrity, HashAlgorithm&); 27 static bool parseAlgorithm(const UChar*& begin, const UChar* end, HashAlgori thm&);
28 static bool parseDigest(const UChar*& begin, const UChar* end, String& diges t);
29
30 static bool parseIntegrityAttribute(const WTF::String& attribute, WTF::Strin g& integrity, HashAlgorithm&, Document&);
29 }; 31 };
30 32
31 } // namespace blink 33 } // namespace blink
32 34
33 #endif 35 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698