It's possible for WebKit2 to load the same plugin multiple times. This can happen, e.g., if a client application passes the path to a standard plugin directory to _WKContextSetAdditionalPluginsDirectory, or if a plugin in one of the standard plugin directories on Windows is also listed in the MozillaPlugins registry key.
We could change how we load plugins to: 1) Collect all plugin paths from all directories 2) Put all the paths in a HashSet to get rid of duplicates 3) Load plugins specified in the HashSet On Windows, we'd probably want to use a case-insensitive HashSet.
<rdar://problem/8552178>
Created attachment 70763 [details] Make sure WebKit2 only loads each plugin once
Comment on attachment 70763 [details] Make sure WebKit2 only loads each plugin once View in context: https://bugs.webkit.org/attachment.cgi?id=70763&action=review > WebKit2/UIProcess/Plugins/PluginInfoStore.cpp:59 > +template <typename T, typename U, typename V, typename W> > +static void addFromVector(HashSet<T, U, V>& hashSet, const W& vector) > +{ > + for (size_t i = 0; i < vector.size(); ++i) > + hashSet.add(vector[i]); > +} Should this be in HashSet.h?
Comment on attachment 70763 [details] Make sure WebKit2 only loads each plugin once View in context: https://bugs.webkit.org/attachment.cgi?id=70763&action=review >> WebKit2/UIProcess/Plugins/PluginInfoStore.cpp:59 >> +} > > Should this be in HashSet.h? If we find it to be more generally useful we could put it there. Thanks for reviewing!
Committed r69790: <http://trac.webkit.org/changeset/69790>