[webkit-reviews] review requested: [Bug 28490] Allow excluding certain plugins from loading : [Attachment 35205] Proposed patch to implement the plugin loading delegation described in the feature request.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 20 08:17:13 PDT 2009


Marius Renn <damarvy at gmail.com> has asked  for review:
Bug 28490: Allow excluding certain plugins from loading
https://bugs.webkit.org/show_bug.cgi?id=28490

Attachment 35205: Proposed patch to implement the plugin loading delegation
described in the feature request.
https://bugs.webkit.org/attachment.cgi?id=35205&action=review

------- Additional Comments from Marius Renn <damarvy at gmail.com>
It is well known that web plugins may misbehave, in the worst case causing the
browser to crash. This can happen as early as plugin loading, as dynamically
linked plugin initialization code may be executed at this time. In many cases,
programs may not want to change the plugin directory from which to load from.
Instead they want to filter the list of plugins to load. Thus, I propose to
allow WebKit applications to exclude plugins either by path or other plugin
details (name, version, ...). This can be done by assigning a delegate to the
PluginDatabase singleton instance, which can make a decision on whether or not
to exclude a certain plugin. (Note that this relies on the patch to allow
obtaining a PluginDatabase instance without loading all plugins). 

I am attaching a proposed patch to this report, which includes an abstract base
class PluginDatabaseDelegate. This class contains two methods to be implemented
in a subclass:
- bool shouldLoadPluginAtPath(const String&)
- bool shouldLoadPluginPackage(const PluginPackage*).
The methods are called in this order. If any of these returns false, the
loading of this particular plugin is aborted.

A delegate implementing this subclass could be set as shown below (here the
delegate is called myDelegate):
PluginDatabase* db = PluginDatabase::installedPlugins(false); // do not load
plugins just yet
db->setDelegate(myDelegate); // Set delegate
db->setPluginDirectories(PluginDatabase::defaultPluginDirectories());
db->refresh() // load plugins from standard directory now


More information about the webkit-reviews mailing list