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

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

Issue 954233003: Enable SRI only for same origin and CORS content. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed test failures Created 5 years, 9 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
« no previous file with comments | « Source/core/fetch/ResourceLoaderHost.h ('k') | Source/core/frame/SubresourceIntegrity.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 Document;
17 class Element; 17 class Element;
18 class KURL; 18 class KURL;
19 class Resource;
19 20
20 class SubresourceIntegrity { 21 class SubresourceIntegrity {
21 public: 22 public:
22 static bool CheckSubresourceIntegrity(const Element&, const WTF::String& con tent, const KURL& resourceUrl, const WTF::String& mimeType); 23 static bool CheckSubresourceIntegrity(const Element&, const WTF::String& con tent, const KURL& resourceUrl, const WTF::String& mimeType, const Resource&);
23 24
24 private: 25 private:
25 // FIXME: After the merge with the Chromium repo, this should be refactored 26 // FIXME: After the merge with the Chromium repo, this should be refactored
26 // to use FRIEND_TEST in base/gtest_prod_util.h. 27 // to use FRIEND_TEST in base/gtest_prod_util.h.
27 friend class SubresourceIntegrityTest; 28 friend class SubresourceIntegrityTest;
28 29
29 static bool parseAlgorithm(const UChar*& begin, const UChar* end, HashAlgori thm&); 30 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 static bool parseDigest(const UChar*& begin, const UChar* end, String& diges t);
31 static bool parseMimeType(const UChar*& begin, const UChar* end, String& typ e); 32 static bool parseMimeType(const UChar*& begin, const UChar* end, String& typ e);
32 33
33 static bool parseIntegrityAttribute(const WTF::String& attribute, WTF::Strin g& integrity, HashAlgorithm&, WTF::String& type, Document&); 34 static bool parseIntegrityAttribute(const WTF::String& attribute, WTF::Strin g& integrity, HashAlgorithm&, WTF::String& type, Document&);
34 }; 35 };
35 36
36 } // namespace blink 37 } // namespace blink
37 38
38 #endif 39 #endif
OLDNEW
« no previous file with comments | « Source/core/fetch/ResourceLoaderHost.h ('k') | Source/core/frame/SubresourceIntegrity.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698