Title: [149953] releases/WebKitGTK/webkit-2.0
Revision
149953
Author
[email protected]
Date
2013-05-12 04:15:54 -0700 (Sun, 12 May 2013)

Log Message

Merge r148860 - [WebKit2] Plugins without a MIME Type fail to load
https://bugs.webkit.org/show_bug.cgi?id=112834

Reviewed by Benjamin Poulain.

Source/WebKit2:

The problem is that when the plugin is created and the MIME Type
is empty, since the MIME Type guessed in the UI process using the
plugin extension is not passed to the WebProcess, when the plugin
is instantiated, the value of NPMIMEType parameter passed to
NPP_New is NULL, and NPERR_INVALID_INSTANCE_ERROR is returned.
GetPluginPath message has been renamed to FindPlugin, since it
doesn't only return the path but also the new MIME Type and load
policy.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::findPlugin): Receive an output newMIMEType
parameter that is passed to PluginModuleInfo::findPlugin() so that
in case of guessing the MIME Type, the new one is passed back to
the WebProcess.
* UIProcess/WebPageProxy.h:
(WebPageProxy):
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::createPlugin): Pass the MIME Type
from the parameters to WebPage::createPlugin.
(WebKit::WebFrameLoaderClient::recreatePlugin): Pass a newMIMEType
parameter to WebPage::createPlugin.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::createPlugin): Add newMIMEType out parameter and
pass it to the FindPlugin message.
(WebKit::WebPage::canPluginHandleResponse): Pass newMIMEType to
FindPlugin message.
* WebProcess/WebPage/WebPage.h:
(WebPage):

LayoutTests:

* platform/wk2/TestExpectations: Unskip
plugins/no-mime-with-valid-extension.html.

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.0/LayoutTests/ChangeLog (149952 => 149953)


--- releases/WebKitGTK/webkit-2.0/LayoutTests/ChangeLog	2013-05-12 09:05:54 UTC (rev 149952)
+++ releases/WebKitGTK/webkit-2.0/LayoutTests/ChangeLog	2013-05-12 11:15:54 UTC (rev 149953)
@@ -1,3 +1,13 @@
+2013-04-21  Carlos Garcia Campos  <[email protected]>
+
+        [WebKit2] Plugins without a MIME Type fail to load
+        https://bugs.webkit.org/show_bug.cgi?id=112834
+
+        Reviewed by Benjamin Poulain.
+
+        * platform/wk2/TestExpectations: Unskip
+        plugins/no-mime-with-valid-extension.html.
+
 2013-04-11  Manuel Rego Casasnovas  <[email protected]>
 
         FrameLoaderClient::assignIdentifierToInitialRequest() not called for the main resource when loaded from the memory cache

Modified: releases/WebKitGTK/webkit-2.0/LayoutTests/platform/wk2/TestExpectations (149952 => 149953)


--- releases/WebKitGTK/webkit-2.0/LayoutTests/platform/wk2/TestExpectations	2013-05-12 09:05:54 UTC (rev 149952)
+++ releases/WebKitGTK/webkit-2.0/LayoutTests/platform/wk2/TestExpectations	2013-05-12 11:15:54 UTC (rev 149953)
@@ -717,7 +717,6 @@
 
 # Unexplained plugin failures
 platform/mac/plugins/testplugin-onnew-onpaint.html
-plugins/no-mime-with-valid-extension.html
 
 # Unexplained plugin failures that were formerly in the NPRuntime support for out-of-process plug-ins
 # list.

Modified: releases/WebKitGTK/webkit-2.0/Source/WebKit2/ChangeLog (149952 => 149953)


--- releases/WebKitGTK/webkit-2.0/Source/WebKit2/ChangeLog	2013-05-12 09:05:54 UTC (rev 149952)
+++ releases/WebKitGTK/webkit-2.0/Source/WebKit2/ChangeLog	2013-05-12 11:15:54 UTC (rev 149953)
@@ -1,3 +1,40 @@
+2013-04-21  Carlos Garcia Campos  <[email protected]>
+
+        [WebKit2] Plugins without a MIME Type fail to load
+        https://bugs.webkit.org/show_bug.cgi?id=112834
+
+        Reviewed by Benjamin Poulain.
+
+        The problem is that when the plugin is created and the MIME Type
+        is empty, since the MIME Type guessed in the UI process using the
+        plugin extension is not passed to the WebProcess, when the plugin
+        is instantiated, the value of NPMIMEType parameter passed to
+        NPP_New is NULL, and NPERR_INVALID_INSTANCE_ERROR is returned.
+        GetPluginPath message has been renamed to FindPlugin, since it
+        doesn't only return the path but also the new MIME Type and load
+        policy.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::findPlugin): Receive an output newMIMEType
+        parameter that is passed to PluginModuleInfo::findPlugin() so that
+        in case of guessing the MIME Type, the new one is passed back to
+        the WebProcess.
+        * UIProcess/WebPageProxy.h:
+        (WebPageProxy):
+        * UIProcess/WebPageProxy.messages.in:
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::createPlugin): Pass the MIME Type
+        from the parameters to WebPage::createPlugin.
+        (WebKit::WebFrameLoaderClient::recreatePlugin): Pass a newMIMEType
+        parameter to WebPage::createPlugin.
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::createPlugin): Add newMIMEType out parameter and
+        pass it to the FindPlugin message.
+        (WebKit::WebPage::canPluginHandleResponse): Pass newMIMEType to
+        FindPlugin message.
+        * WebProcess/WebPage/WebPage.h:
+        (WebPage):
+
 2013-04-08  Patrick Gansterer  <[email protected]>
 
         [WIN] Remove WebKit2 source code

Modified: releases/WebKitGTK/webkit-2.0/Source/WebKit2/Platform/CoreIPC/HandleMessage.h (149952 => 149953)


--- releases/WebKitGTK/webkit-2.0/Source/WebKit2/Platform/CoreIPC/HandleMessage.h	2013-05-12 09:05:54 UTC (rev 149952)
+++ releases/WebKitGTK/webkit-2.0/Source/WebKit2/Platform/CoreIPC/HandleMessage.h	2013-05-12 11:15:54 UTC (rev 149953)
@@ -197,6 +197,12 @@
     (object->*function)(args.argument1, args.argument2, args.argument3, args.argument4, replyArgs.argument1, replyArgs.argument2, replyArgs.argument3);
 }
 
+template<typename C, typename MF, typename P1, typename P2, typename P3, typename R1, typename R2, typename R3>
+void callMemberFunction(const Arguments3<P1, P2, P3>& args, Arguments3<R1, R2, R3>& replyArgs, C* object, MF function)
+{
+    (object->*function)(args.argument1, args.argument2, args.argument3, replyArgs.argument1, replyArgs.argument2, replyArgs.argument3);
+}
+
 // Dispatch functions with delayed reply arguments.
 template<typename C, typename MF, typename R>
 void callMemberFunction(const Arguments0&, PassRefPtr<R> delayedReply, C* object, MF function)

Modified: releases/WebKitGTK/webkit-2.0/Source/WebKit2/UIProcess/WebPageProxy.cpp (149952 => 149953)


--- releases/WebKitGTK/webkit-2.0/Source/WebKit2/UIProcess/WebPageProxy.cpp	2013-05-12 09:05:54 UTC (rev 149952)
+++ releases/WebKitGTK/webkit-2.0/Source/WebKit2/UIProcess/WebPageProxy.cpp	2013-05-12 11:15:54 UTC (rev 149953)
@@ -1241,11 +1241,11 @@
 }
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
-void WebPageProxy::getPluginPath(const String& mimeType, const String& urlString, const String& documentURLString, String& pluginPath, uint32_t& pluginLoadPolicy)
+void WebPageProxy::findPlugin(const String& mimeType, const String& urlString, const String& documentURLString, String& pluginPath, String& newMimeType, uint32_t& pluginLoadPolicy)
 {
     MESSAGE_CHECK_URL(urlString);
 
-    String newMimeType = mimeType.lower();
+    newMimeType = mimeType.lower();
 
     pluginLoadPolicy = PluginModuleLoadNormally;
     PluginModuleInfo plugin = m_process->context()->pluginInfoStore().findPlugin(newMimeType, KURL(KURL(), urlString));

Modified: releases/WebKitGTK/webkit-2.0/Source/WebKit2/UIProcess/WebPageProxy.h (149952 => 149953)


--- releases/WebKitGTK/webkit-2.0/Source/WebKit2/UIProcess/WebPageProxy.h	2013-05-12 09:05:54 UTC (rev 149952)
+++ releases/WebKitGTK/webkit-2.0/Source/WebKit2/UIProcess/WebPageProxy.h	2013-05-12 11:15:54 UTC (rev 149953)
@@ -1025,7 +1025,7 @@
     void sendWheelEvent(const WebWheelEvent&);
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
-    void getPluginPath(const String& mimeType, const String& urlString, const String& documentURLString, String& pluginPath, uint32_t& pluginLoadPolicy);
+    void findPlugin(const String& mimeType, const String& urlString, const String& documentURLString, String& pluginPath, String& newMIMEType, uint32_t& pluginLoadPolicy);
 #endif
 
     PageClient* m_pageClient;

Modified: releases/WebKitGTK/webkit-2.0/Source/WebKit2/UIProcess/WebPageProxy.messages.in (149952 => 149953)


--- releases/WebKitGTK/webkit-2.0/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2013-05-12 09:05:54 UTC (rev 149952)
+++ releases/WebKitGTK/webkit-2.0/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2013-05-12 11:15:54 UTC (rev 149953)
@@ -313,7 +313,7 @@
 #endif
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
-GetPluginPath(WTF::String mimeType, WTF::String urlString, WTF::String documentURLString) -> (WTF::String pluginPath, uint32_t pluginLoadPolicy)
+    FindPlugin(WTF::String mimeType, WTF::String urlString, WTF::String documentURLString) -> (WTF::String pluginPath, WTF::String newMIMEType, uint32_t pluginLoadPolicy)
 #endif
 
 }

Modified: releases/WebKitGTK/webkit-2.0/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (149952 => 149953)


--- releases/WebKitGTK/webkit-2.0/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2013-05-12 09:05:54 UTC (rev 149952)
+++ releases/WebKitGTK/webkit-2.0/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2013-05-12 11:15:54 UTC (rev 149953)
@@ -1323,7 +1323,7 @@
 #endif
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
-    RefPtr<Plugin> plugin = m_frame->page()->createPlugin(m_frame, pluginElement, parameters);
+    RefPtr<Plugin> plugin = m_frame->page()->createPlugin(m_frame, pluginElement, parameters, parameters.mimeType);
     if (!plugin)
         return 0;
 
@@ -1340,7 +1340,8 @@
     ASSERT(m_frame->page());
 
     PluginView* pluginView = static_cast<PluginView*>(widget);
-    RefPtr<Plugin> plugin = m_frame->page()->createPlugin(m_frame, pluginView->pluginElement(), pluginView->initialParameters());
+    String newMIMEType;
+    RefPtr<Plugin> plugin = m_frame->page()->createPlugin(m_frame, pluginView->pluginElement(), pluginView->initialParameters(), newMIMEType);
     pluginView->recreateAndInitialize(plugin.release());
 #endif
 }

Modified: releases/WebKitGTK/webkit-2.0/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (149952 => 149953)


--- releases/WebKitGTK/webkit-2.0/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2013-05-12 09:05:54 UTC (rev 149952)
+++ releases/WebKitGTK/webkit-2.0/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2013-05-12 11:15:54 UTC (rev 149953)
@@ -497,13 +497,13 @@
 }
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
-PassRefPtr<Plugin> WebPage::createPlugin(WebFrame* frame, HTMLPlugInElement* pluginElement, const Plugin::Parameters& parameters)
+PassRefPtr<Plugin> WebPage::createPlugin(WebFrame* frame, HTMLPlugInElement* pluginElement, const Plugin::Parameters& parameters, String& newMIMEType)
 {
     String pluginPath;
     uint32_t pluginLoadPolicy;
 
     String documentURLString = pluginElement->document()->url().string();
-    if (!sendSync(Messages::WebPageProxy::GetPluginPath(parameters.mimeType, parameters.url.string(), documentURLString), Messages::WebPageProxy::GetPluginPath::Reply(pluginPath, pluginLoadPolicy))) {
+    if (!sendSync(Messages::WebPageProxy::FindPlugin(parameters.mimeType, parameters.url.string(), documentURLString), Messages::WebPageProxy::FindPlugin::Reply(pluginPath, newMIMEType, pluginLoadPolicy))) {
         return 0;
     }
 
@@ -3656,9 +3656,10 @@
 {
 #if ENABLE(NETSCAPE_PLUGIN_API)
     String pluginPath;
+    String newMIMEType;
     uint32_t pluginLoadPolicy;
     
-    if (!sendSync(Messages::WebPageProxy::GetPluginPath(response.mimeType(), response.url().string(), response.url().string()), Messages::WebPageProxy::GetPluginPath::Reply(pluginPath, pluginLoadPolicy)))
+    if (!sendSync(Messages::WebPageProxy::FindPlugin(response.mimeType(), response.url().string(), response.url().string()), Messages::WebPageProxy::FindPlugin::Reply(pluginPath, newMIMEType, pluginLoadPolicy)))
         return false;
 
     return pluginLoadPolicy != PluginModuleBlocked && !pluginPath.isEmpty();

Modified: releases/WebKitGTK/webkit-2.0/Source/WebKit2/WebProcess/WebPage/WebPage.h (149952 => 149953)


--- releases/WebKitGTK/webkit-2.0/Source/WebKit2/WebProcess/WebPage/WebPage.h	2013-05-12 09:05:54 UTC (rev 149952)
+++ releases/WebKitGTK/webkit-2.0/Source/WebKit2/WebProcess/WebPage/WebPage.h	2013-05-12 11:15:54 UTC (rev 149953)
@@ -278,7 +278,7 @@
     WebCore::FrameView* mainFrameView() const; // May return 0.
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
-    PassRefPtr<Plugin> createPlugin(WebFrame*, WebCore::HTMLPlugInElement*, const Plugin::Parameters&);
+    PassRefPtr<Plugin> createPlugin(WebFrame*, WebCore::HTMLPlugInElement*, const Plugin::Parameters&, String& newMIMEType);
 #endif
 
     EditorState editorState() const;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to