Commit 937468a0 authored by aroben@apple.com's avatar aroben@apple.com

Load plugins in the order they're found

Fixes <http://webkit.org/b/60788> <rdar://problem/9435787> REGRESSION (r69790): WebKit2
doesn't prefer plugins in the additional plugins directory

Reviewed by Anders Carlsson.

* UIProcess/Plugins/PluginInfoStore.cpp:
(WebKit::addFromVector):
Changed to use a ListHashSet instead of a HashSet to store the plugin paths.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@86456 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 23768d21
2011-05-13 Adam Roben <aroben@apple.com>
Load plugins in the order they're found
Fixes <http://webkit.org/b/60788> <rdar://problem/9435787> REGRESSION (r69790): WebKit2
doesn't prefer plugins in the additional plugins directory
Reviewed by Anders Carlsson.
* UIProcess/Plugins/PluginInfoStore.cpp:
(WebKit::addFromVector):
Changed to use a ListHashSet instead of a HashSet to store the plugin paths.
2011-05-13 Sam Weinig <sam@webkit.org>
Reviewed by Anders Carlsson.
......
......@@ -29,6 +29,7 @@
#include <WebCore/KURL.h>
#include <WebCore/MIMETypeRegistry.h>
#include <algorithm>
#include <wtf/ListHashSet.h>
#include <wtf/StdLibExtras.h>
using namespace std;
......@@ -52,17 +53,19 @@ void PluginInfoStore::refresh()
m_pluginListIsUpToDate = false;
}
template <typename T, typename U, typename V, typename W>
static void addFromVector(HashSet<T, U, V>& hashSet, const W& vector)
template <typename T, typename U>
static void addFromVector(T& hashSet, const U& vector)
{
for (size_t i = 0; i < vector.size(); ++i)
hashSet.add(vector[i]);
}
// We use a ListHashSet so that plugins will be loaded from the additional plugins directories first
// (which in turn means those plugins will be preferred if two plugins claim the same MIME type).
#if OS(WINDOWS)
typedef HashSet<String, CaseFoldingHash> PathHashSet;
typedef ListHashSet<String, 32, CaseFoldingHash> PathHashSet;
#else
typedef HashSet<String> PathHashSet;
typedef ListHashSet<String, 32> PathHashSet;
#endif
void PluginInfoStore::loadPluginsIfNecessary()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment