[Webkit-unassigned] [Bug 134357] [GTK] Add API to allow blocking plugins

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 9 02:09:14 PDT 2015


https://bugs.webkit.org/show_bug.cgi?id=134357

--- Comment #16 from Marcos Chavarría Teijeiro (chavaone) <chavarria1991 at gmail.com> ---
I have beed working last weeks on modifying my patch to support declarative set of plugin load policies.

In spite of the fact that it do work know, this is a WIP still but any review/idea are really wellcome.

Appart from the previous created signals load-plugin, blocked-plugin and unavailable-plugin-activated, I have implement two methods to set and clear plugin load policies in a declarative way. So, webkit_plugin_set_client_load_policy can be used for set the load policy for a certain host and plugin and webkit_context_clear_policies could be used for clear all established policies. We have to take into account that there is no persistence at all in this policies so when we restart our application, the previous established policies will be gone. Thats why the application should store a list of policies established for plugins and the API does not provide a webkit_plugin_get_client_load_policy.

Both implemented methods expose the WebProccessPool methods created by r181562 (http://trac.webkit.org/changeset/181562). These methods update a local hashmap that contains all created policies and then they send a message to the WebProcess which also updates a local hashmap.

The problem is that these methods use BundleId and Version to identify each plugin and we dont have that in GTK+ so, I have use the filename instead of the bundleId and I have hardcoded the versionId to "*".

On the other hand the solution to get the established plugin policy for a certain plugin and host in load-plugin is a litle hacky... I have implement a method getPluginLoadClientPolicy in WebProcessPool. This method gets the established policy for a plugin finding the key in the WebProccessPool local array. Mac port seems to be doing this using other ways but I have not found any alternative.

The plugin information provided to load-plugin is a dictionary created using a PluginModuleInfo data obtained from PluginInfoStore. In GTK we use a cache to store the PluginModuleInfo for each plugin and this cache is only updated when the file changed.

In addition the created test has a race condition so It it timeouts if we dont have the wait instruction on line 900 of the TestWebKitWebView.cpp file.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150409/ee6b34ee/attachment.html>


More information about the webkit-unassigned mailing list