Title: [144551] branches/safari-534.59-branch
Revision
144551
Author
[email protected]
Date
2013-03-02 20:05:00 -0800 (Sat, 02 Mar 2013)

Log Message

Merge r141486

    2013-01-31  Brian Weinstein  <[email protected]>

    Add a call to the page UI client to determine if a plug-in should load
    https://bugs.webkit.org/show_bug.cgi?id=108407
    <rdar://problem/13066332>

Source/WebKit2: 

    Reviewed by Anders Carlsson.

    This patch adds a client call to the WKPageUIClient to be called to determine
    whether or not a plug-in should load.

    * UIProcess/API/C/WKPage.h: Add shouldLoadPlugin.
    * UIProcess/WebPageProxy.cpp:
    (WebKit::WebPageProxy::getPluginPath): Moved from WebProcessProxy, and added a call to
        m_uiClient.shouldInstantiatePlugin.
    * UIProcess/WebPageProxy.h:
    * UIProcss/WebPageProxy.messages.in: Moved GetPluginPath from WebProcessProxy to WebPageProxy.
    * UIProcess/WebProcessProxy.cpp:
    (WebKit::WebProcessProxy::getPluginPath): Moved to WebPageProxy.
    * UIProcess/WebProcessProxy.h:
    * UIProcess/WebUIClient.cpp:
    (WebKit::WebUIClient::shouldInstantiatePlugin): Return that we should load the plug-in if
        the client function isn't defined, and call the function if it is.
    * UIProcess/WebUIClient.h:
    * UIProcess/mac/WebInspectorProxyMac.mm:
    (WebKit::WebInspectorProxy::platformCreateInspectorPage): Add an entry for the new
        client function.
    * WebProcess/WebPage/WebPage.cpp:
    (WebKit::WebPage::createPlugin): Send the message to the WebPageProxy, not the WebProcessProxy.
    (WebKit::WebPage::canPluginHandleResponse): Made a member function, so it can call sendSync, and
        send the message to the WebPageProxy, not the WebProcessProxy.
    * WebProcess/WebPage/WebPage.h:

Tools: 

    Add entries for the new function in the necessary structs.

    Reviewed by Anders Carlsson.

    * MiniBrowser/mac/WK2BrowserWindowController.m:
    (-[WK2BrowserWindowController awakeFromNib]):
    * WebKitTestRunner/TestController.cpp:
    (WTR::TestController::createOtherPage):
    (WTR::TestController::createWebViewWithOptions):

Modified Paths

Added Paths

Diff

Modified: branches/safari-534.59-branch/Source/WebKit2/ChangeLog (144550 => 144551)


--- branches/safari-534.59-branch/Source/WebKit2/ChangeLog	2013-03-03 02:53:28 UTC (rev 144550)
+++ branches/safari-534.59-branch/Source/WebKit2/ChangeLog	2013-03-03 04:05:00 UTC (rev 144551)
@@ -1,3 +1,40 @@
+2013-03-02  Brady Eidson  <[email protected]>
+
+        Merge r141486
+
+    2013-01-31  Brian Weinstein  <[email protected]>
+
+            Add a call to the page UI client to determine if a plug-in should load
+            https://bugs.webkit.org/show_bug.cgi?id=108407
+            <rdar://problem/13066332>
+
+            Reviewed by Anders Carlsson.
+
+            This patch adds a client call to the WKPageUIClient to be called to determine
+            whether or not a plug-in should load.
+
+            * UIProcess/API/C/WKPage.h: Add shouldLoadPlugin.
+            * UIProcess/WebPageProxy.cpp:
+            (WebKit::WebPageProxy::getPluginPath): Moved from WebProcessProxy, and added a call to
+                m_uiClient.shouldInstantiatePlugin.
+            * UIProcess/WebPageProxy.h:
+            * UIProcss/WebPageProxy.messages.in: Moved GetPluginPath from WebProcessProxy to WebPageProxy.
+            * UIProcess/WebProcessProxy.cpp:
+            (WebKit::WebProcessProxy::getPluginPath): Moved to WebPageProxy.
+            * UIProcess/WebProcessProxy.h:
+            * UIProcess/WebUIClient.cpp:
+            (WebKit::WebUIClient::shouldInstantiatePlugin): Return that we should load the plug-in if
+                the client function isn't defined, and call the function if it is.
+            * UIProcess/WebUIClient.h:
+            * UIProcess/mac/WebInspectorProxyMac.mm:
+            (WebKit::WebInspectorProxy::platformCreateInspectorPage): Add an entry for the new
+                client function.
+            * WebProcess/WebPage/WebPage.cpp:
+            (WebKit::WebPage::createPlugin): Send the message to the WebPageProxy, not the WebProcessProxy.
+            (WebKit::WebPage::canPluginHandleResponse): Made a member function, so it can call sendSync, and
+                send the message to the WebPageProxy, not the WebProcessProxy.
+            * WebProcess/WebPage/WebPage.h:
+
 2012-10-01  Andy Estes  <[email protected]>
 
         Merge r124259.

Added: branches/safari-534.59-branch/Source/WebKit2/Shared/Plugins/PluginModuleInfo.h (0 => 144551)


--- branches/safari-534.59-branch/Source/WebKit2/Shared/Plugins/PluginModuleInfo.h	                        (rev 0)
+++ branches/safari-534.59-branch/Source/WebKit2/Shared/Plugins/PluginModuleInfo.h	2013-03-03 04:05:00 UTC (rev 144551)
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PluginModuleInfo_h
+#define PluginModuleInfo_h
+
+#include <WebCore/PluginData.h>
+
+#if PLATFORM(MAC)
+#include <mach/machine.h>
+#endif
+
+namespace WebKit {
+
+enum PluginModuleLoadPolicy {
+    // The plug-in module should be loaded normally.
+    PluginModuleLoadNormally,
+
+    // The plug-in should be blocked from being instantiated.
+    // Note that the plug-in will still be seen by e.g. navigator.plugins
+    PluginModuleBlocked,
+
+    // The plug-in module is inactive and should not be instantiated unless the user explicitly allows it.
+    PluginModuleInactive
+};
+
+struct PluginModuleInfo {
+    String path;
+    WebCore::PluginInfo info;
+
+#if PLATFORM(MAC)
+    cpu_type_t pluginArchitecture;
+    String bundleIdentifier;
+    String versionString;
+#endif
+};
+
+} // namespace WebKit
+
+#endif // PluginModuleInfo_h

Modified: branches/safari-534.59-branch/Source/WebKit2/UIProcess/API/C/WKPage.h (144550 => 144551)


--- branches/safari-534.59-branch/Source/WebKit2/UIProcess/API/C/WKPage.h	2013-03-03 02:53:28 UTC (rev 144550)
+++ branches/safari-534.59-branch/Source/WebKit2/UIProcess/API/C/WKPage.h	2013-03-03 04:05:00 UTC (rev 144551)
@@ -198,6 +198,7 @@
 typedef void (*WKPageSaveDataToFileInDownloadsFolderCallback)(WKPageRef page, WKStringRef suggestedFilename, WKStringRef mimeType, WKURLRef originatingURL, WKDataRef data, const void* clientInfo);
 typedef bool (*WKPageShouldInterruptJavaScriptCallback)(WKPageRef page, const void *clientInfo);
 typedef void (*WKPageUnavailablePluginButtonClickedCallback)(WKPageRef page, WKPluginUnavailabilityReason pluginUnavailabilityReason, WKStringRef mimeType, WKStringRef url, WKStringRef pluginsPageURL, const void* clientInfo);
+typedef bool (*WKPageShouldInstantiatePluginCallback)(WKPageRef page, WKStringRef identifier, WKStringRef displayName, const void* clientInfo);
 
 // Deprecated
 typedef void (*WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef mimeType, WKStringRef url, WKStringRef pluginsPageURL, const void* clientInfo);
@@ -245,6 +246,7 @@
     WKPageSaveDataToFileInDownloadsFolderCallback                       saveDataToFileInDownloadsFolder;
     WKPageShouldInterruptJavaScriptCallback                             shouldInterruptJavaScript;
     WKPageUnavailablePluginButtonClickedCallback                        unavailablePluginButtonClicked;
+    WKPageShouldInstantiatePluginCallback                               shouldInstantiatePlugin;
 };
 typedef struct WKPageUIClient WKPageUIClient;
 

Modified: branches/safari-534.59-branch/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h (144550 => 144551)


--- branches/safari-534.59-branch/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h	2013-03-03 02:53:28 UTC (rev 144550)
+++ branches/safari-534.59-branch/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h	2013-03-03 04:05:00 UTC (rev 144551)
@@ -26,6 +26,7 @@
 #ifndef PluginInfoStore_h
 #define PluginInfoStore_h
 
+#include "PluginModuleInfo.h"
 #include <WebCore/PluginData.h>
 
 namespace WebCore {
@@ -70,6 +71,8 @@
     // Note that the plug-in will still be seen by e.g. navigator.plugins
     bool shouldBlockPlugin(const PluginInfoStore::Plugin&) const;
 
+    static PluginModuleLoadPolicy policyForPlugin(const Plugin&);
+
 private:
     Plugin findPluginForMIMEType(const String& mimeType);
     Plugin findPluginForExtension(const String& extension, String& mimeType);

Modified: branches/safari-534.59-branch/Source/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm (144550 => 144551)


--- branches/safari-534.59-branch/Source/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm	2013-03-03 02:53:28 UTC (rev 144550)
+++ branches/safari-534.59-branch/Source/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm	2013-03-03 04:05:00 UTC (rev 144551)
@@ -135,4 +135,12 @@
     return WKGetMIMETypeForExtension((NSString *)extensionCFString.get());
 }
 
+PluginModuleLoadPolicy PluginInfoStore::policyForPlugin(const Plugin& plugin)
+{
+    if (WKShouldBlockPlugin(plugin.bundleIdentifier, plugin.versionString))
+        return PluginModuleBlocked;
+    
+    return PluginModuleLoadNormally;
+}
+
 } // namespace WebKit

Modified: branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebContext.cpp (144550 => 144551)


--- branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebContext.cpp	2013-03-03 02:53:28 UTC (rev 144550)
+++ branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebContext.cpp	2013-03-03 04:05:00 UTC (rev 144551)
@@ -549,23 +549,6 @@
 #endif
 }
 
-void WebContext::getPluginPath(const String& mimeType, const String& urlString, String& pluginPath, bool& blocked)
-{
-    String newMimeType = mimeType.lower();
-
-    blocked = false;
-    PluginInfoStore::Plugin plugin = pluginInfoStore().findPlugin(newMimeType, KURL(ParsedURLString, urlString));
-    if (!plugin.path)
-        return;
-
-    if (pluginInfoStore().shouldBlockPlugin(plugin)) {
-        blocked = true;
-        return;
-    }
-
-    pluginPath = plugin.path;
-}
-
 #if !ENABLE(PLUGIN_PROCESS)
 void WebContext::didGetSitesWithPluginData(const Vector<String>& sites, uint64_t callbackID)
 {

Modified: branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebContext.h (144550 => 144551)


--- branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebContext.h	2013-03-03 02:53:28 UTC (rev 144550)
+++ branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebContext.h	2013-03-03 04:05:00 UTC (rev 144551)
@@ -203,7 +203,6 @@
 
     // Plugins
     void getPlugins(bool refresh, Vector<WebCore::PluginInfo>&);
-    void getPluginPath(const String& mimeType, const String& urlString, String& pluginPath, bool& blocked);
 #if !ENABLE(PLUGIN_PROCESS)
     void didGetSitesWithPluginData(const Vector<String>& sites, uint64_t callbackID);
     void didClearPluginSiteData(uint64_t callbackID);

Modified: branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebContext.messages.in (144550 => 144551)


--- branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebContext.messages.in	2013-03-03 02:53:28 UTC (rev 144550)
+++ branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebContext.messages.in	2013-03-03 04:05:00 UTC (rev 144551)
@@ -33,7 +33,6 @@
     
     # Plugin messages.
     GetPlugins(bool refresh) -> (Vector<WebCore::PluginInfo> plugins)
-    GetPluginPath(WTF::String mimeType, WTF::String urlString) -> (WTF::String pluginPath, bool blocked)
 
 #if !ENABLE(PLUGIN_PROCESS)
     void DidGetSitesWithPluginData(Vector<WTF::String> sites, uint64_t callbackID)

Modified: branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp (144550 => 144551)


--- branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp	2013-03-03 02:53:28 UTC (rev 144550)
+++ branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp	2013-03-03 04:05:00 UTC (rev 144551)
@@ -919,6 +919,30 @@
     process()->send(Messages::WebPage::KeyEvent(event), m_pageID);
 }
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+void WebPageProxy::getPluginPath(const String& mimeType, const String& urlString, String& pluginPath, uint32_t& pluginLoadPolicy)
+{
+    MESSAGE_CHECK(urlString);
+
+    String newMimeType = mimeType.lower();
+
+    pluginLoadPolicy = PluginModuleLoadNormally;
+    PluginInfoStore::Plugin plugin = m_process->context()->pluginInfoStore().findPlugin(newMimeType, KURL(KURL(), urlString));
+    if (!plugin.path)
+        return;
+
+    pluginLoadPolicy = PluginInfoStore::policyForPlugin(plugin);
+    if (pluginLoadPolicy != PluginModuleLoadNormally)
+        return;
+
+    pluginLoadPolicy = m_uiClient.shouldInstantiatePlugin(this, plugin.bundleIdentifier, plugin.info.name) ? PluginModuleLoadNormally : PluginModuleBlocked;
+    if (pluginLoadPolicy != PluginModuleLoadNormally)
+        return;
+
+    pluginPath = plugin.path;
+}
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
+
 #if ENABLE(GESTURE_EVENTS)
 void WebPageProxy::handleGestureEvent(const WebGestureEvent& event)
 {

Modified: branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebPageProxy.h (144550 => 144551)


--- branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebPageProxy.h	2013-03-03 02:53:28 UTC (rev 144550)
+++ branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebPageProxy.h	2013-03-03 04:05:00 UTC (rev 144551)
@@ -767,6 +767,10 @@
 
     void setRenderTreeSize(uint64_t treeSize) { m_renderTreeSize = treeSize; }
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+    void getPluginPath(const String& mimeType, const String& urlString, String& pluginPath, uint32_t& pluginLoadPolicy);
+#endif
+
     PageClient* m_pageClient;
     WebLoaderClient m_loaderClient;
     WebPolicyClient m_policyClient;

Modified: branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in (144550 => 144551)


--- branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2013-03-03 02:53:28 UTC (rev 144550)
+++ branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2013-03-03 04:05:00 UTC (rev 144551)
@@ -261,3 +261,8 @@
     SaveRecentSearches(WTF::String name, Vector<String> searchItems)
     LoadRecentSearches(WTF::String name) -> (Vector<String> result)
 }
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+GetPluginPath(WTF::String mimeType, WTF::String urlString) -> (WTF::String pluginPath, uint32_t pluginLoadPolicy)
+#endif
+

Modified: branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebUIClient.cpp (144550 => 144551)


--- branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebUIClient.cpp	2013-03-03 02:53:28 UTC (rev 144550)
+++ branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebUIClient.cpp	2013-03-03 04:05:00 UTC (rev 144551)
@@ -399,4 +399,12 @@
     return m_client.shouldInterruptJavaScript(toAPI(page), m_client.clientInfo);
 }
 
+bool WebUIClient::shouldInstantiatePlugin(WebPageProxy* page, const String& identifier, const String& displayName)
+{
+    if (!m_client.shouldInstantiatePlugin)
+        return true;
+
+    return m_client.shouldInstantiatePlugin(toAPI(page), toAPI(identifier.impl()), toAPI(displayName.impl()), m_client.clientInfo);
+}
+
 } // namespace WebKit

Modified: branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebUIClient.h (144550 => 144551)


--- branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebUIClient.h	2013-03-03 02:53:28 UTC (rev 144550)
+++ branches/safari-534.59-branch/Source/WebKit2/UIProcess/WebUIClient.h	2013-03-03 04:05:00 UTC (rev 144551)
@@ -113,6 +113,8 @@
     void saveDataToFileInDownloadsFolder(WebPageProxy*, const String& suggestedFilename, const String& mimeType, const String& originatingURLString, WebData*);
 
     bool shouldInterruptJavaScript(WebPageProxy*);
+
+    bool shouldInstantiatePlugin(WebPageProxy*, const String& identifier, const String& displayName);
 };
 
 } // namespace WebKit

Modified: branches/safari-534.59-branch/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (144550 => 144551)


--- branches/safari-534.59-branch/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2013-03-03 02:53:28 UTC (rev 144550)
+++ branches/safari-534.59-branch/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2013-03-03 04:05:00 UTC (rev 144551)
@@ -387,7 +387,8 @@
 		51D130551382EAC000351EDD /* SecItemResponseData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D130511382EAC000351EDD /* SecItemResponseData.cpp */; };
 		51D130561382EAC000351EDD /* SecItemResponseData.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D130521382EAC000351EDD /* SecItemResponseData.h */; };
 		51D130581382F10500351EDD /* WebProcessProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51D130571382F10500351EDD /* WebProcessProxyMac.mm */; };
-		5272B28A1406985D0096A5D0 /* StatisticsData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5272B2881406985D0096A5D0 /* StatisticsData.cpp */; }; 
+		51EA7D0116E2EFAC00BA328A /* PluginModuleInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 51EA7D0016E2EFAC00BA328A /* PluginModuleInfo.h */; };
+		5272B28A1406985D0096A5D0 /* StatisticsData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5272B2881406985D0096A5D0 /* StatisticsData.cpp */; };
 		5272B28B1406985D0096A5D0 /* StatisticsData.h in Headers */ = {isa = PBXBuildFile; fileRef = 5272B2891406985D0096A5D0 /* StatisticsData.h */; };
 		5DA6ED0A1490606900B41D12 /* DynamicLinkerEnvironmentExtractor.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DA6ED081490606900B41D12 /* DynamicLinkerEnvironmentExtractor.h */; };
 		5DA6ED0B1490606900B41D12 /* DynamicLinkerEnvironmentExtractor.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5DA6ED091490606900B41D12 /* DynamicLinkerEnvironmentExtractor.mm */; };
@@ -1334,8 +1335,9 @@
 		51D130511382EAC000351EDD /* SecItemResponseData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SecItemResponseData.cpp; sourceTree = "<group>"; };
 		51D130521382EAC000351EDD /* SecItemResponseData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecItemResponseData.h; sourceTree = "<group>"; };
 		51D130571382F10500351EDD /* WebProcessProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebProcessProxyMac.mm; sourceTree = "<group>"; };
-		5272B2881406985D0096A5D0 /* StatisticsData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StatisticsData.cpp; sourceTree = "<group>"; }; 
-		5272B2891406985D0096A5D0 /* StatisticsData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StatisticsData.h; sourceTree = "<group>"; }; 
+		51EA7D0016E2EFAC00BA328A /* PluginModuleInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginModuleInfo.h; sourceTree = "<group>"; };
+		5272B2881406985D0096A5D0 /* StatisticsData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StatisticsData.cpp; sourceTree = "<group>"; };
+		5272B2891406985D0096A5D0 /* StatisticsData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StatisticsData.h; sourceTree = "<group>"; };
 		5DA6ED081490606900B41D12 /* DynamicLinkerEnvironmentExtractor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLinkerEnvironmentExtractor.h; sourceTree = "<group>"; };
 		5DA6ED091490606900B41D12 /* DynamicLinkerEnvironmentExtractor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DynamicLinkerEnvironmentExtractor.mm; sourceTree = "<group>"; };
 		5DAD7294116FF70B00EE5396 /* WebProcess.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = WebProcess.xcconfig; sourceTree = "<group>"; };
@@ -2205,8 +2207,8 @@
 				518D2CC912D51DFB003BB93B /* SessionState.h */,
 				1A6420E212DCE2FF00CAAE2C /* ShareableBitmap.cpp */,
 				1A6420E312DCE2FF00CAAE2C /* ShareableBitmap.h */,
-				5272B2881406985D0096A5D0 /* StatisticsData.cpp */, 
-				5272B2891406985D0096A5D0 /* StatisticsData.h */, 
+				5272B2881406985D0096A5D0 /* StatisticsData.cpp */,
+				5272B2891406985D0096A5D0 /* StatisticsData.h */,
 				BCBD3C3A125BFA7A00D2C29F /* StringPairVector.h */,
 				1A5E4DA312D3BD3D0099A2BB /* TextCheckerState.h */,
 				1A64245D12DE29A100CAAE2C /* UpdateInfo.cpp */,
@@ -2278,6 +2280,7 @@
 			isa = PBXGroup;
 			children = (
 				1A4A9C5212B816CF008FE984 /* Netscape */,
+				51EA7D0016E2EFAC00BA328A /* PluginModuleInfo.h */,
 				1A2D90D11281C966001EB962 /* PluginProcessCreationParameters.cpp */,
 				1A2D90D01281C966001EB962 /* PluginProcessCreationParameters.h */,
 				1A4A9F3112B844E2008FE984 /* PluginQuirks.h */,
@@ -3879,6 +3882,7 @@
 				93C01DAC139AC91700ED51D7 /* CoreIPCClientRunLoop.h in Headers */,
 				5272B28B1406985D0096A5D0 /* StatisticsData.h in Headers */,
 				5DA6ED0A1490606900B41D12 /* DynamicLinkerEnvironmentExtractor.h in Headers */,
+				51EA7D0116E2EFAC00BA328A /* PluginModuleInfo.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -4553,7 +4557,7 @@
 				512DF70A138C26C700A22FC6 /* KeychainAttribute.cpp in Sources */,
 				93C01DAD139AC91700ED51D7 /* CoreIPCClientRunLoop.mm in Sources */,
 				E199875E142C045400BB2DE7 /* BuiltInPDFView.cpp in Sources */,
-				5272B28A1406985D0096A5D0 /* StatisticsData.cpp in Sources */, 
+				5272B28A1406985D0096A5D0 /* StatisticsData.cpp in Sources */,
 				5DA6ED0B1490606900B41D12 /* DynamicLinkerEnvironmentExtractor.mm in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;

Modified: branches/safari-534.59-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (144550 => 144551)


--- branches/safari-534.59-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2013-03-03 02:53:28 UTC (rev 144550)
+++ branches/safari-534.59-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2013-03-03 04:05:00 UTC (rev 144551)
@@ -331,15 +331,15 @@
 PassRefPtr<Plugin> WebPage::createPlugin(WebFrame* frame, HTMLPlugInElement* pluginElement, const Plugin::Parameters& parameters)
 {
     String pluginPath;
-    bool blocked;
+    uint32_t pluginLoadPolicy;
 
-    if (!WebProcess::shared().connection()->sendSync(
-            Messages::WebContext::GetPluginPath(parameters.mimeType, parameters.url.string()), 
-            Messages::WebContext::GetPluginPath::Reply(pluginPath, blocked), 0)) {
+    if (!sendSync(
+            Messages::WebPageProxy::GetPluginPath(parameters.mimeType, parameters.url.string()),
+            Messages::WebPageProxy::GetPluginPath::Reply(pluginPath, pluginLoadPolicy))) {
         return 0;
     }
 
-    if (blocked) {
+    if (pluginLoadPolicy == PluginModuleBlocked) {
         if (pluginElement->renderer()->isEmbeddedObject())
             toRenderEmbeddedObject(pluginElement->renderer())->setPluginUnavailabilityReason(RenderEmbeddedObject::InsecurePluginVersion);
 

Modified: branches/safari-534.59-branch/Source/WebKit2/WebProcess/WebProcess.cpp (144550 => 144551)


--- branches/safari-534.59-branch/Source/WebKit2/WebProcess/WebProcess.cpp	2013-03-03 02:53:28 UTC (rev 144550)
+++ branches/safari-534.59-branch/Source/WebKit2/WebProcess/WebProcess.cpp	2013-03-03 04:05:00 UTC (rev 144551)
@@ -31,6 +31,7 @@
 #include "InjectedBundle.h"
 #include "InjectedBundleMessageKinds.h"
 #include "InjectedBundleUserMessageCoders.h"
+#include "PluginModuleInfo.h"
 #include "RunLoop.h"
 #include "SandboxExtension.h"
 #include "StatisticsData.h"
@@ -45,6 +46,7 @@
 #include "WebMediaCacheManager.h"
 #include "WebMemorySampler.h"
 #include "WebPage.h"
+#include "WebPageProxyMessages.h"
 #include "WebPageCreationParameters.h"
 #include "WebPlatformStrategies.h"
 #include "WebPreferencesStore.h"
@@ -728,15 +730,15 @@
     return result.first->second.get();
 }
 
-static bool canPluginHandleResponse(const ResourceResponse& response)
+bool WebProcess::canPluginHandleResponse(const ResourceResponse& response) const
 {
     String pluginPath;
-    bool blocked;
+    uint32_t pluginLoadPolicy;
 
-    if (!WebProcess::shared().connection()->sendSync(Messages::WebContext::GetPluginPath(response.mimeType(), response.url().string()), Messages::WebContext::GetPluginPath::Reply(pluginPath, blocked), 0))
+    if (!m_connection->sendSync(Messages::WebPageProxy::GetPluginPath(response.mimeType(), response.url().string()), Messages::WebPageProxy::GetPluginPath::Reply(pluginPath, pluginLoadPolicy), 0))
         return false;
 
-    return !blocked && !pluginPath.isEmpty();
+    return pluginLoadPolicy != PluginModuleBlocked && !pluginPath.isEmpty();
 }
 
 bool WebProcess::shouldUseCustomRepresentationForResponse(const ResourceResponse& response) const

Modified: branches/safari-534.59-branch/Source/WebKit2/WebProcess/WebProcess.h (144550 => 144551)


--- branches/safari-534.59-branch/Source/WebKit2/WebProcess/WebProcess.h	2013-03-03 02:53:28 UTC (rev 144550)
+++ branches/safari-534.59-branch/Source/WebKit2/WebProcess/WebProcess.h	2013-03-03 04:05:00 UTC (rev 144551)
@@ -201,6 +201,8 @@
     bool willProcessWebProcessMessageOnClientRunLoop(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
     void didReceiveWebProcessMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
 
+    bool canPluginHandleResponse(const WebCore::ResourceResponse&) const;
+
     RefPtr<CoreIPC::Connection> m_connection;
     HashMap<uint64_t, RefPtr<WebPage> > m_pageMap;
     HashMap<uint64_t, RefPtr<WebPageGroupProxy> > m_pageGroupMap;

Modified: branches/safari-534.59-branch/Tools/ChangeLog (144550 => 144551)


--- branches/safari-534.59-branch/Tools/ChangeLog	2013-03-03 02:53:28 UTC (rev 144550)
+++ branches/safari-534.59-branch/Tools/ChangeLog	2013-03-03 04:05:00 UTC (rev 144551)
@@ -1,3 +1,23 @@
+2013-03-02  Brady Eidson  <[email protected]>
+
+        Merge r141486
+
+    2013-01-31  Brian Weinstein  <[email protected]>
+
+            Add a call to the page UI client to determine if a plug-in should load
+            https://bugs.webkit.org/show_bug.cgi?id=108407
+            <rdar://problem/13066332>
+
+            Add entries for the new function in the necessary structs.
+
+            Reviewed by Anders Carlsson.
+
+            * MiniBrowser/mac/WK2BrowserWindowController.m:
+            (-[WK2BrowserWindowController awakeFromNib]):
+            * WebKitTestRunner/TestController.cpp:
+            (WTR::TestController::createOtherPage):
+            (WTR::TestController::createWebViewWithOptions):
+
 2012-08-21  Andy Estes  <[email protected]>
 
         Merge r116716.

Modified: branches/safari-534.59-branch/Tools/MiniBrowser/mac/BrowserWindowController.m (144550 => 144551)


--- branches/safari-534.59-branch/Tools/MiniBrowser/mac/BrowserWindowController.m	2013-03-03 02:53:28 UTC (rev 144550)
+++ branches/safari-534.59-branch/Tools/MiniBrowser/mac/BrowserWindowController.m	2013-03-03 04:05:00 UTC (rev 144551)
@@ -657,6 +657,7 @@
         0, // saveDataToFileInDownloadsFolder
         0, // shouldInterruptJavaScript
         0, // unavailablePluginButtonClicked
+        0, // shouldInstantiatePlugin
     };
     WKPageSetPageUIClient(_webView.pageRef, &uiClient);
 }

Modified: branches/safari-534.59-branch/Tools/WebKitTestRunner/TestController.cpp (144550 => 144551)


--- branches/safari-534.59-branch/Tools/WebKitTestRunner/TestController.cpp	2013-03-03 02:53:28 UTC (rev 144550)
+++ branches/safari-534.59-branch/Tools/WebKitTestRunner/TestController.cpp	2013-03-03 04:05:00 UTC (rev 144551)
@@ -180,6 +180,7 @@
         0, // saveDataToFileInDownloadsFolder
         0, // shouldInterruptJavaScript
         0, // unavailablePluginButtonClicked
+        0, // shouldInstantiatePlugin
     };
     WKPageSetPageUIClient(newPage, &otherPageUIClient);
 
@@ -324,6 +325,7 @@
         0, // saveDataToFileInDownloadsFolder
         0, // shouldInterruptJavaScript
         0, // unavailablePluginButtonClicked
+        0, // shouldInstantiatePlugin
     };
     WKPageSetPageUIClient(m_mainWebView->page(), &pageUIClient);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to