summaryrefslogtreecommitdiffstats
path: root/webkit/port/bindings/v8/ScriptController.cpp
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-24 19:19:16 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-24 19:19:16 +0000
commit1051ccbdf5ebcaaa967db454393b85ed84fd36fb (patch)
treec4e67e3470f15be5a2472628537967e10a62d6aa /webkit/port/bindings/v8/ScriptController.cpp
parent7ef2e9d25fa0e7fbdc71def514da476f5756751b (diff)
downloadchromium_src-1051ccbdf5ebcaaa967db454393b85ed84fd36fb.zip
chromium_src-1051ccbdf5ebcaaa967db454393b85ed84fd36fb.tar.gz
chromium_src-1051ccbdf5ebcaaa967db454393b85ed84fd36fb.tar.bz2
Bridge calls to get the root NPObject from a WebPluginContainer.
I also did a little cleanup in getPlugins. I found that there was a WebPluginInfo struct declared within the WebCore namespace that was causing us to need '::' in front of WebPluginInfo. I killed the erroneous declaration so that the rest could be cleaned up. I also renamed getPlugins to plugins since I think that is more consistent with how Apple names these kinds of methods. There was some old, unused USE(JSC) code in ScriptController.cpp that I deleted. R=erikkay Review URL: http://codereview.chromium.org/12601 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5928 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/port/bindings/v8/ScriptController.cpp')
-rw-r--r--webkit/port/bindings/v8/ScriptController.cpp28
1 files changed, 2 insertions, 26 deletions
diff --git a/webkit/port/bindings/v8/ScriptController.cpp b/webkit/port/bindings/v8/ScriptController.cpp
index bf4b029..b9ab314 100644
--- a/webkit/port/bindings/v8/ScriptController.cpp
+++ b/webkit/port/bindings/v8/ScriptController.cpp
@@ -30,6 +30,7 @@
#include "config.h"
#include "ScriptController.h"
+#include "ChromiumBridge.h"
#include "CString.h"
#include "Document.h"
#include "DOMWindow.h"
@@ -48,10 +49,6 @@
#include "v8_binding.h"
#include "v8_npobject.h"
-//TODO(eseidel): We should remove this glue dependency
-#undef LOG // glue defines its own LOG macro
-#include "webkit/glue/webplugin_impl.h"
-
NPRuntimeFunctions npruntime_functions = {
NPN_GetStringIdentifier,
NPN_GetStringIdentifiers,
@@ -408,30 +405,10 @@ JSInstanceHandle ScriptController::createScriptInstanceForWidget(Widget* widget)
if (widget->isFrameView())
return JSInstanceHolder::EmptyInstance();
- // Note: We have to trust that the widget passed to us here
- // is a WebPluginImpl. There isn't a way to dynamically verify
- // it, since the derived class (Widget) has no identifier.
- WebPluginContainer* container = static_cast<WebPluginContainer*>(widget);
- if (!container)
- return JSInstanceHolder::EmptyInstance();
-
- NPObject* npObject = container->GetPluginScriptableObject();
+ NPObject* npObject = ChromiumBridge::pluginScriptableObject(widget);
if (!npObject)
return JSInstanceHolder::EmptyInstance();
-#if USE(JSC)
- // Register 'widget' with the frame so that we can teardown
- // subobjects when the container goes away.
- RefPtr<KJS::Bindings::RootObject> root = script()->createRootObject(widget);
- KJS::Bindings::Instance* instance =
- KJS::Bindings::Instance::createBindingForLanguageInstance(
- KJS::Bindings::Instance::CLanguage, npObject,
- root.release());
- // GetPluginScriptableObject returns a retained NPObject.
- // The caller is expected to release it.
- NPN_ReleaseObject(npObject);
- return instance;
-#elif USE(V8)
// Frame Memory Management for NPObjects
// -------------------------------------
// NPObjects are treated differently than other objects wrapped by JS.
@@ -464,7 +441,6 @@ JSInstanceHandle ScriptController::createScriptInstanceForWidget(Widget* widget)
JSInstance instance = wrapper;
return instance;
-#endif
}
void ScriptController::cleanupScriptObjectsForPlugin(void* nativeHandle)