Chromium Code Reviews| 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 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 "core/frame/csp/CSPSource.h" |
| 9 #include "platform/CryptoUtilities.h" | |
|
abarth-chromium
2014/03/12 18:59:02
Yeah, I agree with Eric. Drop the "Utilities". I
jww
2014/04/01 23:29:09
Done.
| |
| 9 #include "platform/network/ContentSecurityPolicyParsers.h" | 10 #include "platform/network/ContentSecurityPolicyParsers.h" |
| 10 #include "wtf/HashSet.h" | 11 #include "wtf/HashSet.h" |
| 11 #include "wtf/text/WTFString.h" | 12 #include "wtf/text/WTFString.h" |
| 12 | 13 |
| 13 namespace WebCore { | 14 namespace WebCore { |
| 14 | 15 |
| 15 class ContentSecurityPolicy; | 16 class ContentSecurityPolicy; |
| 16 class KURL; | 17 class KURL; |
| 17 | 18 |
| 18 class CSPSourceList { | 19 class CSPSourceList { |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 31 | 32 |
| 32 bool isHashOrNoncePresent() const; | 33 bool isHashOrNoncePresent() const; |
| 33 | 34 |
| 34 private: | 35 private: |
| 35 bool parseSource(const UChar* begin, const UChar* end, String& scheme, Strin g& host, int& port, String& path, bool& hostHasWildcard, bool& portHasWildcard); | 36 bool parseSource(const UChar* begin, const UChar* end, String& scheme, Strin g& host, int& port, String& path, bool& hostHasWildcard, bool& portHasWildcard); |
| 36 bool parseScheme(const UChar* begin, const UChar* end, String& scheme); | 37 bool parseScheme(const UChar* begin, const UChar* end, String& scheme); |
| 37 bool parseHost(const UChar* begin, const UChar* end, String& host, bool& hos tHasWildcard); | 38 bool parseHost(const UChar* begin, const UChar* end, String& host, bool& hos tHasWildcard); |
| 38 bool parsePort(const UChar* begin, const UChar* end, int& port, bool& portHa sWildcard); | 39 bool parsePort(const UChar* begin, const UChar* end, int& port, bool& portHa sWildcard); |
| 39 bool parsePath(const UChar* begin, const UChar* end, String& path); | 40 bool parsePath(const UChar* begin, const UChar* end, String& path); |
| 40 bool parseNonce(const UChar* begin, const UChar* end, String& nonce); | 41 bool parseNonce(const UChar* begin, const UChar* end, String& nonce); |
| 41 bool parseHash(const UChar* begin, const UChar* end, DigestValue& hash, Cont entSecurityPolicyHashAlgorithm&); | 42 bool parseHash(const UChar* begin, const UChar* end, CryptoUtil::DigestValue & hash, ContentSecurityPolicyHashAlgorithm&); |
|
abarth-chromium
2014/03/12 18:59:02
Why not just DigestValue ?
jww
2014/04/01 23:29:09
I've now gotten rid of the CryptoUtil namespace, w
| |
| 42 | 43 |
| 43 void addSourceSelf(); | 44 void addSourceSelf(); |
| 44 void addSourceStar(); | 45 void addSourceStar(); |
| 45 void addSourceUnsafeInline(); | 46 void addSourceUnsafeInline(); |
| 46 void addSourceUnsafeEval(); | 47 void addSourceUnsafeEval(); |
| 47 void addSourceNonce(const String& nonce); | 48 void addSourceNonce(const String& nonce); |
| 48 void addSourceHash(const ContentSecurityPolicyHashAlgorithm&, const DigestVa lue& hash); | 49 void addSourceHash(const ContentSecurityPolicyHashAlgorithm&, const CryptoUt il::DigestValue& hash); |
| 49 | 50 |
| 50 ContentSecurityPolicy* m_policy; | 51 ContentSecurityPolicy* m_policy; |
| 51 Vector<CSPSource> m_list; | 52 Vector<CSPSource> m_list; |
| 52 String m_directiveName; | 53 String m_directiveName; |
| 53 bool m_allowStar; | 54 bool m_allowStar; |
| 54 bool m_allowInline; | 55 bool m_allowInline; |
| 55 bool m_allowEval; | 56 bool m_allowEval; |
| 56 HashSet<String> m_nonces; | 57 HashSet<String> m_nonces; |
| 57 HashSet<CSPHashValue> m_hashes; | 58 HashSet<CSPHashValue> m_hashes; |
| 58 uint8_t m_hashAlgorithmsUsed; | 59 uint8_t m_hashAlgorithmsUsed; |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 | 62 |
| 62 } // namespace WebCore | 63 } // namespace WebCore |
| 63 | 64 |
| 64 #endif | 65 #endif |
| OLD | NEW |