Don't instantiate the Java plug-in if it's inactive
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Nov 2012 23:39:33 +0000 (23:39 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Nov 2012 23:39:33 +0000 (23:39 +0000)
commitc1e5f96ad722acfd17c36b40f7a454a6c40e1050
tree4e9b3cd4ee291c9c4f6ef57c93003ec3d457937e
parent3eeb0eaca107e6269bda8ecbdf8032cf33066d05
Don't instantiate the Java plug-in if it's inactive
https://bugs.webkit.org/show_bug.cgi?id=101102
<rdar://problem/12595679>

Reviewed by Andreas Kling.

Source/WebKit/mac:

* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::shouldUnavailablePluginMessageBeButton):
The RenderEmbeddedObject::PluginInactive reason should always result in a button being shown.

(WebChromeClient::unavailablePluginButtonClicked):
If the Java plug-in is inactive, call WKJLReportWebComponentsUsed() to reactivate the plug-in and
then reload the page.

* WebCoreSupport/WebFrameLoaderClient.mm:
(isOracleJavaPlugIn):
(isPlugInInactive):
Helper functions.

(WebFrameLoaderClient::createPlugin):
If the plug-in is inactive, set the appropriate unavailability reason on the renderer.

Source/WebKit2:

* Shared/Plugins/PluginModuleInfo.h:
Add a PluginModuleLoadPolicy enum.

* UIProcess/Plugins/PluginInfoStore.cpp:
(WebKit::PluginInfoStore::policyForPlugin):
* UIProcess/Plugins/PluginInfoStore.h:
(PluginInfoStore):
Rename shouldBlockPlugin to policyForPlugin and make it return an enum so we can handle inactive plug-ins.

* UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
(WebKit::shouldBlockPlugin):
Add helper function.

(WebKit::PluginInfoStore::policyForPlugin):
If the Java plug-in is inactive, return PluginModuleInactive.

(WebKit::PluginInfoStore::reactivateInactivePlugin):
If the given plug-in is the Java plug-in, call WKJLReportWebComponentsUsed() to reactivate it.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::unavailablePluginButtonClicked):
If the plug-in is inactive, try to reactivate it and reload the page if reactivation succeeded.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getPluginPath):
* UIProcess/WebProcessProxy.h:
This now returns a plug-in load policy.

* UIProcess/WebProcessProxy.messages.in:
GetPluginPack now returns a load policy enum.

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::shouldUnavailablePluginMessageBeButton):
Change this to a switch statement and always return true for RenderEmbeddedObject::PluginInactive.

(WebKit::WebChromeClient::unavailablePluginButtonClicked):
Add RenderEmbeddedObject::PluginInactive to the assertion.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::createPlugin):
Update now that GetPluginPath returns a pluginLoadPolicy enum.

(WebKit::canPluginHandleResponse):
Ditto.

WebKitLibraries:

Update WebKitSystemInterface to a version that has WKJLReportWebComponentsUsed.

* WebKitSystemInterface.h:
* libWebKitSystemInterfaceLion.a:
* libWebKitSystemInterfaceMountainLion.a:
Roll WebKitSystemInterface DERPS.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@133371 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/Plugins/PluginModuleInfo.h
Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp
Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h
Source/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebProcessProxy.cpp
Source/WebKit2/UIProcess/WebProcessProxy.h
Source/WebKit2/UIProcess/WebProcessProxy.messages.in
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
WebKitLibraries/ChangeLog
WebKitLibraries/WebKitSystemInterface.h
WebKitLibraries/libWebKitSystemInterfaceLion.a
WebKitLibraries/libWebKitSystemInterfaceMountainLion.a