Chromium Code Reviews| Index: Source/core/frame/ContentSecurityPolicy.h |
| diff --git a/Source/core/frame/ContentSecurityPolicy.h b/Source/core/frame/ContentSecurityPolicy.h |
| index 927d8532c99f13ba35368860272d0a835995e651..b2f828adb1e660f116f33bfc83481b10546459ce 100644 |
| --- a/Source/core/frame/ContentSecurityPolicy.h |
| +++ b/Source/core/frame/ContentSecurityPolicy.h |
| @@ -75,6 +75,12 @@ public: |
| SuppressReport |
| }; |
| + enum HashFunctions { |
| + HashFunctionsNone = 0x0, |
| + HashFunctionsSha1 = 0x1, |
| + HashFunctionsSha256 = 0x2 |
|
abarth-chromium
2013/10/22 17:46:49
It looks like you're using this as a bit field. T
jww
2013/10/28 19:36:23
Done.
|
| + }; |
| + |
| void didReceiveHeaders(const ContentSecurityPolicyResponseHeaders&); |
| void didReceiveHeader(const String&, HeaderType); |
| @@ -102,6 +108,9 @@ public: |
| bool allowBaseURI(const KURL&, ReportingStatus = SendReport) const; |
| bool allowScriptNonce(const String& nonce) const; |
| bool allowStyleNonce(const String& nonce) const; |
| + bool allowScriptHash(const String& source) const; |
| + |
| + void usesScriptHashFunctions(uint8_t hashFunctions); |
| ReflectedXSSDisposition reflectedXSSDisposition() const; |
| @@ -114,7 +123,6 @@ public: |
| void reportDuplicateDirective(const String&) const; |
| void reportInvalidDirectiveValueCharacter(const String& directiveName, const String& value) const; |
| void reportInvalidPathCharacter(const String& directiveName, const String& value, const char) const; |
| - void reportInvalidNonce(const String&) const; |
| void reportInvalidPluginTypes(const String&) const; |
| void reportInvalidSandboxFlags(const String&) const; |
| void reportInvalidSourceExpression(const String& directiveName, const String& source) const; |
| @@ -151,6 +159,11 @@ private: |
| CSPDirectiveListVector m_policies; |
| HashSet<unsigned, AlreadyHashed> m_violationReportsSent; |
| + |
| + // We put the hash functions used on the policy object so that we only need |
| + // to calculate a script hash once and then distribute it to all of the |
| + // directives for validation. |
| + uint8_t m_sourceHashFunctionsUsed; |
| }; |
| } |