Title: [136059] trunk/Source
Revision
136059
Author
pilg...@chromium.org
Date
2012-11-28 14:39:12 -0800 (Wed, 28 Nov 2012)

Log Message

[Chromium] Remove pluginsScriptableObject from PlatformSupport
https://bugs.webkit.org/show_bug.cgi?id=103542

Reviewed by Adam Barth.

Part of a refactoring series. See tracking bug 82948.

Source/WebCore:

* bindings/v8/ScriptController.cpp:
(WebCore::ScriptController::createScriptInstanceForWidget):
* platform/chromium/PlatformSupport.h:
(PlatformSupport):
* plugins/PluginViewBase.h:
(PluginViewBase):
(WebCore::PluginViewBase::scriptableObject):

Source/WebKit/chromium:

* src/PlatformSupport.cpp:
(WebCore):
* src/WebPluginContainerImpl.h:
(WebPluginContainerImpl):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (136058 => 136059)


--- trunk/Source/WebCore/ChangeLog	2012-11-28 22:37:06 UTC (rev 136058)
+++ trunk/Source/WebCore/ChangeLog	2012-11-28 22:39:12 UTC (rev 136059)
@@ -1,3 +1,20 @@
+2012-11-28  Mark Pilgrim  <pilg...@chromium.org>
+
+        [Chromium] Remove pluginsScriptableObject from PlatformSupport
+        https://bugs.webkit.org/show_bug.cgi?id=103542
+
+        Reviewed by Adam Barth.
+
+        Part of a refactoring series. See tracking bug 82948.
+
+        * bindings/v8/ScriptController.cpp:
+        (WebCore::ScriptController::createScriptInstanceForWidget):
+        * platform/chromium/PlatformSupport.h:
+        (PlatformSupport):
+        * plugins/PluginViewBase.h:
+        (PluginViewBase):
+        (WebCore::PluginViewBase::scriptableObject):
+
 2012-11-28  Otto Derek Cheung  <otche...@rim.com>
 
         [BlackBerry] CookieJarBlackBerry will use document settings for cookiesEnabled

Modified: trunk/Source/WebCore/bindings/v8/ScriptController.cpp (136058 => 136059)


--- trunk/Source/WebCore/bindings/v8/ScriptController.cpp	2012-11-28 22:37:06 UTC (rev 136058)
+++ trunk/Source/WebCore/bindings/v8/ScriptController.cpp	2012-11-28 22:39:12 UTC (rev 136059)
@@ -47,9 +47,7 @@
 #include "NPV8Object.h"
 #include "Node.h"
 #include "NotImplemented.h"
-#include "npruntime_impl.h"
-#include "npruntime_priv.h"
-#include "PlatformSupport.h"
+#include "PluginViewBase.h"
 #include "ScriptCallStack.h"
 #include "ScriptCallStackFactory.h"
 #include "ScriptRunner.h"
@@ -67,6 +65,8 @@
 #include "V8NPObject.h"
 #include "V8RecursionScope.h"
 #include "Widget.h"
+#include "npruntime_impl.h"
+#include "npruntime_priv.h"
 #include <wtf/CurrentTime.h>
 #include <wtf/StdLibExtras.h>
 #include <wtf/StringExtras.h>
@@ -521,10 +521,10 @@
 {
     ASSERT(widget);
 
-    if (widget->isFrameView())
+    if (!widget->isPluginViewBase())
         return 0;
 
-    NPObject* npObject = PlatformSupport::pluginScriptableObject(widget);
+    NPObject* npObject = static_cast<PluginViewBase*>(widget)->scriptableObject();
 
     if (!npObject)
         return 0;

Modified: trunk/Source/WebCore/platform/chromium/PlatformSupport.h (136058 => 136059)


--- trunk/Source/WebCore/platform/chromium/PlatformSupport.h	2012-11-28 22:37:06 UTC (rev 136058)
+++ trunk/Source/WebCore/platform/chromium/PlatformSupport.h	2012-11-28 22:39:12 UTC (rev 136059)
@@ -78,7 +78,6 @@
 
     // Plugin -------------------------------------------------------------
     static bool plugins(bool refresh, Vector<PluginInfo>*);
-    static NPObject* pluginScriptableObject(Widget*);
 
     // Theming ------------------------------------------------------------
 #if OS(WINDOWS) && !ENABLE(DEFAULT_RENDER_THEME)

Modified: trunk/Source/WebCore/plugins/PluginViewBase.h (136058 => 136059)


--- trunk/Source/WebCore/plugins/PluginViewBase.h	2012-11-28 22:37:06 UTC (rev 136058)
+++ trunk/Source/WebCore/plugins/PluginViewBase.h	2012-11-28 22:39:12 UTC (rev 136059)
@@ -30,11 +30,16 @@
 #include "Widget.h"
 #include <wtf/text/WTFString.h>
 
+#if USE(V8)
+struct NPObject;
+#endif
+#if USE(JSC)
 namespace JSC {
     class ExecState;
     class JSGlobalObject;
     class JSObject;
 }
+#endif
 
 namespace WebCore {
 
@@ -48,7 +53,12 @@
     virtual PlatformLayer* platformLayer() const { return 0; }
 #endif
 
+#if USE(V8)
+    virtual NPObject* scriptableObject() { return 0; }
+#endif
+#if USE(JSC)
     virtual JSC::JSObject* scriptObject(JSC::JSGlobalObject*) { return 0; }
+#endif
     virtual void storageBlockingStateChanged() { }
     virtual void privateBrowsingStateChanged(bool) { }
     virtual bool getFormValue(String&) { return false; }

Modified: trunk/Source/WebKit/chromium/ChangeLog (136058 => 136059)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-11-28 22:37:06 UTC (rev 136058)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-11-28 22:39:12 UTC (rev 136059)
@@ -1,5 +1,19 @@
 2012-11-28  Mark Pilgrim  <pilg...@chromium.org>
 
+        [Chromium] Remove pluginsScriptableObject from PlatformSupport
+        https://bugs.webkit.org/show_bug.cgi?id=103542
+
+        Reviewed by Adam Barth.
+
+        Part of a refactoring series. See tracking bug 82948.
+
+        * src/PlatformSupport.cpp:
+        (WebCore):
+        * src/WebPluginContainerImpl.h:
+        (WebPluginContainerImpl):
+
+2012-11-28  Mark Pilgrim  <pilg...@chromium.org>
+
         [Chromium][Win] Remove ensureFontLoaded from PlatformSupport
         https://bugs.webkit.org/show_bug.cgi?id=97696
 

Modified: trunk/Source/WebKit/chromium/src/PlatformSupport.cpp (136058 => 136059)


--- trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-11-28 22:37:06 UTC (rev 136058)
+++ trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-11-28 22:39:12 UTC (rev 136059)
@@ -122,14 +122,6 @@
     return true;  // FIXME: There is no need for this function to return a value.
 }
 
-NPObject* PlatformSupport::pluginScriptableObject(Widget* widget)
-{
-    if (!widget || !widget->isPluginContainer())
-        return 0;
-
-    return static_cast<WebPluginContainerImpl*>(widget)->scriptableObject();
-}
-
 // Theming --------------------------------------------------------------------
 
 #if OS(WINDOWS) && !ENABLE(DEFAULT_RENDER_THEME)

Modified: trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.h (136058 => 136059)


--- trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.h	2012-11-28 22:37:06 UTC (rev 136058)
+++ trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.h	2012-11-28 22:39:12 UTC (rev 136059)
@@ -150,7 +150,7 @@
     void didFinishLoading();
     void didFailLoading(const WebCore::ResourceError&);
 
-    NPObject* scriptableObject();
+    virtual NPObject* scriptableObject() OVERRIDE;
 
     void willDestroyPluginLoadObserver(WebPluginLoadObserver*);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to