Title: [116993] trunk/Source/WebKit2
Revision
116993
Author
[email protected]
Date
2012-05-14 13:49:54 -0700 (Mon, 14 May 2012)

Log Message

The "plug-in was blocked" callback needs to include enough info to uniquely identify the plug-in + version
https://bugs.webkit.org/show_bug.cgi?id=86395
<rdar://problem/11447652>

Reviewed by John Sullivan.

Add the plug-in identifier and version string to the didFail client callback.

* UIProcess/API/C/WKPage.h:
* UIProcess/WebLoaderClient.cpp:
(WebKit::WebLoaderClient::didFailToInitializePlugin):
Pass a null plug-in identifier and version here since we don't have the plug-in information here.

(WebKit::WebLoaderClient::didBlockInsecurePluginVersion):
* UIProcess/WebLoaderClient.h:
(WebLoaderClient):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didBlockInsecurePluginVersion):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (116992 => 116993)


--- trunk/Source/WebKit2/ChangeLog	2012-05-14 20:48:43 UTC (rev 116992)
+++ trunk/Source/WebKit2/ChangeLog	2012-05-14 20:49:54 UTC (rev 116993)
@@ -1,3 +1,24 @@
+2012-05-14  Anders Carlsson  <[email protected]>
+
+        The "plug-in was blocked" callback needs to include enough info to uniquely identify the plug-in + version
+        https://bugs.webkit.org/show_bug.cgi?id=86395
+        <rdar://problem/11447652>
+
+        Reviewed by John Sullivan.
+
+        Add the plug-in identifier and version string to the didFail client callback.
+
+        * UIProcess/API/C/WKPage.h:
+        * UIProcess/WebLoaderClient.cpp:
+        (WebKit::WebLoaderClient::didFailToInitializePlugin):
+        Pass a null plug-in identifier and version here since we don't have the plug-in information here.
+
+        (WebKit::WebLoaderClient::didBlockInsecurePluginVersion):
+        * UIProcess/WebLoaderClient.h:
+        (WebLoaderClient):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::didBlockInsecurePluginVersion):
+
 2012-05-14  Andreas Kling  <[email protected]>
 
         REGRESSION(r116796): Assertion failure in API tests

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPage.h (116992 => 116993)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPage.h	2012-05-14 20:48:43 UTC (rev 116992)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPage.h	2012-05-14 20:49:54 UTC (rev 116993)
@@ -72,7 +72,7 @@
 typedef bool (*WKPageShouldGoToBackForwardListItemCallback)(WKPageRef page, WKBackForwardListItemRef item, const void *clientInfo);
 typedef void (*WKPageDidNewFirstVisuallyNonEmptyLayoutCallback)(WKPageRef page, WKTypeRef userData, const void *clientInfo);
 typedef void (*WKPageWillGoToBackForwardListItemCallback)(WKPageRef page, WKBackForwardListItemRef item, WKTypeRef userData, const void *clientInfo);
-typedef void (*WKPagePluginDidFailCallback)(WKPageRef page, WKErrorCode errorCode, WKStringRef mimeType, const void* clientInfo);
+typedef void (*WKPagePluginDidFailCallback)(WKPageRef page, WKErrorCode errorCode, WKStringRef mimeType, WKStringRef pluginIdentifier, WKStringRef pluginVersion, const void* clientInfo);
 
 // Deprecated
 typedef void (*WKPageDidFailToInitializePluginCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef mimeType, const void* clientInfo);

Modified: trunk/Source/WebKit2/UIProcess/WebLoaderClient.cpp (116992 => 116993)


--- trunk/Source/WebKit2/UIProcess/WebLoaderClient.cpp	2012-05-14 20:48:43 UTC (rev 116992)
+++ trunk/Source/WebKit2/UIProcess/WebLoaderClient.cpp	2012-05-14 20:49:54 UTC (rev 116993)
@@ -272,15 +272,15 @@
     if (!m_client.pluginDidFail)
         return;
 
-    m_client.pluginDidFail(toAPI(page), kWKErrorCodeCannotLoadPlugIn, toAPI(mimeType.impl()), m_client.clientInfo);
+    m_client.pluginDidFail(toAPI(page), kWKErrorCodeCannotLoadPlugIn, toAPI(mimeType.impl()), 0, 0, m_client.clientInfo);
 }
 
-void WebLoaderClient::didBlockInsecurePluginVersion(WebPageProxy* page, const String& mimeType)
+void WebLoaderClient::didBlockInsecurePluginVersion(WebPageProxy* page, const String& mimeType, const String& pluginIdentifier, const String& pluginVersion)
 {
     if (!m_client.pluginDidFail)
         return;
 
-    m_client.pluginDidFail(toAPI(page), kWKErrorCodeInsecurePlugInVersion, toAPI(mimeType.impl()), m_client.clientInfo);
+    m_client.pluginDidFail(toAPI(page), kWKErrorCodeInsecurePlugInVersion, toAPI(mimeType.impl()), toAPI(pluginIdentifier.impl()), toAPI(pluginVersion.impl()), m_client.clientInfo);
 }
 
 } // namespace WebKit

Modified: trunk/Source/WebKit2/UIProcess/WebLoaderClient.h (116992 => 116993)


--- trunk/Source/WebKit2/UIProcess/WebLoaderClient.h	2012-05-14 20:48:43 UTC (rev 116992)
+++ trunk/Source/WebKit2/UIProcess/WebLoaderClient.h	2012-05-14 20:49:54 UTC (rev 116993)
@@ -87,7 +87,7 @@
     void willGoToBackForwardListItem(WebPageProxy*, WebBackForwardListItem*, APIObject*);
 
     void didFailToInitializePlugin(WebPageProxy*, const String& mimeType);
-    void didBlockInsecurePluginVersion(WebPageProxy*, const String& mimeType);
+    void didBlockInsecurePluginVersion(WebPageProxy*, const String& mimeType, const String& pluginIdentifier, const String& pluginVersion);
 };
 
 } // namespace WebKit

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (116992 => 116993)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2012-05-14 20:48:43 UTC (rev 116992)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2012-05-14 20:49:54 UTC (rev 116993)
@@ -3623,7 +3623,18 @@
 
 void WebPageProxy::didBlockInsecurePluginVersion(const String& mimeType)
 {
-    m_loaderClient.didBlockInsecurePluginVersion(this, mimeType);
+    String pluginIdentifier;
+    String pluginVersion;
+
+#if PLATFORM(MAC)
+    String newMimeType = mimeType;
+    PluginModuleInfo plugin = m_process->context()->pluginInfoStore().findPlugin(newMimeType, KURL());
+
+    pluginIdentifier = plugin.bundleIdentifier;
+    pluginVersion = plugin.versionString;
+#endif
+
+    m_loaderClient.didBlockInsecurePluginVersion(this, mimeType, pluginIdentifier, pluginVersion);
 }
 
 bool WebPageProxy::willHandleHorizontalScrollEvents() const
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to