RESOLVED FIXED Bug 47677
WebKit2 can load the same plugin multiple times
https://bugs.webkit.org/show_bug.cgi?id=47677
Summary WebKit2 can load the same plugin multiple times
Adam Roben (:aroben)
Reported 2010-10-14 11:21:01 PDT
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.
Attachments
Make sure WebKit2 only loads each plugin once (6.17 KB, patch)
2010-10-14 11:55 PDT, Adam Roben (:aroben)
sam: review+
Adam Roben (:aroben)
Comment 1 2010-10-14 11:21:53 PDT
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.
Adam Roben (:aroben)
Comment 2 2010-10-14 11:22:13 PDT
Adam Roben (:aroben)
Comment 3 2010-10-14 11:55:13 PDT
Created attachment 70763 [details] Make sure WebKit2 only loads each plugin once
Sam Weinig
Comment 4 2010-10-14 12:08:26 PDT
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?
Adam Roben (:aroben)
Comment 5 2010-10-14 12:09:52 PDT
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!
Adam Roben (:aroben)
Comment 6 2010-10-14 12:33:35 PDT
Note You need to log in before you can comment on or make changes to this bug.