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

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

Issue 134863007: CSP: Replace 'static_cast' with 'toDocument'. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 10 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 | « Source/core/dom/Document.h ('k') | Source/core/frame/ContentSecurityPolicy.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/ContentSecurityPolicy.h
diff --git a/Source/core/frame/ContentSecurityPolicy.h b/Source/core/frame/ContentSecurityPolicy.h
index 9e95fd9c3f87442fc6eab78b5ed2e83053a73113..3ba69a2c3c32e9071b9aa6e1e4f0613720f001b7 100644
--- a/Source/core/frame/ContentSecurityPolicy.h
+++ b/Source/core/frame/ContentSecurityPolicy.h
@@ -27,6 +27,7 @@
#define ContentSecurityPolicy_h
#include "bindings/v8/ScriptState.h"
+#include "core/dom/Document.h"
#include "platform/network/HTTPParsers.h"
#include "platform/weborigin/ReferrerPolicy.h"
#include "wtf/HashSet.h"
@@ -162,7 +163,8 @@ public:
static bool shouldBypassMainWorld(ExecutionContext*);
- ExecutionContextClient* client() { return m_client; }
+ ExecutionContextClient* client() const { return m_client; }
+ Document* document() const { return client()->isDocument() ? toDocument(client()) : 0; }
private:
explicit ContentSecurityPolicy(ExecutionContextClient*);
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/frame/ContentSecurityPolicy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698