Diff
Modified: branches/safari-534.59-branch/Source/WebCore/ChangeLog (144575 => 144576)
--- branches/safari-534.59-branch/Source/WebCore/ChangeLog 2013-03-03 16:16:21 UTC (rev 144575)
+++ branches/safari-534.59-branch/Source/WebCore/ChangeLog 2013-03-03 18:27:44 UTC (rev 144576)
@@ -1,3 +1,19 @@
+2013-03-03 Brady Eidson <[email protected]>
+
+ Merge r143815
+
+ 2013-02-22 Anders Carlsson <[email protected]>
+
+ pluginLoadStrategy should take a WKDictionaryRef for extensibility
+ https://bugs.webkit.org/show_bug.cgi?id=110656
+ <rdar://problem/13265303>
+
+ Reviewed by Jessie Berlin.
+
+ Export a symbol needed by WebKit2.
+
+ * WebCore.exp.in:
+
2012-12-14 Andy Estes <[email protected]>
Merge r118820.
Modified: branches/safari-534.59-branch/Source/WebCore/WebCore.exp.in (144575 => 144576)
--- branches/safari-534.59-branch/Source/WebCore/WebCore.exp.in 2013-03-03 16:16:21 UTC (rev 144575)
+++ branches/safari-534.59-branch/Source/WebCore/WebCore.exp.in 2013-03-03 18:27:44 UTC (rev 144576)
@@ -1163,6 +1163,7 @@
__ZNK7WebCore13ResourceErrorcvP7NSErrorEv
__ZNK7WebCore14DocumentLoader10requestURLEv
__ZNK7WebCore14DocumentLoader11frameLoaderEv
+__ZNK7WebCore14DocumentLoader11responseURLEv
__ZNK7WebCore14DocumentLoader11subresourceERKNS_4KURLE
__ZNK7WebCore14DocumentLoader12mainResourceEv
__ZNK7WebCore14DocumentLoader13urlForHistoryEv
Modified: branches/safari-534.59-branch/Source/WebKit2/ChangeLog (144575 => 144576)
--- branches/safari-534.59-branch/Source/WebKit2/ChangeLog 2013-03-03 16:16:21 UTC (rev 144575)
+++ branches/safari-534.59-branch/Source/WebKit2/ChangeLog 2013-03-03 18:27:44 UTC (rev 144576)
@@ -1,3 +1,47 @@
+2013-03-03 Brady Eidson <[email protected]>
+
+ Merge r143815
+
+ 2013-02-22 Anders Carlsson <[email protected]>
+
+ pluginLoadStrategy should take a WKDictionaryRef for extensibility
+ https://bugs.webkit.org/show_bug.cgi?id=110656
+ <rdar://problem/13265303>
+
+ Reviewed by Jessie Berlin.
+
+ Change pluginLoadStrategy to take a WKDictionaryRef instead of a number of parameters;
+ this lets us add more plug-in information if needed. Also add the page URL and rename documentURL to frameURL.
+
+ * UIProcess/API/C/WKPage.cpp:
+ (WKPageGetPluginInformationBundleIdentifierKey):
+ (WKPageGetPluginInformationBundleVersionKey):
+ (WKPageGetPluginInformationDisplayNameKey):
+ (WKPageGetPluginInformationFrameURLKey):
+ (WKPageGetPluginInformationMIMETypeKey):
+ (WKPageGetPluginInformationPageURLKey):
+ * UIProcess/API/C/WKPage.h:
+ * UIProcess/WebLoaderClient.cpp:
+ (WebKit):
+ (WebKit::WebLoaderClient::pluginLoadPolicy):
+ * UIProcess/WebLoaderClient.h:
+ (WebLoaderClient):
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::getPluginPath):
+ (WebKit::WebPageProxy::pluginInformationBundleIdentifierKey):
+ (WebKit):
+ (WebKit::WebPageProxy::pluginInformationBundleVersionKey):
+ (WebKit::WebPageProxy::pluginInformationDisplayNameKey):
+ (WebKit::WebPageProxy::pluginInformationFrameURLKey):
+ (WebKit::WebPageProxy::pluginInformationMIMETypeKey):
+ (WebKit::WebPageProxy::pluginInformationPageURLKey):
+ * UIProcess/WebPageProxy.h:
+ (WebPageProxy):
+ * UIProcess/WebPageProxy.messages.in:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::createPlugin):
+ (WebKit::WebPage::canPluginHandleResponse):
+
2013-03-02 Brady Eidson <[email protected]>
Merge r143790
Modified: branches/safari-534.59-branch/Source/WebKit2/UIProcess/API/C/WKPage.cpp (144575 => 144576)
--- branches/safari-534.59-branch/Source/WebKit2/UIProcess/API/C/WKPage.cpp 2013-03-03 16:16:21 UTC (rev 144575)
+++ branches/safari-534.59-branch/Source/WebKit2/UIProcess/API/C/WKPage.cpp 2013-03-03 18:27:44 UTC (rev 144576)
@@ -587,3 +587,39 @@
return toAPI(webImage.release().leakRef());
}
+
+WKStringRef WKPageGetPluginInformationBundleIdentifierKey()
+{
+ static WebString* key = WebString::create(WebPageProxy::pluginInformationBundleIdentifierKey()).leakRef();
+ return toAPI(key);
+}
+
+WKStringRef WKPageGetPluginInformationBundleVersionKey()
+{
+ static WebString* key = WebString::create(WebPageProxy::pluginInformationBundleVersionKey()).leakRef();
+ return toAPI(key);
+}
+
+WKStringRef WKPageGetPluginInformationDisplayNameKey()
+{
+ static WebString* key = WebString::create(WebPageProxy::pluginInformationDisplayNameKey()).leakRef();
+ return toAPI(key);
+}
+
+WKStringRef WKPageGetPluginInformationFrameURLKey()
+{
+ static WebString* key = WebString::create(WebPageProxy::pluginInformationFrameURLKey()).leakRef();
+ return toAPI(key);
+}
+
+WKStringRef WKPageGetPluginInformationMIMETypeKey()
+{
+ static WebString* key = WebString::create(WebPageProxy::pluginInformationMIMETypeKey()).leakRef();
+ return toAPI(key);
+}
+
+WKStringRef WKPageGetPluginInformationPageURLKey()
+{
+ static WebString* key = WebString::create(WebPageProxy::pluginInformationPageURLKey()).leakRef();
+ return toAPI(key);
+}
Modified: branches/safari-534.59-branch/Source/WebKit2/UIProcess/API/C/WKPage.h (144575 => 144576)
--- branches/safari-534.59-branch/Source/WebKit2/UIProcess/API/C/WKPage.h 2013-03-03 16:16:21 UTC (rev 144575)
+++ branches/safari-534.59-branch/Source/WebKit2/UIProcess/API/C/WKPage.h 2013-03-03 18:27:44 UTC (rev 144576)
@@ -77,7 +77,7 @@
typedef void (*WKPageDidChangeBackForwardListCallback)(WKPageRef page, WKBackForwardListItemRef addedItem, WKArrayRef removedItems, const void *clientInfo);
typedef bool (*WKPageShouldGoToBackForwardListItemCallback)(WKPageRef page, WKBackForwardListItemRef item, const void *clientInfo);
typedef void (*WKPagePluginDidFailCallback)(WKPageRef page, WKErrorCode errorCode, WKStringRef mimeType, WKStringRef pluginIdentifier, WKStringRef pluginVersion, const void *clientInfo);
-typedef WKPluginLoadPolicy (*WKPagePluginLoadPolicyCallback)(WKPageRef page, WKStringRef identifier, WKStringRef displayName, WKURLRef documentURL, WKPluginLoadPolicy currentPluginLoadPolicy, const void* clientInfo);
+typedef WKPluginLoadPolicy (*WKPagePluginLoadPolicyCallback)(WKPageRef page, WKPluginLoadPolicy currentPluginLoadPolicy, WKDictionaryRef pluginInfoDictionary, const void* clientInfo);
// Deprecated
typedef void (*WKPageDidFailToInitializePluginCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef mimeType, const void* clientInfo);
@@ -434,6 +434,25 @@
WK_EXPORT void WKPageValidateCommand(WKPageRef page, WKStringRef command, void* context, WKPageValidateCommandCallback callback);
WK_EXPORT void WKPageExecuteCommand(WKPageRef page, WKStringRef command);
+/* Value type: WKStringRef */
+WK_EXPORT WKStringRef WKPageGetPluginInformationBundleIdentifierKey();
+
+/* Value type: WKStringRef */
+WK_EXPORT WKStringRef WKPageGetPluginInformationBundleVersionKey();
+
+/* Value type: WKStringRef */
+WK_EXPORT WKStringRef WKPageGetPluginInformationDisplayNameKey();
+
+/* Value type: WKURLRef */
+WK_EXPORT WKStringRef WKPageGetPluginInformationFrameURLKey();
+
+/* Value type: WKStringRef */
+WK_EXPORT WKStringRef WKPageGetPluginInformationMIMETypeKey();
+
+/* Value type: WKURLRef */
+WK_EXPORT WKStringRef WKPageGetPluginInformationPageURLKey();
+
+
#ifdef __cplusplus
}
#endif
Modified: branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebLoaderClient.cpp (144575 => 144576)
--- branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebLoaderClient.cpp 2013-03-03 16:16:21 UTC (rev 144575)
+++ branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebLoaderClient.cpp 2013-03-03 18:27:44 UTC (rev 144576)
@@ -27,7 +27,9 @@
#include "WebLoaderClient.h"
#include "ImmutableArray.h"
+#include "ImmutableDictionary.h"
#include "WebBackForwardListItem.h"
+#include "WebPageProxy.h"
#include "WKAPICast.h"
#include <string.h>
@@ -280,12 +282,18 @@
return PluginModuleBlocked;
}
-PluginModuleLoadPolicy WebLoaderClient::pluginLoadPolicy(WebPageProxy* page, const String& identifier, const String& displayName, const String& documentURLString, PluginModuleLoadPolicy currentPluginLoadPolicy)
+PluginModuleLoadPolicy WebLoaderClient::pluginLoadPolicy(WebPageProxy* page, const String& identifier, const String& displayName, const String& frameURLString, const String& pageURLString, PluginModuleLoadPolicy currentPluginLoadPolicy)
{
if (!m_client.pluginLoadPolicy)
return currentPluginLoadPolicy;
- return toPluginModuleLoadPolicy(m_client.pluginLoadPolicy(toAPI(page), toAPI(identifier.impl()), toAPI(displayName.impl()), toURLRef(documentURLString.impl()), toWKPluginLoadPolicy(currentPluginLoadPolicy), m_client.clientInfo));
+ HashMap<String, RefPtr<APIObject> > pluginInfoMap;
+ pluginInfoMap.set(WebPageProxy::pluginInformationBundleIdentifierKey(), WebString::create(identifier));
+ pluginInfoMap.set(WebPageProxy::pluginInformationDisplayNameKey(), WebString::create(displayName));
+ pluginInfoMap.set(WebPageProxy::pluginInformationFrameURLKey(), WebURL::create(frameURLString));
+ pluginInfoMap.set(WebPageProxy::pluginInformationPageURLKey(), WebURL::create(pageURLString));
+
+ return toPluginModuleLoadPolicy(m_client.pluginLoadPolicy(toAPI(page), toWKPluginLoadPolicy(currentPluginLoadPolicy), toAPI(ImmutableDictionary::adopt(pluginInfoMap).get()), m_client.clientInfo));
}
Modified: branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebLoaderClient.h (144575 => 144576)
--- branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebLoaderClient.h 2013-03-03 16:16:21 UTC (rev 144575)
+++ branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebLoaderClient.h 2013-03-03 18:27:44 UTC (rev 144576)
@@ -80,7 +80,7 @@
void didChangeBackForwardList(WebPageProxy*, WebBackForwardListItem* addedItem, Vector<RefPtr<APIObject> >* removedItems);
bool shouldGoToBackForwardListItem(WebPageProxy*, WebBackForwardListItem*);
- PluginModuleLoadPolicy pluginLoadPolicy(WebPageProxy*, const String& identifier, const String& displayName, const String& documentURLString, PluginModuleLoadPolicy currentPluginLoadPolicy);
+ PluginModuleLoadPolicy pluginLoadPolicy(WebPageProxy*, const String& bundleIdentifier, const String& displayName, const String& frameURLString, const String& pageURLString, PluginModuleLoadPolicy currentPluginLoadPolicy);
void didFailToInitializePlugin(WebPageProxy*, const String& mimeType);
void didBlockInsecurePluginVersion(WebPageProxy*, const String& mimeType, const String& pluginIdentifier, const String& pluginVersion);
Modified: branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp (144575 => 144576)
--- branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp 2013-03-03 16:16:21 UTC (rev 144575)
+++ branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp 2013-03-03 18:27:44 UTC (rev 144576)
@@ -920,7 +920,7 @@
}
#if ENABLE(NETSCAPE_PLUGIN_API)
-void WebPageProxy::getPluginPath(const String& mimeType, const String& urlString, const String& documentURLString, String& pluginPath, uint32_t& pluginLoadPolicy)
+void WebPageProxy::getPluginPath(const String& mimeType, const String& urlString, const String& frameURLString, const String& pageURLString, String& pluginPath, uint32_t& pluginLoadPolicy)
{
MESSAGE_CHECK(urlString);
@@ -934,7 +934,7 @@
pluginLoadPolicy = PluginInfoStore::policyForPlugin(plugin);
PluginModuleLoadPolicy currentPluginLoadPolicy = static_cast<PluginModuleLoadPolicy>(pluginLoadPolicy);
- pluginLoadPolicy = m_loaderClient.pluginLoadPolicy(this, plugin.bundleIdentifier, plugin.info.name, documentURLString, currentPluginLoadPolicy);
+ pluginLoadPolicy = m_loaderClient.pluginLoadPolicy(this, plugin.bundleIdentifier, plugin.info.name, frameURLString, pageURLString, currentPluginLoadPolicy);
if (pluginLoadPolicy != PluginModuleLoadNormally)
return;
@@ -3376,4 +3376,34 @@
}
#endif // PLATFORM(MAC)
+String WebPageProxy::pluginInformationBundleIdentifierKey()
+{
+ return "PluginInformationBundleIdentifier";
+}
+
+String WebPageProxy::pluginInformationBundleVersionKey()
+{
+ return "PluginInformationBundleVersion";
+}
+
+String WebPageProxy::pluginInformationDisplayNameKey()
+{
+ return "PluginInformationDisplayName";
+}
+
+String WebPageProxy::pluginInformationFrameURLKey()
+{
+ return "PluginInformationFrameURL";
+}
+
+String WebPageProxy::pluginInformationMIMETypeKey()
+{
+ return "PluginInformationMIMEType";
+}
+
+String WebPageProxy::pluginInformationPageURLKey()
+{
+ return "PluginInformationPageURL";
+}
+
} // namespace WebKit
Modified: branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebPageProxy.h (144575 => 144576)
--- branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebPageProxy.h 2013-03-03 16:16:21 UTC (rev 144575)
+++ branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebPageProxy.h 2013-03-03 18:27:44 UTC (rev 144576)
@@ -537,6 +537,13 @@
uint64_t renderTreeSize() const { return m_renderTreeSize; }
+ static String pluginInformationBundleIdentifierKey();
+ static String pluginInformationBundleVersionKey();
+ static String pluginInformationDisplayNameKey();
+ static String pluginInformationFrameURLKey();
+ static String pluginInformationMIMETypeKey();
+ static String pluginInformationPageURLKey();
+
private:
WebPageProxy(PageClient*, PassRefPtr<WebProcessProxy>, WebPageGroup*, uint64_t pageID);
@@ -768,7 +775,7 @@
void setRenderTreeSize(uint64_t treeSize) { m_renderTreeSize = treeSize; }
#if ENABLE(NETSCAPE_PLUGIN_API)
- void getPluginPath(const String& mimeType, const String& urlString, const String& documentURLString, String& pluginPath, uint32_t& pluginLoadPolicy);
+ void getPluginPath(const String& mimeType, const String& urlString, const String& frameURLString, const String& pageURLString, String& pluginPath, uint32_t& pluginLoadPolicy);
#endif
PageClient* m_pageClient;
Modified: branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in (144575 => 144576)
--- branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in 2013-03-03 16:16:21 UTC (rev 144575)
+++ branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in 2013-03-03 18:27:44 UTC (rev 144576)
@@ -263,6 +263,6 @@
}
#if ENABLE(NETSCAPE_PLUGIN_API)
-GetPluginPath(WTF::String mimeType, WTF::String urlString, WTF::String documentURLString) -> (WTF::String pluginPath, uint32_t pluginLoadPolicy)
+ GetPluginPath(WTF::String mimeType, WTF::String urlString, WTF::String frameURLString, WTF::String pageURLString) -> (WTF::String pluginPath, uint32_t pluginLoadPolicy)
#endif
Modified: branches/safari-534.59-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (144575 => 144576)
--- branches/safari-534.59-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2013-03-03 16:16:21 UTC (rev 144575)
+++ branches/safari-534.59-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2013-03-03 18:27:44 UTC (rev 144576)
@@ -332,8 +332,10 @@
{
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))) {
+ String frameURLString = frame->coreFrame()->loader()->documentLoader()->responseURL().string();
+ String pageURLString = m_page->mainFrame()->loader()->documentLoader()->responseURL().string();
+
+ if (!sendSync(Messages::WebPageProxy::GetPluginPath(parameters.mimeType, parameters.url.string(), frameURLString, pageURLString), Messages::WebPageProxy::GetPluginPath::Reply(pluginPath, pluginLoadPolicy))) {
return 0;
}
Modified: branches/safari-534.59-branch/Source/WebKit2/WebProcess/WebProcess.cpp (144575 => 144576)
--- branches/safari-534.59-branch/Source/WebKit2/WebProcess/WebProcess.cpp 2013-03-03 16:16:21 UTC (rev 144575)
+++ branches/safari-534.59-branch/Source/WebKit2/WebProcess/WebProcess.cpp 2013-03-03 18:27:44 UTC (rev 144576)
@@ -735,7 +735,7 @@
String pluginPath;
uint32_t pluginLoadPolicy;
- if (!m_connection->sendSync(Messages::WebPageProxy::GetPluginPath(response.mimeType(), response.url().string(), response.url().string()), Messages::WebPageProxy::GetPluginPath::Reply(pluginPath, pluginLoadPolicy), 0))
+ if (!m_connection->sendSync(Messages::WebPageProxy::GetPluginPath(response.mimeType(), response.url().string(), response.url().string(), response.url().string()), Messages::WebPageProxy::GetPluginPath::Reply(pluginPath, pluginLoadPolicy), 0))
return false;
return pluginLoadPolicy != PluginModuleBlocked && !pluginPath.isEmpty();