[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
andersca at apple.com
andersca at apple.com
Wed Dec 22 18:38:14 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 9d0be6bbfea6059923834be898186359a36c2cbe
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Dec 15 00:34:05 2010 +0000
2010-12-14 Anders Carlsson <andersca at apple.com>
Reviewed by Dan Bernstein.
Move Windows version of getPluginInfo to NetscapePluginModule
https://bugs.webkit.org/show_bug.cgi?id=51073
* Shared/Plugins/Netscape/win/NetscapePluginModuleWin.cpp: Added.
(WebKit::getVersionInfo):
(WebKit::fileVersion):
(WebKit::NetscapePluginModule::getPluginInfo):
* UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
(WebKit::PluginInfoStore::getPluginInfo):
* win/WebKit2.vcproj:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74073 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 47cccb1..14f8cb5 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,18 @@
+2010-12-14 Anders Carlsson <andersca at apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Move Windows version of getPluginInfo to NetscapePluginModule
+ https://bugs.webkit.org/show_bug.cgi?id=51073
+
+ * Shared/Plugins/Netscape/win/NetscapePluginModuleWin.cpp: Added.
+ (WebKit::getVersionInfo):
+ (WebKit::fileVersion):
+ (WebKit::NetscapePluginModule::getPluginInfo):
+ * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
+ (WebKit::PluginInfoStore::getPluginInfo):
+ * win/WebKit2.vcproj:
+
2010-12-14 Alice Liu <alice.liu at apple.com>
Fix clang++ build.
diff --git a/WebKit2/Shared/Plugins/Netscape/win/NetscapePluginModuleWin.cpp b/WebKit2/Shared/Plugins/Netscape/win/NetscapePluginModuleWin.cpp
new file mode 100644
index 0000000..6684ecf
--- /dev/null
+++ b/WebKit2/Shared/Plugins/Netscape/win/NetscapePluginModuleWin.cpp
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "NetscapePluginModule.h"
+
+#include <WebCore/FileSystem.h>
+#include <wtf/OwnArrayPtr.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+static String getVersionInfo(const LPVOID versionInfoData, const String& info)
+{
+ LPVOID buffer;
+ UINT bufferLength;
+ String subInfo = "\\StringfileInfo\\040904E4\\" + info;
+ if (!::VerQueryValueW(versionInfoData, const_cast<UChar*>(subInfo.charactersWithNullTermination()), &buffer, &bufferLength) || !bufferLength)
+ return String();
+
+ // Subtract 1 from the length; we don't want the trailing null character.
+ 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 NetscapePluginModule::getPluginInfo(const String& pluginPath, PluginInfoStore::Plugin& plugin)
+{
+ String pathCopy = pluginPath;
+ DWORD versionInfoSize = ::GetFileVersionInfoSizeW(pathCopy.charactersWithNullTermination(), 0);
+ if (!versionInfoSize)
+ return false;
+
+ OwnArrayPtr<char> versionInfoData(new char[versionInfoSize]);
+ if (!::GetFileVersionInfoW(pathCopy.charactersWithNullTermination(), 0, versionInfoSize, versionInfoData.get()))
+ return false;
+
+ String name = getVersionInfo(versionInfoData.get(), "ProductName");
+ String description = getVersionInfo(versionInfoData.get(), "FileDescription");
+ 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;
+ getVersionInfo(versionInfoData.get(), "FileExtents").split('|', extensionLists);
+ Vector<String> descriptions;
+ getVersionInfo(versionInfoData.get(), "FileOpenName").split('|', descriptions);
+
+ Vector<MimeClassInfo> mimes(types.size());
+ for (size_t i = 0; i < types.size(); i++) {
+ String type = types[i].lower();
+ String description = i < descriptions.size() ? descriptions[i] : "";
+ String extensionList = i < extensionLists.size() ? extensionLists[i] : "";
+
+ Vector<String> extensionsVector;
+ extensionList.split(',', extensionsVector);
+
+ // Get rid of the extension list that may be at the end of the description string.
+ int pos = description.find("(*");
+ if (pos != -1) {
+ // There might be a space that we need to get rid of.
+ if (pos > 1 && description[pos - 1] == ' ')
+ pos--;
+ description = description.left(pos);
+ }
+
+ mimes[i].type = type;
+ mimes[i].desc = description;
+ mimes[i].extensions.swap(extensionsVector);
+ }
+
+ plugin.path = pluginPath;
+ plugin.info.desc = description;
+ plugin.info.name = name;
+ plugin.info.file = pathGetFileName(pluginPath);
+ plugin.info.mimes.swap(mimes);
+ plugin.fileVersion = fileVersion(info->dwFileVersionLS, info->dwFileVersionMS);
+
+ return true;
+}
+
+} // namespace WebKit
+
diff --git a/WebKit2/UIProcess/Plugins/win/PluginInfoStoreWin.cpp b/WebKit2/UIProcess/Plugins/win/PluginInfoStoreWin.cpp
index fe7d896..485f892 100644
--- a/WebKit2/UIProcess/Plugins/win/PluginInfoStoreWin.cpp
+++ b/WebKit2/UIProcess/Plugins/win/PluginInfoStoreWin.cpp
@@ -25,11 +25,8 @@
#include "PluginInfoStore.h"
-#define DISABLE_NOT_IMPLEMENTED_WARNINGS 1
-#include "NotImplemented.h"
-#include <WebCore/FileSystem.h>
+#include "NetscapePluginModule.h"
#include <shlwapi.h>
-#include <wtf/OwnArrayPtr.h>
using namespace WebCore;
@@ -340,18 +337,6 @@ Vector<String> PluginInfoStore::individualPluginPaths()
return paths;
}
-static String getVersionInfo(const LPVOID versionInfoData, const String& info)
-{
- LPVOID buffer;
- UINT bufferLength;
- String subInfo = "\\StringfileInfo\\040904E4\\" + info;
- if (!::VerQueryValueW(versionInfoData, const_cast<UChar*>(subInfo.charactersWithNullTermination()), &buffer, &bufferLength) || !bufferLength)
- return String();
-
- // Subtract 1 from the length; we don't want the trailing null character.
- return String(reinterpret_cast<UChar*>(buffer), bufferLength - 1);
-}
-
static uint64_t fileVersion(DWORD leastSignificant, DWORD mostSignificant)
{
ULARGE_INTEGER version;
@@ -362,63 +347,7 @@ static uint64_t fileVersion(DWORD leastSignificant, DWORD mostSignificant)
bool PluginInfoStore::getPluginInfo(const String& pluginPath, Plugin& plugin)
{
- String pathCopy = pluginPath;
- DWORD versionInfoSize = ::GetFileVersionInfoSizeW(pathCopy.charactersWithNullTermination(), 0);
- if (!versionInfoSize)
- return false;
-
- OwnArrayPtr<char> versionInfoData(new char[versionInfoSize]);
- if (!::GetFileVersionInfoW(pathCopy.charactersWithNullTermination(), 0, versionInfoSize, versionInfoData.get()))
- return false;
-
- String name = getVersionInfo(versionInfoData.get(), "ProductName");
- String description = getVersionInfo(versionInfoData.get(), "FileDescription");
- 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;
- getVersionInfo(versionInfoData.get(), "FileExtents").split('|', extensionLists);
- Vector<String> descriptions;
- getVersionInfo(versionInfoData.get(), "FileOpenName").split('|', descriptions);
-
- Vector<MimeClassInfo> mimes(types.size());
- for (size_t i = 0; i < types.size(); i++) {
- String type = types[i].lower();
- String description = i < descriptions.size() ? descriptions[i] : "";
- String extensionList = i < extensionLists.size() ? extensionLists[i] : "";
-
- Vector<String> extensionsVector;
- extensionList.split(',', extensionsVector);
-
- // Get rid of the extension list that may be at the end of the description string.
- int pos = description.find("(*");
- if (pos != -1) {
- // There might be a space that we need to get rid of.
- if (pos > 1 && description[pos - 1] == ' ')
- pos--;
- description = description.left(pos);
- }
-
- mimes[i].type = type;
- mimes[i].desc = description;
- mimes[i].extensions.swap(extensionsVector);
- }
-
- plugin.path = pluginPath;
- plugin.info.desc = description;
- plugin.info.name = name;
- plugin.info.file = pathGetFileName(pluginPath);
- plugin.info.mimes.swap(mimes);
- plugin.fileVersion = fileVersion(info->dwFileVersionLS, info->dwFileVersionMS);
-
- return true;
+ return NetscapePluginModule::getPluginInfo(pluginPath, plugin);
}
static bool isOldWindowsMediaPlayerPlugin(const PluginInfoStore::Plugin& plugin)
diff --git a/WebKit2/win/WebKit2.vcproj b/WebKit2/win/WebKit2.vcproj
index a007ac1..14db338 100755
--- a/WebKit2/win/WebKit2.vcproj
+++ b/WebKit2/win/WebKit2.vcproj
@@ -842,22 +842,6 @@
>
</File>
<Filter
- Name="Plugins"
- >
- <Filter
- Name="Netscape"
- >
- <File
- RelativePath="..\Shared\Plugins\Netscape\NetscapePluginModule.cpp"
- >
- </File>
- <File
- RelativePath="..\Shared\Plugins\Netscape\NetscapePluginModule.h"
- >
- </File>
- </Filter>
- </Filter>
- <Filter
Name="cf"
>
<File
@@ -1098,6 +1082,30 @@
</FileConfiguration>
</File>
</Filter>
+ <Filter
+ Name="Plugins"
+ >
+ <Filter
+ Name="Netscape"
+ >
+ <File
+ RelativePath="..\Shared\Plugins\Netscape\NetscapePluginModule.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Shared\Plugins\Netscape\NetscapePluginModule.h"
+ >
+ </File>
+ <Filter
+ Name="win"
+ >
+ <File
+ RelativePath="..\Shared\Plugins\Netscape\win\NetscapePluginModuleWin.cpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ </Filter>
</Filter>
<Filter
Name="WebProcess"
@@ -2803,27 +2811,27 @@
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\WebDatabaseManagerMessageReceiver.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\WebContextMessageReceiver.cpp"
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\WebDatabaseManagerMessages.h"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\WebContextMessages.h"
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\WebDatabaseManagerProxyMessageReceiver.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\WebDatabaseManagerMessageReceiver.cpp"
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\WebDatabaseManagerProxyMessages.h"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\WebDatabaseManagerMessages.h"
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\WebContextMessageReceiver.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\WebDatabaseManagerProxyMessageReceiver.cpp"
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\WebContextMessages.h"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\WebDatabaseManagerProxyMessages.h"
>
</File>
<File
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list