Diff
Modified: trunk/Source/WebKit2/ChangeLog (88838 => 88839)
--- trunk/Source/WebKit2/ChangeLog 2011-06-14 18:44:25 UTC (rev 88838)
+++ trunk/Source/WebKit2/ChangeLog 2011-06-14 18:45:33 UTC (rev 88839)
@@ -1,3 +1,36 @@
+2011-06-14 Anders Carlsson <[email protected]>
+
+ Reviewed by Sam Weinig.
+
+ Create the PluginModuleInfo class and reverse the typedef so that PluginInfoStore::Plugin is now a typedef
+ https://bugs.webkit.org/show_bug.cgi?id=62654
+
+ * UIProcess/Plugins/PluginInfoStore.cpp:
+ (WebKit::PluginInfoStore::loadPluginsIfNecessary):
+ (WebKit::PluginInfoStore::loadPlugin):
+ (WebKit::PluginInfoStore::findPluginForMIMEType):
+ (WebKit::PluginInfoStore::findPluginForExtension):
+ (WebKit::PluginInfoStore::findPlugin):
+ (WebKit::PluginInfoStore::infoForPluginWithPath):
+ * UIProcess/Plugins/PluginInfoStore.h:
+ * UIProcess/Plugins/PluginProcessManager.cpp:
+ (WebKit::PluginProcessManager::getPluginProcessConnection):
+ * UIProcess/Plugins/PluginProcessProxy.cpp:
+ (WebKit::PluginProcessProxy::PluginProcessProxy):
+ * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
+ (WebKit::WebPluginSiteDataManager::getSitesWithData):
+ (WebKit::WebPluginSiteDataManager::clearSiteData):
+ * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
+ (WebKit::PluginInfoStore::getPluginInfo):
+ (WebKit::PluginInfoStore::shouldUsePlugin):
+ * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
+ (WebKit::PluginInfoStore::getPluginInfo):
+ (WebKit::PluginInfoStore::shouldUsePlugin):
+ * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
+ (WebKit::isOldWindowsMediaPlayerPlugin):
+ (WebKit::isNewWindowsMediaPlayerPlugin):
+ (WebKit::PluginInfoStore::shouldUsePlugin):
+
2011-06-14 Stephanie Lewis <[email protected]>
Rubber stamped by Oliver Hunt.
Modified: trunk/Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModuleNone.cpp (88838 => 88839)
--- trunk/Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModuleNone.cpp 2011-06-14 18:44:25 UTC (rev 88838)
+++ trunk/Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModuleNone.cpp 2011-06-14 18:45:33 UTC (rev 88839)
@@ -33,7 +33,7 @@
namespace WebKit {
-bool NetscapePluginModule::getPluginInfo(const String&, PluginInfoStore::Plugin&)
+bool NetscapePluginModule::getPluginInfo(const String&, PluginModuleInfo&)
{
return false;
}
Modified: trunk/Source/WebKit2/Shared/Plugins/Netscape/win/NetscapePluginModuleWin.cpp (88838 => 88839)
--- trunk/Source/WebKit2/Shared/Plugins/Netscape/win/NetscapePluginModuleWin.cpp 2011-06-14 18:44:25 UTC (rev 88838)
+++ trunk/Source/WebKit2/Shared/Plugins/Netscape/win/NetscapePluginModuleWin.cpp 2011-06-14 18:45:33 UTC (rev 88839)
@@ -53,7 +53,7 @@
return version.QuadPart;
}
-bool NetscapePluginModule::getPluginInfo(const String& pluginPath, PluginInfoStore::Plugin& plugin)
+bool NetscapePluginModule::getPluginInfo(const String& pluginPath, PluginModuleInfo& plugin)
{
String pathCopy = pluginPath;
DWORD versionInfoSize = ::GetFileVersionInfoSizeW(pathCopy.charactersWithNullTermination(), 0);
@@ -116,7 +116,7 @@
void NetscapePluginModule::determineQuirks()
{
- PluginInfoStore::Plugin plugin;
+ PluginModuleInfo plugin;
getPluginInfo(m_pluginPath, plugin);
Vector<MimeClassInfo> mimeTypes = plugin.info.mimes;
Modified: trunk/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp (88838 => 88839)
--- trunk/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp 2011-06-14 18:44:25 UTC (rev 88838)
+++ trunk/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp 2011-06-14 18:45:33 UTC (rev 88839)
@@ -63,7 +63,7 @@
#endif
}
-bool NetscapePluginModule::getPluginInfo(const String& pluginPath, PluginInfoStore::Plugin& plugin)
+bool NetscapePluginModule::getPluginInfo(const String& pluginPath, PluginModuleInfo& plugin)
{
// We are loading the plugin here since it does not seem to be a standardized way to
// get the needed informations from a UNIX plugin without loading it.
Modified: trunk/Source/WebKit2/Shared/Plugins/PluginModuleInfo.h (88838 => 88839)
--- trunk/Source/WebKit2/Shared/Plugins/PluginModuleInfo.h 2011-06-14 18:44:25 UTC (rev 88838)
+++ trunk/Source/WebKit2/Shared/Plugins/PluginModuleInfo.h 2011-06-14 18:45:33 UTC (rev 88839)
@@ -26,13 +26,23 @@
#ifndef PluginModuleInfo_h
#define PluginModuleInfo_h
-// FIXME: Remove this include and move PluginInfoStore::Plugin here and rename it to PluginModuleInfo.
-#include "PluginInfoStore.h"
+#include <WebCore/PluginData.h>
namespace WebKit {
-typedef PluginInfoStore::Plugin PluginModuleInfo;
+struct PluginModuleInfo {
+ String path;
+ WebCore::PluginInfo info;
+#if PLATFORM(MAC)
+ cpu_type_t pluginArchitecture;
+ String bundleIdentifier;
+ String versionString;
+#elif PLATFORM(WIN)
+ uint64_t fileVersion;
+#endif
+};
+
} // namespace WebKit
#endif // PluginModuleInfo_h
Modified: trunk/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp (88838 => 88839)
--- trunk/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp 2011-06-14 18:44:25 UTC (rev 88838)
+++ trunk/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp 2011-06-14 18:45:33 UTC (rev 88839)
@@ -88,7 +88,7 @@
// Then load plug-ins that are not in the standard plug-ins directories.
addFromVector(uniquePluginPaths, individualPluginPaths());
- Vector<Plugin> plugins;
+ Vector<PluginModuleInfo> plugins;
PathHashSet::const_iterator end = uniquePluginPaths.end();
for (PathHashSet::const_iterator it = uniquePluginPaths.begin(); it != end; ++it)
@@ -98,9 +98,9 @@
m_pluginListIsUpToDate = true;
}
-void PluginInfoStore::loadPlugin(Vector<Plugin>& plugins, const String& pluginPath)
+void PluginInfoStore::loadPlugin(Vector<PluginModuleInfo>& plugins, const String& pluginPath)
{
- Plugin plugin;
+ PluginModuleInfo plugin;
if (!getPluginInfo(pluginPath, plugin))
return;
@@ -125,7 +125,7 @@
ASSERT(!mimeType.isNull());
for (size_t i = 0; i < m_plugins.size(); ++i) {
- const Plugin& plugin = m_plugins[i];
+ const PluginModuleInfo& plugin = m_plugins[i];
for (size_t j = 0; j < plugin.info.mimes.size(); ++j) {
const MimeClassInfo& mimeClassInfo = plugin.info.mimes[j];
@@ -134,7 +134,7 @@
}
}
- return Plugin();
+ return PluginModuleInfo();
}
PluginModuleInfo PluginInfoStore::findPluginForExtension(const String& extension, String& mimeType) const
@@ -142,7 +142,7 @@
ASSERT(!extension.isNull());
for (size_t i = 0; i < m_plugins.size(); ++i) {
- const Plugin& plugin = m_plugins[i];
+ const PluginModuleInfo& plugin = m_plugins[i];
for (size_t j = 0; j < plugin.info.mimes.size(); ++j) {
const MimeClassInfo& mimeClassInfo = plugin.info.mimes[j];
@@ -157,7 +157,7 @@
}
}
- return Plugin();
+ return PluginModuleInfo();
}
static inline String pathExtension(const KURL& url)
@@ -180,13 +180,13 @@
}
#endif
-PluginInfoStore::Plugin PluginInfoStore::findPlugin(String& mimeType, const KURL& url)
+PluginModuleInfo PluginInfoStore::findPlugin(String& mimeType, const KURL& url)
{
loadPluginsIfNecessary();
// First, check if we can get the plug-in based on its MIME type.
if (!mimeType.isNull()) {
- Plugin plugin = findPluginForMIMEType(mimeType);
+ PluginModuleInfo plugin = findPluginForMIMEType(mimeType);
if (!plugin.path.isNull())
return plugin;
}
@@ -194,14 +194,14 @@
// Next, check if any plug-ins claim to support the URL extension.
String extension = pathExtension(url).lower();
if (!extension.isNull() && mimeType.isEmpty()) {
- Plugin plugin = findPluginForExtension(extension, mimeType);
+ PluginModuleInfo plugin = findPluginForExtension(extension, mimeType);
if (!plugin.path.isNull())
return plugin;
// Finally, try to get the MIME type from the extension in a platform specific manner and use that.
String extensionMimeType = getMIMETypeForExtension(extension);
if (!extensionMimeType.isNull()) {
- Plugin plugin = findPluginForMIMEType(extensionMimeType);
+ PluginModuleInfo plugin = findPluginForMIMEType(extensionMimeType);
if (!plugin.path.isNull()) {
mimeType = extensionMimeType;
return plugin;
@@ -209,10 +209,10 @@
}
}
- return Plugin();
+ return PluginModuleInfo();
}
-PluginInfoStore::Plugin PluginInfoStore::infoForPluginWithPath(const String& pluginPath) const
+PluginModuleInfo PluginInfoStore::infoForPluginWithPath(const String& pluginPath) const
{
for (size_t i = 0; i < m_plugins.size(); ++i) {
if (m_plugins[i].path == pluginPath)
@@ -220,7 +220,7 @@
}
ASSERT_NOT_REACHED();
- return Plugin();
+ return PluginModuleInfo();
}
} // namespace WebKit
Modified: trunk/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h (88838 => 88839)
--- trunk/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h 2011-06-14 18:44:25 UTC (rev 88838)
+++ trunk/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h 2011-06-14 18:45:33 UTC (rev 88839)
@@ -26,7 +26,7 @@
#ifndef PluginInfoStore_h
#define PluginInfoStore_h
-#include <WebCore/PluginData.h>
+#include "PluginModuleInfo.h"
namespace WebCore {
class KURL;
@@ -40,39 +40,29 @@
public:
PluginInfoStore();
- // Represents a single plug-in.
- struct Plugin {
- String path;
- WebCore::PluginInfo info;
-#if PLATFORM(MAC)
- cpu_type_t pluginArchitecture;
- String bundleIdentifier;
- String versionString;
-#elif PLATFORM(WIN)
- uint64_t fileVersion;
-#endif
- };
+ // FIXME: Remove this typedef.
+ typedef PluginModuleInfo Plugin;
void setAdditionalPluginsDirectories(const Vector<String>&);
void refresh();
- Vector<Plugin> plugins();
+ Vector<PluginModuleInfo> plugins();
// Returns the info for a plug-in that can handle the given MIME type.
// If the MIME type is null, the file extension of the given url will be used to infer the
// plug-in type. In that case, mimeType will be filled in with the right MIME type.
- Plugin findPlugin(String& mimeType, const WebCore::KURL& url);
+ PluginModuleInfo findPlugin(String& mimeType, const WebCore::KURL&);
// Returns the info for the plug-in with the given path.
- Plugin infoForPluginWithPath(const String& pluginPath) const;
+ PluginModuleInfo infoForPluginWithPath(const String& pluginPath) const;
private:
- PluginInfoStore::Plugin findPluginForMIMEType(const String& mimeType) const;
- PluginInfoStore::Plugin findPluginForExtension(const String& extension, String& mimeType) const;
+ PluginModuleInfo findPluginForMIMEType(const String& mimeType) const;
+ PluginModuleInfo findPluginForExtension(const String& extension, String& mimeType) const;
void loadPluginsIfNecessary();
- static void loadPlugin(Vector<Plugin>& plugins, const String& pluginPath);
+ static void loadPlugin(Vector<PluginModuleInfo>& plugins, const String& pluginPath);
// Platform-specific member functions:
@@ -86,16 +76,16 @@
static Vector<String> individualPluginPaths();
// Load plug-in info for the plug-in with the specified path.
- static bool getPluginInfo(const String& pluginPath, Plugin& plugin);
+ static bool getPluginInfo(const String& pluginPath, PluginModuleInfo&);
// Return whether this plug-in should be used (added to the list of plug-ins) or not.
- static bool shouldUsePlugin(Vector<Plugin>& alreadyLoadedPlugins, const Plugin&);
+ static bool shouldUsePlugin(Vector<PluginModuleInfo>& alreadyLoadedPlugins, const PluginModuleInfo&);
// Get the MIME type for the given extension.
static String getMIMETypeForExtension(const String& extension);
Vector<String> m_additionalPluginsDirectories;
- Vector<Plugin> m_plugins;
+ Vector<PluginModuleInfo> m_plugins;
bool m_pluginListIsUpToDate;
};
Modified: trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessManager.cpp (88838 => 88839)
--- trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessManager.cpp 2011-06-14 18:44:25 UTC (rev 88838)
+++ trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessManager.cpp 2011-06-14 18:45:33 UTC (rev 88839)
@@ -49,7 +49,7 @@
{
ASSERT(!pluginPath.isNull());
- PluginInfoStore::Plugin plugin = pluginInfoStore.infoForPluginWithPath(pluginPath);
+ PluginModuleInfo plugin = pluginInfoStore.infoForPluginWithPath(pluginPath);
PluginProcessProxy* pluginProcess = getOrCreatePluginProcess(plugin);
pluginProcess->getPluginProcessConnection(reply);
}
Modified: trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp (88838 => 88839)
--- trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp 2011-06-14 18:44:25 UTC (rev 88838)
+++ trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp 2011-06-14 18:45:33 UTC (rev 88839)
@@ -49,7 +49,7 @@
return adoptPtr(new PluginProcessProxy(PluginProcessManager, pluginInfo));
}
-PluginProcessProxy::PluginProcessProxy(PluginProcessManager* PluginProcessManager, const PluginInfoStore::Plugin& pluginInfo)
+PluginProcessProxy::PluginProcessProxy(PluginProcessManager* PluginProcessManager, const PluginModuleInfo& pluginInfo)
: m_pluginProcessManager(PluginProcessManager)
, m_pluginInfo(pluginInfo)
, m_numPendingConnectionRequests(0)
Modified: trunk/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp (88838 => 88839)
--- trunk/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp 2011-06-14 18:44:25 UTC (rev 88838)
+++ trunk/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp 2011-06-14 18:45:33 UTC (rev 88839)
@@ -70,7 +70,7 @@
private:
WebPluginSiteDataManager* m_webPluginSiteDataManager;
uint64_t m_callbackID;
- Vector<PluginInfoStore::Plugin> m_plugins;
+ Vector<PluginModuleInfo> m_plugins;
HashSet<String> m_sites;
};
@@ -108,7 +108,7 @@
uint64_t m_flags;
uint64_t m_maxAgeInSeconds;
uint64_t m_callbackID;
- Vector<PluginInfoStore::Plugin> m_plugins;
+ Vector<PluginModuleInfo> m_plugins;
};
#endif // ENABLE(PLUGIN_PROCESS)
@@ -165,7 +165,7 @@
#else
m_webContext->relaunchProcessIfNecessary();
- Vector<PluginInfoStore::Plugin> plugins = m_webContext->pluginInfoStore().plugins();
+ Vector<PluginModuleInfo> plugins = m_webContext->pluginInfoStore().plugins();
Vector<String> pluginPaths;
for (size_t i = 0; i < plugins.size(); ++i)
pluginPaths.append(plugins[i].path);
@@ -228,7 +228,7 @@
#else
m_webContext->relaunchProcessIfNecessary();
- Vector<PluginInfoStore::Plugin> plugins = m_webContext->pluginInfoStore().plugins();
+ Vector<PluginModuleInfo> plugins = m_webContext->pluginInfoStore().plugins();
Vector<String> pluginPaths;
for (size_t i = 0; i < plugins.size(); ++i)
pluginPaths.append(plugins[i].path);
Modified: trunk/Source/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm (88838 => 88839)
--- trunk/Source/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm 2011-06-14 18:44:25 UTC (rev 88838)
+++ trunk/Source/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm 2011-06-14 18:45:33 UTC (rev 88839)
@@ -71,15 +71,15 @@
return Vector<String>();
}
-bool PluginInfoStore::getPluginInfo(const String& pluginPath, Plugin& plugin)
+bool PluginInfoStore::getPluginInfo(const String& pluginPath, PluginModuleInfo& plugin)
{
return NetscapePluginModule::getPluginInfo(pluginPath, plugin);
}
-bool PluginInfoStore::shouldUsePlugin(Vector<Plugin>& alreadyLoadedPlugins, const Plugin& plugin)
+bool PluginInfoStore::shouldUsePlugin(Vector<PluginModuleInfo>& alreadyLoadedPlugins, const PluginModuleInfo& plugin)
{
for (size_t i = 0; i < alreadyLoadedPlugins.size(); ++i) {
- const Plugin& loadedPlugin = alreadyLoadedPlugins[i];
+ const PluginModuleInfo& loadedPlugin = alreadyLoadedPlugins[i];
// If a plug-in with the same bundle identifier already exists, we don't want to load it.
if (loadedPlugin.bundleIdentifier == plugin.bundleIdentifier)
Modified: trunk/Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp (88838 => 88839)
--- trunk/Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp 2011-06-14 18:44:25 UTC (rev 88838)
+++ trunk/Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp 2011-06-14 18:45:33 UTC (rev 88839)
@@ -59,12 +59,12 @@
return Vector<String>();
}
-bool PluginInfoStore::getPluginInfo(const String& pluginPath, Plugin& plugin)
+bool PluginInfoStore::getPluginInfo(const String& pluginPath, PluginModuleInfo& plugin)
{
return NetscapePluginModule::getPluginInfo(pluginPath, plugin);
}
-bool PluginInfoStore::shouldUsePlugin(Vector<Plugin>& alreadyLoadedPlugins, const Plugin& plugin)
+bool PluginInfoStore::shouldUsePlugin(Vector<PluginModuleInfo>& alreadyLoadedPlugins, const PluginModuleInfo& plugin)
{
// We do not do any black-listing presently.
return true;
Modified: trunk/Source/WebKit2/UIProcess/Plugins/win/PluginInfoStoreWin.cpp (88838 => 88839)
--- trunk/Source/WebKit2/UIProcess/Plugins/win/PluginInfoStoreWin.cpp 2011-06-14 18:44:25 UTC (rev 88838)
+++ trunk/Source/WebKit2/UIProcess/Plugins/win/PluginInfoStoreWin.cpp 2011-06-14 18:45:33 UTC (rev 88839)
@@ -328,17 +328,17 @@
return NetscapePluginModule::getPluginInfo(pluginPath, plugin);
}
-static bool isOldWindowsMediaPlayerPlugin(const PluginInfoStore::Plugin& plugin)
+static bool isOldWindowsMediaPlayerPlugin(const PluginModuleInfo& plugin)
{
return equalIgnoringCase(plugin.info.file, "npdsplay.dll");
}
-static bool isNewWindowsMediaPlayerPlugin(const PluginInfoStore::Plugin& plugin)
+static bool isNewWindowsMediaPlayerPlugin(const PluginModuleInfo& plugin)
{
return equalIgnoringCase(plugin.info.file, "np-mswmp.dll");
}
-bool PluginInfoStore::shouldUsePlugin(Vector<Plugin>& alreadyLoadedPlugins, const Plugin& plugin)
+bool PluginInfoStore::shouldUsePlugin(Vector<PluginModuleInfo>& alreadyLoadedPlugins, const PluginModuleInfo& plugin)
{
if (plugin.info.name == "Citrix ICA Client") {
// The Citrix ICA Client plug-in requires a Mozilla-based browser; see <rdar://6418681>.
Modified: trunk/Source/WebKit2/UIProcess/WebContext.cpp (88838 => 88839)
--- trunk/Source/WebKit2/UIProcess/WebContext.cpp 2011-06-14 18:44:25 UTC (rev 88838)
+++ trunk/Source/WebKit2/UIProcess/WebContext.cpp 2011-06-14 18:45:33 UTC (rev 88839)
@@ -532,7 +532,7 @@
if (refresh)
m_pluginInfoStore.refresh();
- Vector<PluginInfoStore::Plugin> plugins = m_pluginInfoStore.plugins();
+ Vector<PluginModuleInfo> plugins = m_pluginInfoStore.plugins();
for (size_t i = 0; i < plugins.size(); ++i)
pluginInfos.append(plugins[i].info);
}
@@ -541,7 +541,7 @@
{
String newMimeType = mimeType.lower();
- PluginInfoStore::Plugin plugin = pluginInfoStore().findPlugin(newMimeType, KURL(ParsedURLString, urlString));
+ PluginModuleInfo plugin = pluginInfoStore().findPlugin(newMimeType, KURL(ParsedURLString, urlString));
if (!plugin.path)
return;
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (88838 => 88839)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2011-06-14 18:44:25 UTC (rev 88838)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2011-06-14 18:45:33 UTC (rev 88839)
@@ -581,7 +581,7 @@
return !MIMETypeRegistry::isUnsupportedTextMIMEType(mimeType);
String newMimeType = mimeType;
- PluginInfoStore::Plugin plugin = m_process->context()->pluginInfoStore().findPlugin(newMimeType, KURL());
+ PluginModuleInfo plugin = m_process->context()->pluginInfoStore().findPlugin(newMimeType, KURL());
if (!plugin.path.isNull())
return true;