navigator.plugins has plugins in it when plugins are disabled
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Aug 2013 06:44:27 +0000 (06:44 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Aug 2013 06:44:27 +0000 (06:44 +0000)
commit0779dd438ebcf52b0dad65759dae8fe7c6b8a6cf
tree7dc41813edae73c1212580842bb37dbd218b5e5d
parent8a2247215b82c4e1693f3efe1bb7a2e31ce7c03b
navigator.plugins has plugins in it when plugins are disabled
https://bugs.webkit.org/show_bug.cgi?id=119607
<rdar://problem/14678030>

Reviewed by Anders Carlsson.

Test: plugins/navigator-plugins-disabled.html

* page/Settings.cpp:
(WebCore::Settings::setPluginsEnabled):
Refresh the plugin database when plugins are enabled or disabled.
This is necessary to ensure that navigator.plugins will have the
correct set of plugins after dynamically changing whether plugins
are enabled, which makes the test for this patch possible (but it
makes sense in the browser as well).

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getPlugins):
Return a list of all plugins, and a list of only application plugins.

* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::getPluginInfo):
Add applicationPlugin parameter to getPlugins, and storage for the returned list.

(WebKit::WebPlatformStrategies::populatePluginCache):
If plugins are disabled for the given page, give WebCore the list that
only includes application plugins. Otherwise, give it the whole list
as we are doing currently.

* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::getPluginInfo):
If plugins are disabled for the given page, give WebCore an empty list of
plugins. If WebKit1 had any application plugins, we'd return just them
instead.

Add a test that ensures that navigator.plugins only contains
application plugins when plugins are disabled.

* plugins/navigator-plugins-disabled-expected.txt: Added.
* plugins/navigator-plugins-disabled.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/plugins/navigator-plugins-disabled-expected.txt [new file with mode: 0644]
LayoutTests/plugins/navigator-plugins-disabled.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/Settings.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebProcessProxy.cpp
Source/WebKit2/UIProcess/WebProcessProxy.h
Source/WebKit2/UIProcess/WebProcessProxy.messages.in
Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h