Changeset 64154 in webkit
- Timestamp:
- Jul 27, 2010 1:55:29 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r64152 r64154 1 2010-07-27 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Expose interface for returning the plug-in script JSObject 6 https://bugs.webkit.org/show_bug.cgi?id=43074 7 8 PluginViewBase::scriptObject should be a virtual function. 9 10 * plugins/PluginViewBase.h: 11 (WebCore::PluginViewBase::scriptObject): 12 1 13 2010-07-27 Jian Li <jianli@chromium.org> 2 14 -
trunk/WebCore/plugins/PluginViewBase.h
r64093 r64154 45 45 #endif 46 46 47 JSC::JSObject* scriptObject(JSC::ExecState*, JSC::JSGlobalObject*) { return 0; }47 virtual JSC::JSObject* scriptObject(JSC::ExecState*, JSC::JSGlobalObject*) { return 0; } 48 48 49 49 protected: -
trunk/WebKit2/ChangeLog
r64147 r64154 1 2010-07-27 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Expose interface for returning the plug-in script JSObject 6 https://bugs.webkit.org/show_bug.cgi?id=43074 7 8 * WebProcess/Plugins/NPRuntimeObjectMap.cpp: 9 (WebKit::NPRuntimeObjectMap::getOrCreateJSObject): 10 Add empty stub. 11 12 * WebProcess/Plugins/NPRuntimeObjectMap.h: 13 * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: 14 (WebKit::NetscapePlugin::pluginScriptableNPObject): 15 Ask the plug-in for it's scriptable NPObject. 16 17 * WebProcess/Plugins/Netscape/NetscapePlugin.h: 18 * WebProcess/Plugins/Plugin.h: 19 Add pluginScritableNPObject. 20 21 * WebProcess/Plugins/PluginView.cpp: 22 (WebKit::PluginView::PluginView): 23 Call PluginViewBase constructor. 24 25 (WebKit::PluginView::scriptObject): 26 Ask the plug-in for its scriptable object and wrap it. 27 28 * WebProcess/Plugins/PluginView.h: 29 PluginView now inherits from PluginViewBase. 30 1 31 2010-07-27 Anders Carlsson <andersca@apple.com> 2 32 -
trunk/WebKit2/WebProcess/Plugins/NPRuntimeObjectMap.cpp
r64147 r64154 63 63 } 64 64 65 JSObject* NPRuntimeObjectMap::getOrCreateJSObject(NPObject*, ExecState*, JSGlobalObject*) 66 { 67 // FIXME: Implement. 68 return 0; 69 } 70 65 71 void NPRuntimeObjectMap::invalidate() 66 72 { -
trunk/WebKit2/WebProcess/Plugins/NPRuntimeObjectMap.h
r64147 r64154 33 33 namespace JSC { 34 34 class ExecState; 35 class JSGlobalObject; 35 36 class JSObject; 36 37 } … … 46 47 explicit NPRuntimeObjectMap(PluginView*); 47 48 48 // Returns an NPObject that wraps the given J avaScript object. If there is already an NPObject that wraps this JSObject, it will49 // Returns an NPObject that wraps the given JSObject object. If there is already an NPObject that wraps this JSObject, it will 49 50 // retain it and return it. 50 51 NPObject* getOrCreateNPObject(JSC::JSObject*); 51 52 52 53 void npJSObjectDestroyed(NPJSObject*); 54 55 // Returns a JSObject object that wraps the given NPObject. 56 JSC::JSObject* getOrCreateJSObject(NPObject*, JSC::ExecState*, JSC::JSGlobalObject*); 57 53 58 54 59 // Called when the plug-in is destroyed. Will invalidate all the NPObjects. -
trunk/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
r64073 r64154 439 439 } 440 440 441 NPObject* NetscapePlugin::pluginScriptableNPObject() 442 { 443 NPObject* scriptableNPObject = 0; 444 445 if (NPP_GetValue(NPPVpluginScriptableNPObject, &scriptableNPObject) != NPERR_NO_ERROR) 446 return 0; 447 448 return scriptableNPObject; 449 } 450 441 451 PluginController* NetscapePlugin::controller() 442 452 { -
trunk/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
r64076 r64154 117 117 virtual bool handleMouseLeaveEvent(const WebMouseEvent&); 118 118 virtual void setFocus(bool); 119 virtual NPObject* pluginScriptableNPObject(); 119 120 120 121 virtual PluginController* controller(); -
trunk/WebKit2/WebProcess/Plugins/Plugin.h
r64073 r64154 30 30 #include <wtf/RefCounted.h> 31 31 #include <wtf/Vector.h> 32 33 struct NPObject; 32 34 33 35 namespace WebCore { … … 105 107 virtual void setFocus(bool) = 0; 106 108 109 // Get the NPObject that corresponds to the plug-in's scriptable object. Returns a retained object. 110 virtual NPObject* pluginScriptableNPObject() = 0; 111 107 112 // Returns the plug-in controller for this plug-in. 108 113 // FIXME: We could just have the controller be a member variable of Plugin. -
trunk/WebKit2/WebProcess/Plugins/PluginView.cpp
r64145 r64154 26 26 #include "PluginView.h" 27 27 28 #include "NPRuntimeUtilities.h" 28 29 #include "Plugin.h" 29 30 #include "WebEvent.h" … … 210 211 211 212 PluginView::PluginView(WebCore::HTMLPlugInElement* pluginElement, PassRefPtr<Plugin> plugin, const Plugin::Parameters& parameters) 212 : m_pluginElement(pluginElement) 213 : PluginViewBase(0) 214 , m_pluginElement(pluginElement) 213 215 , m_plugin(plugin) 214 216 , m_parameters(parameters) … … 280 282 } 281 283 284 JSObject* PluginView::scriptObject(ExecState* exec, JSGlobalObject* globalObject) 285 { 286 NPObject* scriptableNPObject = m_plugin->pluginScriptableNPObject(); 287 if (!scriptableNPObject) 288 return 0; 289 290 JSObject* jsObject = m_npRuntimeObjectMap.getOrCreateJSObject(scriptableNPObject, exec, globalObject); 291 releaseNPObject(scriptableNPObject); 292 293 return jsObject; 294 } 295 282 296 void PluginView::setFrameRect(const WebCore::IntRect& rect) 283 297 { -
trunk/WebKit2/WebProcess/Plugins/PluginView.h
r64145 r64154 34 34 35 35 #include <WebCore/MediaCanStartListener.h> 36 #include <WebCore/ Widget.h>36 #include <WebCore/PluginViewBase.h> 37 37 #include <wtf/Deque.h> 38 38 … … 46 46 namespace WebKit { 47 47 48 class PluginView : public WebCore:: Widget, WebCore::MediaCanStartListener, PluginController, WebFrame::LoadListener {48 class PluginView : public WebCore::PluginViewBase, WebCore::MediaCanStartListener, PluginController, WebFrame::LoadListener { 49 49 public: 50 50 static PassRefPtr<PluginView> create(WebCore::HTMLPlugInElement* pluginElement, PassRefPtr<Plugin> plugin, const Plugin::Parameters& parameters) … … 81 81 void cancelAllStreams(); 82 82 83 // WebCore::PluginViewBase 84 virtual JSC::JSObject* scriptObject(JSC::ExecState*, JSC::JSGlobalObject*); 85 83 86 // WebCore::Widget 84 87 virtual void setFrameRect(const WebCore::IntRect&);
Note: See TracChangeset
for help on using the changeset viewer.