Index: Source/core/page/ContentSecurityPolicy.h |
diff --git a/Source/core/page/ContentSecurityPolicy.h b/Source/core/page/ContentSecurityPolicy.h |
index 35760a7fa808889bc4f627a89c81a119fb7b31d8..7e09483d5e4fa37145a4f5d467a4298240360ee9 100644 |
--- a/Source/core/page/ContentSecurityPolicy.h |
+++ b/Source/core/page/ContentSecurityPolicy.h |
@@ -41,12 +41,30 @@ namespace WebCore { |
class CSPDirectiveList; |
class DOMStringList; |
class KURL; |
+class ResourceResponse; |
class ScriptExecutionContext; |
class SecurityOrigin; |
typedef int SandboxFlags; |
typedef Vector<OwnPtr<CSPDirectiveList> > CSPDirectiveListVector; |
+class ContentSecurityPolicyResponseHeaders { |
+public: |
+ ContentSecurityPolicyResponseHeaders() { } |
+ explicit ContentSecurityPolicyResponseHeaders(const ResourceResponse&); |
+ |
+ const String& contentSecurityPolicy() const { return m_contentSecuitryPolicy; } |
+ const String& contentSecurityPolicyReportOnly() const { return m_contentSecurityPolicyReportOnly; } |
+ const String& xWebKitCSP() const { return m_xWebKitCSP; } |
+ const String& xWebKitCSPReportOnly() const { return m_xWebKitCSPReportOnly; } |
+ |
+private: |
+ String m_contentSecuitryPolicy; |
+ String m_contentSecurityPolicyReportOnly; |
+ String m_xWebKitCSP; |
+ String m_xWebKitCSPReportOnly; |
+}; |
+ |
class ContentSecurityPolicy { |
WTF_MAKE_FAST_ALLOCATED; |
public: |
@@ -79,6 +97,7 @@ public: |
BlockReflectedXSS |
}; |
+ void didReceiveHeaders(const ContentSecurityPolicyResponseHeaders&); |
void didReceiveHeader(const String&, HeaderType); |
// These functions are wrong because they assume that there is only one header. |
@@ -141,6 +160,7 @@ private: |
explicit ContentSecurityPolicy(ScriptExecutionContext*); |
void logToConsole(const String& message, const String& contextURL = String(), const WTF::OrdinalNumber& contextLine = WTF::OrdinalNumber::beforeFirst(), ScriptState* = 0) const; |
+ void addPolicyFromHeaderValue(const String&, HeaderType); |
ScriptExecutionContext* m_scriptExecutionContext; |
bool m_overrideInlineStyleAllowed; |