summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/v8/ScriptController.h
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/v8/ScriptController.h')
-rw-r--r--WebCore/bindings/v8/ScriptController.h29
1 files changed, 18 insertions, 11 deletions
diff --git a/WebCore/bindings/v8/ScriptController.h b/WebCore/bindings/v8/ScriptController.h
index d614619..ec15103 100644
--- a/WebCore/bindings/v8/ScriptController.h
+++ b/WebCore/bindings/v8/ScriptController.h
@@ -46,7 +46,6 @@ namespace WebCore {
class Frame;
class HTMLPlugInElement;
class ScriptSourceCode;
- class ScriptState;
class String;
class Widget;
class XSSAuditor;
@@ -60,16 +59,27 @@ namespace WebCore {
// or this accessor should be made JSProxy*
V8Proxy* proxy() { return m_proxy.get(); }
+ // This function must be called from the main thread. It is safe to call it repeatedly.
+ static void initializeThreading();
+
// Evaluate a script file in the environment of this proxy.
// If succeeded, 'succ' is set to true and result is returned
// as a string.
ScriptValue evaluate(const ScriptSourceCode&);
- // Executes JavaScript in a new world associated with the web frame. The
- // script gets its own global scope, its own prototypes for intrinsic
- // JavaScript objects (String, Array, and so-on), and its own wrappers for
- // all DOM nodes and DOM constructors.
- void evaluateInNewWorld(const Vector<ScriptSourceCode>&, int extensionGroup);
+ void evaluateInIsolatedWorld(unsigned worldID, const Vector<ScriptSourceCode>&);
+
+ // Executes JavaScript in an isolated world. The script gets its own global scope,
+ // its own prototypes for intrinsic JavaScript objects (String, Array, and so-on),
+ // and its own wrappers for all DOM nodes and DOM constructors.
+ //
+ // If an isolated world with the specified ID already exists, it is reused.
+ // Otherwise, a new world is created.
+ //
+ // If the worldID is 0, a new world is always created.
+ //
+ // FIXME: Get rid of extensionGroup here.
+ void evaluateInIsolatedWorld(unsigned worldID, const Vector<ScriptSourceCode>&, int extensionGroup);
// Executes JavaScript in a new context associated with the web frame. The
// script gets its own global scope and its own prototypes for intrinsic
@@ -86,8 +96,6 @@ namespace WebCore {
// with what JSC does as well.
ScriptController* windowShell() { return this; }
- ScriptState* state() const { return m_scriptState.get(); }
-
XSSAuditor* xssAuditor() { return m_XSSAuditor.get(); }
void collectGarbage();
@@ -146,7 +154,7 @@ namespace WebCore {
void updateSecurityOrigin();
void clearScriptObjects();
void updatePlatformScriptObjects();
- void cleanupScriptObjectsForPlugin(void*);
+ void cleanupScriptObjectsForPlugin(Widget*);
#if ENABLE(NETSCAPE_PLUGIN_API)
NPObject* createScriptObjectForPluginElement(HTMLPlugInElement*);
@@ -160,9 +168,8 @@ namespace WebCore {
bool m_processingTimerCallback;
bool m_paused;
- OwnPtr<ScriptState> m_scriptState;
OwnPtr<V8Proxy> m_proxy;
- typedef HashMap<void*, NPObject*> PluginObjectMap;
+ typedef HashMap<Widget*, NPObject*> PluginObjectMap;
// A mapping between Widgets and their corresponding script object.
// This list is used so that when the plugin dies, we can immediately