[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
aroben at apple.com
aroben at apple.com
Wed Dec 22 15:31:31 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit a85fc3e60a538dc6f7383b208041c709fb4bbba4
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Nov 5 18:15:26 2010 +0000
Implement PluginInfoStore::shouldUsePlugin on Windows
Fixes <http://webkit.org/b/43509> <rdar://problem/8273822> WebKit2
should refuse to load the same plugins that old-WebKit refuses to load
Reviewed by Anders Carlsson.
* UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
(WebKit::fileVersion): Helper function to construct a 64-bit file
version from two 32-bit numbers.
(WebKit::PluginInfoStore::getPluginInfo): Ported code from
WebCore::PluginPackage::fetchInfo to get the plugin's version. We now
store it in Plugin::fileVersion.
(WebKit::isOldWindowsMediaPlayerPlugin):
(WebKit::isNewWindowsMediaPlayerPlugin):
Added these helpers. The code came from
WebCore::PluginDatabase::getPluginPathsInDirectories.
(WebKit::PluginInfoStore::shouldUsePlugin): Implemented. The code was
ported from WebCore::PluginDatabase::getPluginPathsInDirectories and
WebCore::PluginPackage::isPluginBlacklisted.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71436 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 6665c50..d5d0474 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,5 +1,30 @@
2010-11-05 Adam Roben <aroben at apple.com>
+ Implement PluginInfoStore::shouldUsePlugin on Windows
+
+ Fixes <http://webkit.org/b/43509> <rdar://problem/8273822> WebKit2
+ should refuse to load the same plugins that old-WebKit refuses to load
+
+ Reviewed by Anders Carlsson.
+
+ * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
+ (WebKit::fileVersion): Helper function to construct a 64-bit file
+ version from two 32-bit numbers.
+ (WebKit::PluginInfoStore::getPluginInfo): Ported code from
+ WebCore::PluginPackage::fetchInfo to get the plugin's version. We now
+ store it in Plugin::fileVersion.
+
+ (WebKit::isOldWindowsMediaPlayerPlugin):
+ (WebKit::isNewWindowsMediaPlayerPlugin):
+ Added these helpers. The code came from
+ WebCore::PluginDatabase::getPluginPathsInDirectories.
+
+ (WebKit::PluginInfoStore::shouldUsePlugin): Implemented. The code was
+ ported from WebCore::PluginDatabase::getPluginPathsInDirectories and
+ WebCore::PluginPackage::isPluginBlacklisted.
+
+2010-11-05 Adam Roben <aroben at apple.com>
+
Operate on m_plugins directly in PluginInfoStore::shouldUsePlugin
We'll need to operate on m_plugins if we ever want to unload an
diff --git a/WebKit2/UIProcess/Plugins/win/PluginInfoStoreWin.cpp b/WebKit2/UIProcess/Plugins/win/PluginInfoStoreWin.cpp
index 8eb860e..fe7d896 100644
--- a/WebKit2/UIProcess/Plugins/win/PluginInfoStoreWin.cpp
+++ b/WebKit2/UIProcess/Plugins/win/PluginInfoStoreWin.cpp
@@ -352,6 +352,14 @@ static String getVersionInfo(const LPVOID versionInfoData, const String& info)
return String(reinterpret_cast<UChar*>(buffer), bufferLength - 1);
}
+static uint64_t fileVersion(DWORD leastSignificant, DWORD mostSignificant)
+{
+ ULARGE_INTEGER version;
+ version.LowPart = leastSignificant;
+ version.HighPart = mostSignificant;
+ return version.QuadPart;
+}
+
bool PluginInfoStore::getPluginInfo(const String& pluginPath, Plugin& plugin)
{
String pathCopy = pluginPath;
@@ -368,6 +376,11 @@ bool PluginInfoStore::getPluginInfo(const String& pluginPath, Plugin& plugin)
if (name.isNull() || description.isNull())
return false;
+ VS_FIXEDFILEINFO* info;
+ UINT infoSize;
+ if (!::VerQueryValueW(versionInfoData.get(), L"\\", reinterpret_cast<void**>(&info), &infoSize) || infoSize < sizeof(VS_FIXEDFILEINFO))
+ return false;
+
Vector<String> types;
getVersionInfo(versionInfoData.get(), "MIMEType").split('|', types);
Vector<String> extensionLists;
@@ -403,14 +416,72 @@ bool PluginInfoStore::getPluginInfo(const String& pluginPath, Plugin& plugin)
plugin.info.name = name;
plugin.info.file = pathGetFileName(pluginPath);
plugin.info.mimes.swap(mimes);
+ plugin.fileVersion = fileVersion(info->dwFileVersionLS, info->dwFileVersionMS);
+
return true;
}
+static bool isOldWindowsMediaPlayerPlugin(const PluginInfoStore::Plugin& plugin)
+{
+ return equalIgnoringCase(plugin.info.file, "npdsplay.dll");
+}
+
+static bool isNewWindowsMediaPlayerPlugin(const PluginInfoStore::Plugin& plugin)
+{
+ return equalIgnoringCase(plugin.info.file, "np-mswmp.dll");
+}
+
bool PluginInfoStore::shouldUsePlugin(const Plugin& plugin)
{
- // FIXME: <http://webkit.org/b/43509> Migrate logic here from
- // PluginDatabase::getPluginPathsInDirectories and PluginPackage::isPluginBlacklisted.
- notImplemented();
+ // FIXME: We should prefer a newer version of a plugin to an older version, rather than loading
+ // both. <http://webkit.org/b/49075>
+
+ if (plugin.info.name == "Citrix ICA Client") {
+ // The Citrix ICA Client plug-in requires a Mozilla-based browser; see <rdar://6418681>.
+ return false;
+ }
+
+ if (plugin.info.name == "Silverlight Plug-In") {
+ // workaround for <rdar://5557379> Crash in Silverlight when opening microsoft.com.
+ // the latest 1.0 version of Silverlight does not reproduce this crash, so allow it
+ // and any newer versions
+ static const uint64_t minimumRequiredVersion = fileVersion(0x51BE0000, 0x00010000);
+ return plugin.fileVersion >= minimumRequiredVersion;
+ }
+
+ if (equalIgnoringCase(plugin.info.file, "npmozax.dll")) {
+ // Bug 15217: Mozilla ActiveX control complains about missing xpcom_core.dll
+ return false;
+ }
+
+ if (plugin.info.name == "Yahoo Application State Plugin") {
+ // https://bugs.webkit.org/show_bug.cgi?id=26860
+ // Bug in Yahoo Application State plug-in earlier than 1.0.0.6 leads to heap corruption.
+ static const uint64_t minimumRequiredVersion = fileVersion(0x00000006, 0x00010000);
+ return plugin.fileVersion >= minimumRequiredVersion;
+ }
+
+ if (isOldWindowsMediaPlayerPlugin(plugin)) {
+ // Don't load the old Windows Media Player plugin if we've already loaded the new Windows
+ // Media Player plugin.
+ for (size_t i = 0; i < m_plugins.size(); ++i) {
+ if (!isNewWindowsMediaPlayerPlugin(m_plugins[i]))
+ continue;
+ return false;
+ }
+ return true;
+ }
+
+ if (isNewWindowsMediaPlayerPlugin(plugin)) {
+ // Unload the old Windows Media Player plugin if we've already loaded it.
+ for (size_t i = 0; i < m_plugins.size(); ++i) {
+ if (!isOldWindowsMediaPlayerPlugin(m_plugins[i]))
+ continue;
+ m_plugins.remove(i);
+ }
+ return true;
+ }
+
return true;
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list