Break pluginReplacementEnabled into youTubeFlashPluginReplacementEnabled and quickTim...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Aug 2016 23:59:00 +0000 (23:59 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Aug 2016 23:59:00 +0000 (23:59 +0000)
commit9abd0de64cebb051abe10a25e081b20d52e2564c
tree0260e8e8c880911d491749ec74445931cd398ba2
parentc5885199d13669e811f11844ef12dba228565806
Break pluginReplacementEnabled into youTubeFlashPluginReplacementEnabled and quickTimePluginReplacementEnabled
https://bugs.webkit.org/show_bug.cgi?id=161424
<rdar://problem/28050847>

Patch by Ricky Mondello <rmondello@apple.com> on 2016-08-31
Reviewed by Dean Jackson.

Source/WebCore:

Replace the single pluginReplacementEnabled setting with individual settings for the YouTube Flash plug-in
behavior and the QuickTime plug-in behavior. Unless otherwise noted, this change copies the existing plumbing
for pluginReplacementEnabled and renames it twice. The default values for these settings remain the same.

* Modules/plugins/PluginReplacement.h:
(WebCore::ReplacementPlugin::ReplacementPlugin): Augment the constructor.
(WebCore::ReplacementPlugin::isEnabledBySettings): Added.
* Modules/plugins/QuickTimePluginReplacement.h: Declare a static member function.
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::registerPluginReplacement): Properly create a ReplacementPlugin instance.
(WebCore::QuickTimePluginReplacement::isEnabledBySettings): Added.
* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::YouTubePluginReplacement::registerPluginReplacement): Properly create a ReplacementPlugin instance.
(WebCore::YouTubePluginReplacement::isEnabledBySettings): Added.
* Modules/plugins/YouTubePluginReplacement.h: Declare a static member function.
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::requestObject): Ask the ReplacementPlugin whether it's enabled, rather than assume
    all plug-in replacement is guarded by a single run-time setting.
* page/Settings.cpp: Declare values for defaults for both settings.
* page/Settings.in: Declare two settings.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup): Handle both settings.
(WebCore::InternalSettings::Backup::restoreTo): Ditto.
(WebCore::InternalSettings::setQuickTimePluginReplacementEnabled): Added.
(WebCore::InternalSettings::setYouTubeFlashPluginReplacementEnabled): Added.
(WebCore::InternalSettings::setPluginReplacementEnabled): Deleted.
* testing/InternalSettings.h: Duplicate and rename.
* testing/InternalSettings.idl: Ditto.

LayoutTests:

* plugins/quicktime-plugin-replacement.html: Updated for the internal setting rename.
* security/contentSecurityPolicy/object-src-none-blocks-quicktime-plugin-replacement.html: Ditto.
* security/contentSecurityPolicy/object-src-none-blocks-youtube-plugin-replacement.html: Ditto.
* security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement.html: Ditto.
* security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement.html: Ditto.
* security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-without-mime-type.html: Ditto.
* security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement.html: Ditto.
* security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-without-mime-type.html: Ditto.
* security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement.html: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@205271 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
LayoutTests/ChangeLog
LayoutTests/plugins/quicktime-plugin-replacement.html
LayoutTests/security/contentSecurityPolicy/object-src-none-blocks-quicktime-plugin-replacement.html
LayoutTests/security/contentSecurityPolicy/object-src-none-blocks-youtube-plugin-replacement.html
LayoutTests/security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement.html
LayoutTests/security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement.html
LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-without-mime-type.html
LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement.html
LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-without-mime-type.html
LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement.html
Source/WebCore/ChangeLog
Source/WebCore/Modules/plugins/PluginReplacement.h
Source/WebCore/Modules/plugins/QuickTimePluginReplacement.h
Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm
Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp
Source/WebCore/Modules/plugins/YouTubePluginReplacement.h
Source/WebCore/html/HTMLPlugInElement.cpp
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.in
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/InternalSettings.h
Source/WebCore/testing/InternalSettings.idl