Changeset 141486 in webkit
- Timestamp:
- Jan 31, 2013 2:17:52 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r141484 r141486 1 2013-01-30 Brian Weinstein <bweinstein@apple.com> 2 3 Add a call to the page UI client to determine if a plug-in should load 4 https://bugs.webkit.org/show_bug.cgi?id=108407 5 <rdar://problem/13066332> 6 7 Reviewed by Anders Carlsson. 8 9 This patch adds a client call to the WKPageUIClient to be called to determine 10 whether or not a plug-in should load. 11 12 * UIProcess/API/C/WKPage.h: Add shouldLoadPlugin. 13 * UIProcess/WebPageProxy.cpp: 14 (WebKit::WebPageProxy::getPluginPath): Moved from WebProcessProxy, and added a call to 15 m_uiClient.shouldInstantiatePlugin. 16 * UIProcess/WebPageProxy.h: 17 * UIProcss/WebPageProxy.messages.in: Moved GetPluginPath from WebProcessProxy to WebPageProxy. 18 * UIProcess/WebProcessProxy.cpp: 19 (WebKit::WebProcessProxy::getPluginPath): Moved to WebPageProxy. 20 * UIProcess/WebProcessProxy.h: 21 * UIProcess/WebUIClient.cpp: 22 (WebKit::WebUIClient::shouldInstantiatePlugin): Return that we should load the plug-in if 23 the client function isn't defined, and call the function if it is. 24 * UIProcess/WebUIClient.h: 25 * UIProcess/mac/WebInspectorProxyMac.mm: 26 (WebKit::WebInspectorProxy::platformCreateInspectorPage): Add an entry for the new 27 client function. 28 * WebProcess/WebPage/WebPage.cpp: 29 (WebKit::WebPage::createPlugin): Send the message to the WebPageProxy, not the WebProcessProxy. 30 (WebKit::WebPage::canPluginHandleResponse): Made a member function, so it can call sendSync, and 31 send the message to the WebPageProxy, not the WebProcessProxy. 32 * WebProcess/WebPage/WebPage.h: 33 1 34 2013-01-31 Anders Carlsson <andersca@apple.com> 2 35 -
trunk/Source/WebKit2/UIProcess/API/C/WKPage.h
r141448 r141486 209 209 typedef void (*WKPageShowColorPickerCallback)(WKPageRef page, WKStringRef initialColor, WKColorPickerResultListenerRef listener, const void* clientInfo); 210 210 typedef void (*WKPageHideColorPickerCallback)(WKPageRef page, const void* clientInfo); 211 typedef bool (*WKPageShouldInstantiatePluginCallback)(WKPageRef page, WKStringRef identifier, WKStringRef displayName, const void* clientInfo); 211 212 212 213 // Deprecated … … 269 270 WKPageShowColorPickerCallback showColorPicker; 270 271 WKPageHideColorPickerCallback hideColorPicker; 272 WKPageShouldInstantiatePluginCallback shouldInstantiatePlugin; 271 273 }; 272 274 typedef struct WKPageUIClient WKPageUIClient; -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r141472 r141486 1221 1221 } 1222 1222 1223 #if ENABLE(NETSCAPE_PLUGIN_API) 1224 void WebPageProxy::getPluginPath(const String& mimeType, const String& urlString, String& pluginPath, uint32_t& pluginLoadPolicy) 1225 { 1226 MESSAGE_CHECK_URL(urlString); 1227 1228 String newMimeType = mimeType.lower(); 1229 1230 pluginLoadPolicy = PluginModuleLoadNormally; 1231 PluginModuleInfo plugin = m_process->context()->pluginInfoStore().findPlugin(newMimeType, KURL(KURL(), urlString)); 1232 if (!plugin.path) 1233 return; 1234 1235 pluginLoadPolicy = PluginInfoStore::policyForPlugin(plugin); 1236 if (pluginLoadPolicy != PluginModuleLoadNormally) 1237 return; 1238 1239 pluginLoadPolicy = m_uiClient.shouldInstantiatePlugin(this, plugin.bundleIdentifier, plugin.info.name) ? PluginModuleLoadNormally : PluginModuleBlocked; 1240 if (pluginLoadPolicy != PluginModuleLoadNormally) 1241 return; 1242 1243 pluginPath = plugin.path; 1244 } 1245 #endif // ENABLE(NETSCAPE_PLUGIN_API) 1246 1223 1247 #if ENABLE(GESTURE_EVENTS) 1224 1248 void WebPageProxy::handleGestureEvent(const WebGestureEvent& event) -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r141472 r141486 1014 1014 void sendWheelEvent(const WebWheelEvent&); 1015 1015 1016 #if ENABLE(NETSCAPE_PLUGIN_API) 1017 void getPluginPath(const String& mimeType, const String& urlString, String& pluginPath, uint32_t& pluginLoadPolicy); 1018 #endif 1019 1016 1020 PageClient* m_pageClient; 1017 1021 WebLoaderClient m_loaderClient; -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r141448 r141486 314 314 OpenPDFFromTemporaryFolderWithNativeApplication(WTF::String pdfUUID) 315 315 #endif 316 317 #if ENABLE(NETSCAPE_PLUGIN_API) 318 GetPluginPath(WTF::String mimeType, WTF::String urlString) -> (WTF::String pluginPath, uint32_t pluginLoadPolicy) 319 #endif 320 316 321 } -
trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp
r141448 r141486 352 352 } 353 353 354 void WebProcessProxy::getPluginPath(const String& mimeType, const String& urlString, String& pluginPath, uint32_t& pluginLoadPolicy)355 {356 MESSAGE_CHECK_URL(urlString);357 358 String newMimeType = mimeType.lower();359 360 pluginLoadPolicy = PluginModuleLoadNormally;361 PluginModuleInfo plugin = m_context->pluginInfoStore().findPlugin(newMimeType, KURL(KURL(), urlString));362 if (!plugin.path)363 return;364 365 pluginLoadPolicy = PluginInfoStore::policyForPlugin(plugin);366 if (pluginLoadPolicy != PluginModuleLoadNormally)367 return;368 369 pluginPath = plugin.path;370 }371 354 #endif // ENABLE(NETSCAPE_PLUGIN_API) 372 355 -
trunk/Source/WebKit2/UIProcess/WebProcessProxy.h
r141448 r141486 138 138 #if ENABLE(NETSCAPE_PLUGIN_API) 139 139 void getPlugins(CoreIPC::Connection*, uint64_t requestID, bool refresh); 140 void getPluginPath(const String& mimeType, const String& urlString, String& pluginPath, uint32_t& pluginLoadPolicy);141 140 void handleGetPlugins(uint64_t requestID, bool refresh); 142 141 void sendDidGetPlugins(uint64_t requestID, PassOwnPtr<Vector<WebCore::PluginInfo> >); -
trunk/Source/WebKit2/UIProcess/WebProcessProxy.messages.in
r140605 r141486 37 37 #if ENABLE(NETSCAPE_PLUGIN_API) 38 38 GetPlugins(uint64_t requestID, bool refresh) DispatchOnConnectionQueue 39 GetPluginPath(WTF::String mimeType, WTF::String urlString) -> (WTF::String pluginPath, uint32_t pluginLoadPolicy)40 39 #endif // ENABLE(NETSCAPE_PLUGIN_API) 41 40 #if ENABLE(PLUGIN_PROCESS) -
trunk/Source/WebKit2/UIProcess/WebUIClient.cpp
r128553 r141486 439 439 #endif 440 440 441 bool WebUIClient::shouldInstantiatePlugin(WebPageProxy* page, const String& identifier, const String& displayName) 442 { 443 if (!m_client.shouldInstantiatePlugin) 444 return true; 445 446 return m_client.shouldInstantiatePlugin(toAPI(page), toAPI(identifier.impl()), toAPI(displayName.impl()), m_client.clientInfo); 447 } 448 441 449 } // namespace WebKit -
trunk/Source/WebKit2/UIProcess/WebUIClient.h
r128553 r141486 122 122 bool hideColorPicker(WebPageProxy*); 123 123 #endif 124 125 bool shouldInstantiatePlugin(WebPageProxy*, const String& identifier, const String& displayName); 124 126 }; 125 127 -
trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm
r134513 r141486 353 353 0, // showColorPicker 354 354 0, // hideColorPicker 355 0, // shouldInstantiatePlugin 355 356 }; 356 357 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r141472 r141486 502 502 String pluginPath; 503 503 uint32_t pluginLoadPolicy; 504 if (! WebProcess::shared().connection()->sendSync(505 Messages::WebP rocessProxy::GetPluginPath(parameters.mimeType, parameters.url.string()),506 Messages::WebP rocessProxy::GetPluginPath::Reply(pluginPath, pluginLoadPolicy), 0)) {504 if (!sendSync( 505 Messages::WebPageProxy::GetPluginPath(parameters.mimeType, parameters.url.string()), 506 Messages::WebPageProxy::GetPluginPath::Reply(pluginPath, pluginLoadPolicy))) { 507 507 return 0; 508 508 } … … 3667 3667 } 3668 3668 3669 static boolcanPluginHandleResponse(const ResourceResponse& response)3669 bool WebPage::canPluginHandleResponse(const ResourceResponse& response) 3670 3670 { 3671 3671 #if ENABLE(NETSCAPE_PLUGIN_API) … … 3673 3673 uint32_t pluginLoadPolicy; 3674 3674 3675 if (! WebProcess::shared().connection()->sendSync(Messages::WebProcessProxy::GetPluginPath(response.mimeType(), response.url().string()), Messages::WebProcessProxy::GetPluginPath::Reply(pluginPath, pluginLoadPolicy), 0))3675 if (!sendSync(Messages::WebPageProxy::GetPluginPath(response.mimeType(), response.url().string()), Messages::WebPageProxy::GetPluginPath::Reply(pluginPath, pluginLoadPolicy))) 3676 3676 return false; 3677 3677 … … 3682 3682 } 3683 3683 3684 bool WebPage::shouldUseCustomRepresentationForResponse(const ResourceResponse& response) const3684 bool WebPage::shouldUseCustomRepresentationForResponse(const ResourceResponse& response) 3685 3685 { 3686 3686 if (!m_mimeTypesWithCustomRepresentations.contains(response.mimeType())) -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r141472 r141486 572 572 #endif 573 573 574 bool shouldUseCustomRepresentationForResponse(const WebCore::ResourceResponse&) const; 574 bool shouldUseCustomRepresentationForResponse(const WebCore::ResourceResponse&); 575 bool canPluginHandleResponse(const WebCore::ResourceResponse& response); 575 576 576 577 bool asynchronousPluginInitializationEnabled() const { return m_asynchronousPluginInitializationEnabled; } -
trunk/Tools/ChangeLog
r141478 r141486 1 2013-01-30 Brian Weinstein <bweinstein@apple.com> 2 3 Add a call to the page UI client to determine if a plug-in should load 4 https://bugs.webkit.org/show_bug.cgi?id=108407 5 <rdar://problem/13066332> 6 7 Add entries for the new function in the necessary structs. 8 9 Reviewed by Anders Carlsson. 10 11 * MiniBrowser/mac/WK2BrowserWindowController.m: 12 (-[WK2BrowserWindowController awakeFromNib]): 13 * WebKitTestRunner/TestController.cpp: 14 (WTR::TestController::createOtherPage): 15 (WTR::TestController::createWebViewWithOptions): 16 1 17 2013-01-31 Florin Malita <fmalita@chromium.org> 2 18 -
trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m
r133179 r141486 704 704 0, // showColorPicker 705 705 0, // hideColorPicker 706 0, // shouldInstantiatePlugin 706 707 }; 707 708 WKPageSetPageUIClient(_webView.pageRef, &uiClient); -
trunk/Tools/WebKitTestRunner/TestController.cpp
r141010 r141486 236 236 0, // showColorPicker 237 237 0, // hideColorPicker 238 0, // shouldInstantiatePlugin 238 239 }; 239 240 WKPageSetPageUIClient(newPage, &otherPageUIClient); … … 426 427 0, // showColorPicker 427 428 0, // hideColorPicker 429 0, // shouldInstantiatePlugin 428 430 }; 429 431 WKPageSetPageUIClient(m_mainWebView->page(), &pageUIClient);
Note: See TracChangeset
for help on using the changeset viewer.