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

Unified Diff: Source/bindings/core/v8/ScriptController.h

Issue 516273002: Move plugin placeholder style to CSS, and allow it to bypass main world CSP. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add the actual .css file Created 6 years, 4 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/bindings/core/v8/ScriptController.cpp » ('j') | Source/core/css/pluginPlaceholder.css » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/ScriptController.h
diff --git a/Source/bindings/core/v8/ScriptController.h b/Source/bindings/core/v8/ScriptController.h
index 931275d5dcc4d264063616ee006d2bceb5ae7b8d..e8120e94f205ec7a1bf8c7b494554d3ef94ea711 100644
--- a/Source/bindings/core/v8/ScriptController.h
+++ b/Source/bindings/core/v8/ScriptController.h
@@ -38,6 +38,7 @@
#include "wtf/Forward.h"
#include "wtf/HashMap.h"
#include "wtf/RefCounted.h"
+#include "wtf/TemporaryChange.h"
#include "wtf/Vector.h"
#include "wtf/text/TextPosition.h"
#include <v8.h>
@@ -105,6 +106,8 @@ public:
// Returns true if the current world is isolated, and has its own Content
// Security Policy. In this case, the policy of the main world should be
// ignored when evaluating resources injected into the DOM.
+ // Alternatively, this can be explicitly forced to true within a scope
+ // using BypassMainWorldCSP.
bool shouldBypassMainWorldCSP();
// Creates a property of the global object of a frame.
@@ -149,6 +152,15 @@ public:
v8::Isolate* isolate() const { return m_isolate; }
+ class BypassMainWorldCSP : public TemporaryChange<bool> {
haraken 2014/09/01 00:59:43 The idea of introducing BypassMainWorldCSP looks g
jbroman 2014/09/02 15:44:04 The friend class is there to keep m_bypassMainWorl
+ public:
+ BypassMainWorldCSP(ScriptController& controller)
+ : TemporaryChange<bool>(controller.m_bypassMainWorldCSP, true)
+ {
+ }
+ };
+ friend class BypassMainWorldCSP;
+
private:
typedef HashMap<int, OwnPtr<WindowProxy> > IsolatedWorldMap;
typedef HashMap<Widget*, NPObject*> PluginObjectMap;
@@ -169,6 +181,8 @@ private:
PluginObjectMap m_pluginObjects;
NPObject* m_windowScriptNPObject;
+
+ bool m_bypassMainWorldCSP;
};
} // namespace blink
« no previous file with comments | « no previous file | Source/bindings/core/v8/ScriptController.cpp » ('j') | Source/core/css/pluginPlaceholder.css » ('J')

Powered by Google App Engine
This is Rietveld 408576698