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

Side by Side Diff: Source/core/frame/csp/CSPSourceList.h

Issue 184343002: Extract MediaListDirective and SourceListDirective from ContentSecurityPolicy. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Feedback Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/csp/CSPDirective.h ('k') | Source/core/frame/csp/CSPSourceList.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 CSPSourceList_h 5 #ifndef CSPSourceList_h
6 #define CSPSourceList_h 6 #define CSPSourceList_h
7 7
8 #include "core/frame/csp/CSPSource.h"
8 #include "platform/network/ContentSecurityPolicyParsers.h" 9 #include "platform/network/ContentSecurityPolicyParsers.h"
9 #include "wtf/HashSet.h" 10 #include "wtf/HashSet.h"
10 #include "wtf/text/WTFString.h" 11 #include "wtf/text/WTFString.h"
11 12
12 namespace WebCore { 13 namespace WebCore {
13 14
14 class ContentSecurityPolicy; 15 class ContentSecurityPolicy;
15 class CSPSource;
16 class KURL; 16 class KURL;
17 17
18 class CSPSourceList { 18 class CSPSourceList {
19 WTF_MAKE_NONCOPYABLE(CSPSourceList); 19 WTF_MAKE_NONCOPYABLE(CSPSourceList);
20 public: 20 public:
21 CSPSourceList(ContentSecurityPolicy*, const String& directiveName); 21 CSPSourceList(ContentSecurityPolicy*, const String& directiveName);
22 22
23 void parse(const UChar* begin, const UChar* end); 23 void parse(const UChar* begin, const UChar* end);
24 24
25 bool matches(const KURL&); 25 bool matches(const KURL&) const;
26 bool allowInline() const; 26 bool allowInline() const;
27 bool allowEval() const; 27 bool allowEval() const;
28 bool allowNonce(const String&) const; 28 bool allowNonce(const String&) const;
29 bool allowHash(const CSPHashValue&) const; 29 bool allowHash(const CSPHashValue&) const;
30 uint8_t hashAlgorithmsUsed() const; 30 uint8_t hashAlgorithmsUsed() const;
31 31
32 bool isHashOrNoncePresent() const; 32 bool isHashOrNoncePresent() const;
33 33
34 private: 34 private:
35 bool parseSource(const UChar* begin, const UChar* end, String& scheme, Strin g& host, int& port, String& path, bool& hostHasWildcard, bool& portHasWildcard); 35 bool parseSource(const UChar* begin, const UChar* end, String& scheme, Strin g& host, int& port, String& path, bool& hostHasWildcard, bool& portHasWildcard);
(...skipping 19 matching lines...) Expand all
55 bool m_allowEval; 55 bool m_allowEval;
56 HashSet<String> m_nonces; 56 HashSet<String> m_nonces;
57 HashSet<CSPHashValue> m_hashes; 57 HashSet<CSPHashValue> m_hashes;
58 uint8_t m_hashAlgorithmsUsed; 58 uint8_t m_hashAlgorithmsUsed;
59 }; 59 };
60 60
61 61
62 } // namespace WebCore 62 } // namespace WebCore
63 63
64 #endif 64 #endif
OLDNEW
« no previous file with comments | « Source/core/frame/csp/CSPDirective.h ('k') | Source/core/frame/csp/CSPSourceList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698