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

Unified Diff: Source/bindings/core/v8/WindowProxy.cpp

Issue 559503002: CSP: Move policy parsing out of Document. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. 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/dom/Document.h » ('j') | Source/core/dom/Document.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/WindowProxy.cpp
diff --git a/Source/bindings/core/v8/WindowProxy.cpp b/Source/bindings/core/v8/WindowProxy.cpp
index 0a33287217d8a648bc119cc2c18a5999d342dd11..db2a3b094bde30ac29da7bd5ff0f0c5338d2532c 100644
--- a/Source/bindings/core/v8/WindowProxy.cpp
+++ b/Source/bindings/core/v8/WindowProxy.cpp
@@ -217,8 +217,10 @@ bool WindowProxy::initialize()
if (m_frame->document()) {
setSecurityToken(m_frame->document()->securityOrigin());
ContentSecurityPolicy* csp = m_frame->document()->contentSecurityPolicy();
- context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSecurityPolicy::SuppressReport));
- context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_isolate, csp->evalDisabledErrorMessage()));
+ if (csp) {
+ context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSecurityPolicy::SuppressReport));
+ context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_isolate, csp->evalDisabledErrorMessage()));
+ }
}
} else {
updateActivityLogger();
« no previous file with comments | « no previous file | Source/core/dom/Document.h » ('j') | Source/core/dom/Document.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698