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

Unified Diff: Source/core/frame/csp/ContentSecurityPolicy.h

Issue 550223002: CSP: Separate side-effects of parsing from the parsing code. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Feedback. Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/frame/csp/ContentSecurityPolicy.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/csp/ContentSecurityPolicy.h
diff --git a/Source/core/frame/csp/ContentSecurityPolicy.h b/Source/core/frame/csp/ContentSecurityPolicy.h
index 1d5721960d2d2bb627722177fb7cbbfbae25402a..01ea44033ea58698d0a935a62aa7dfa6687ee57d 100644
--- a/Source/core/frame/csp/ContentSecurityPolicy.h
+++ b/Source/core/frame/csp/ContentSecurityPolicy.h
@@ -84,6 +84,16 @@ public:
static const char ReflectedXSS[];
static const char Referrer[];
+ enum ReportingStatus {
+ SendReport,
+ SuppressReport
+ };
+
+ enum SideEffectDisposition {
+ ApplySideEffectsToExecutionContext,
+ DoNotApplySideEffectsToExecutionContext
+ };
+
static PassRefPtr<ContentSecurityPolicy> create(ExecutionContext* executionContext)
{
return adoptRef(new ContentSecurityPolicy(executionContext));
@@ -92,13 +102,8 @@ public:
void copyStateFrom(const ContentSecurityPolicy*);
- enum ReportingStatus {
- SendReport,
- SuppressReport
- };
-
void didReceiveHeaders(const ContentSecurityPolicyResponseHeaders&);
- void didReceiveHeader(const String&, ContentSecurityPolicyHeaderType, ContentSecurityPolicyHeaderSource);
+ void didReceiveHeader(const String&, ContentSecurityPolicyHeaderType, ContentSecurityPolicyHeaderSource, SideEffectDisposition = ApplySideEffectsToExecutionContext);
// These functions are wrong because they assume that there is only one header.
// FIXME: Replace them with functions that return vectors.
@@ -169,7 +174,7 @@ public:
const KURL url() const;
KURL completeURL(const String&) const;
- void enforceSandboxFlags(SandboxFlags) const;
+ void enforceSandboxFlags(SandboxFlags);
String evalDisabledErrorMessage() const;
bool urlMatchesSelf(const KURL&) const;
@@ -186,6 +191,8 @@ public:
private:
explicit ContentSecurityPolicy(ExecutionContext*);
+ void applyPolicySideEffectsToExecutionContext();
+
Document* document() const;
SecurityOrigin* securityOrigin() const;
@@ -207,6 +214,11 @@ private:
uint8_t m_scriptHashAlgorithmsUsed;
uint8_t m_styleHashAlgorithmsUsed;
+ // State flags used to configure the environment after parsing a policy.
+ SandboxFlags m_sandboxMask;
+ ReferrerPolicy m_referrerPolicy;
+ String m_disableEvalErrorMessage;
+
OwnPtr<CSPSource> m_selfSource;
};
« no previous file with comments | « no previous file | Source/core/frame/csp/ContentSecurityPolicy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698