diff options
author | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-13 21:57:31 +0000 |
---|---|---|
committer | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-13 21:57:31 +0000 |
commit | 5bbd812428188b3681bb8c2271642a78eaaa53de (patch) | |
tree | 405fcbb7288f8aff47b63684533a8f03bea86ef0 /webkit | |
parent | 4a694814e7afe62bd487201bfbe25f9e29f47dbe (diff) | |
download | chromium_src-5bbd812428188b3681bb8c2271642a78eaaa53de.zip chromium_src-5bbd812428188b3681bb8c2271642a78eaaa53de.tar.gz chromium_src-5bbd812428188b3681bb8c2271642a78eaaa53de.tar.bz2 |
Allow the ScriptController to pretend that V8 has a windowShell.
The reason for doing this is because the V8 ScriptController already
provides some functionality provided by the JSC WindowShell such
as disconnectFrame().
Also, merge the clearPluginObjects into clearScriptObjects, which
matches better what happens in JSC.
This change requires a roll in WebKit, since we remove the clearPluginObjects
method.
Review URL: http://codereview.chromium.org/20360
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9797 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/port/bindings/v8/ScriptController.cpp | 17 | ||||
-rw-r--r-- | webkit/port/bindings/v8/ScriptController.h | 10 |
2 files changed, 15 insertions, 12 deletions
diff --git a/webkit/port/bindings/v8/ScriptController.cpp b/webkit/port/bindings/v8/ScriptController.cpp index bf87c3b..a0b0969 100644 --- a/webkit/port/bindings/v8/ScriptController.cpp +++ b/webkit/port/bindings/v8/ScriptController.cpp @@ -120,7 +120,12 @@ ScriptController::~ScriptController() void ScriptController::clearScriptObjects() { - // TODO(eseidel): JSC handles binding root objects here, why don't we? + PluginObjectMap::iterator it = m_pluginObjects.begin(); + for (; it != m_pluginObjects.end(); ++it) { + _NPN_UnregisterObject(it->second); + NPN_ReleaseObject(it->second); + } + m_pluginObjects.clear(); #if ENABLE(NETSCAPE_PLUGIN_API) if (m_windowScriptNPObject) { @@ -143,16 +148,6 @@ void ScriptController::updatePlatformScriptObjects() notImplemented(); } -void ScriptController::clearPluginObjects() -{ - PluginObjectMap::iterator it = m_pluginObjects.begin(); - for (; it != m_pluginObjects.end(); ++it) { - _NPN_UnregisterObject(it->second); - NPN_ReleaseObject(it->second); - } - m_pluginObjects.clear(); -} - // Disconnect the proxy from its owner frame; void ScriptController::disconnectFrame() { diff --git a/webkit/port/bindings/v8/ScriptController.h b/webkit/port/bindings/v8/ScriptController.h index 5202832..7af3fd8 100644 --- a/webkit/port/bindings/v8/ScriptController.h +++ b/webkit/port/bindings/v8/ScriptController.h @@ -151,6 +151,15 @@ public: // as a string. ScriptValue evaluate(const ScriptSourceCode&); + // JSC has a WindowShell object, but for V8, the ScriptController + // is the WindowShell. + bool haveWindowShell() const { return true; } + + // Masquerade 'this' as the windowShell. + // This is a bit of a hack, but provides reasonable compatibility + // with what JSC does as well. + ScriptController* windowShell() { return this; } + void disposeJSResult(JSResult result); void collectGarbage(); @@ -166,7 +175,6 @@ public: PassScriptInstance createScriptInstanceForWidget(Widget*); - void clearPluginObjects(); void disconnectFrame(); // Check if the javascript engine has been initialized. |