[Win] No plugin content on some sites.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jan 2015 00:18:35 +0000 (00:18 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jan 2015 00:18:35 +0000 (00:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=140780

Patch by peavo@outlook.com <peavo@outlook.com> on 2015-01-22
Reviewed by Anders Carlsson.

Source/WebCore:

Return script instance from ScriptController::createScriptInstanceForWidget(),
instead of always returning null.

* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::createScriptInstanceForWidget):
* plugins/PluginViewBase.h:
(WebCore::PluginViewBase::bindingInstance):

Source/WebKit/win:

Add override modifier to bindingInstance method.

* Plugins/PluginView.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178968 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/bindings/js/ScriptController.cpp
Source/WebCore/plugins/PluginViewBase.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/Plugins/PluginView.h

index c3effd5..8826111 100644 (file)
@@ -1,3 +1,18 @@
+2015-01-22  peavo@outlook.com  <peavo@outlook.com>
+
+        [Win] No plugin content on some sites.
+        https://bugs.webkit.org/show_bug.cgi?id=140780
+
+        Reviewed by Anders Carlsson.
+
+        Return script instance from ScriptController::createScriptInstanceForWidget(),
+        instead of always returning null.
+
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::createScriptInstanceForWidget):
+        * plugins/PluginViewBase.h:
+        (WebCore::PluginViewBase::bindingInstance):
+
 2015-01-22  Jer Noble  <jer.noble@apple.com>
 
         [Mac][EME] Adopt changes to AVStreamSession class methods
index 65d3908..ebb5c7e 100644 (file)
@@ -39,6 +39,7 @@
 #include "Page.h"
 #include "PageConsoleClient.h"
 #include "PageGroup.h"
+#include "PluginViewBase.h"
 #include "ScriptSourceCode.h"
 #include "ScriptableDocumentParser.h"
 #include "Settings.h"
@@ -403,9 +404,12 @@ NPObject* ScriptController::createScriptObjectForPluginElement(HTMLPlugInElement
 #endif
 
 #if !PLATFORM(COCOA)
-PassRefPtr<JSC::Bindings::Instance> ScriptController::createScriptInstanceForWidget(Widget*)
+PassRefPtr<JSC::Bindings::Instance> ScriptController::createScriptInstanceForWidget(Widget* widget)
 {
-    return nullptr;
+    if (!is<PluginViewBase>(*widget))
+        return nullptr;
+
+    return downcast<PluginViewBase>(*widget).bindingInstance();
 }
 #endif
 
index be6ce30..53e21ef 100644 (file)
@@ -26,6 +26,7 @@
 #define PluginWidget_h
 
 #include "AudioHardwareListener.h"
+#include "BridgeJSC.h"
 #include "PlatformLayer.h"
 #include "ScrollTypes.h"
 #include "Widget.h"
@@ -79,6 +80,8 @@ public:
 
     virtual void setJavaScriptPaused(bool) { }
 
+    virtual PassRefPtr<JSC::Bindings::Instance> bindingInstance() { return nullptr; }
+
 protected:
     explicit PluginViewBase(PlatformWidget widget = 0) : Widget(widget) { }
 };
index dfcb648..0e04cf5 100644 (file)
@@ -1,3 +1,14 @@
+2015-01-22  peavo@outlook.com  <peavo@outlook.com>
+
+        [Win] No plugin content on some sites.
+        https://bugs.webkit.org/show_bug.cgi?id=140780
+
+        Reviewed by Anders Carlsson.
+
+        Add override modifier to bindingInstance method.
+
+        * Plugins/PluginView.h:
+
 2015-01-22  Brent Fulgham  <bfulgham@apple.com>
 
         [Win] Expose missing editing features through WebView interface
index c6fc392..1562b59 100644 (file)
@@ -129,7 +129,7 @@ namespace WebCore {
 #if ENABLE(NETSCAPE_PLUGIN_API)
         NPObject* npObject();
 #endif
-        PassRefPtr<JSC::Bindings::Instance> bindingInstance();
+        virtual PassRefPtr<JSC::Bindings::Instance> bindingInstance() override;
 
         PluginStatus status() const { return m_status; }