Add API to allow WK2 clients to query the list of installed plug-ins.
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Mar 2013 22:08:26 +0000 (22:08 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Mar 2013 22:08:26 +0000 (22:08 +0000)
commit438f539fd861bfec6b848182ac1083211a643c27
tree9c081133ef884fb94571c0eea4718e8acc5e74a9
parent5dbc5e00b07a4499ec6e9ad2301657a7446c434f
Add API to allow WK2 clients to query the list of installed plug-ins.
https://bugs.webkit.org/show_bug.cgi?id=111245

Reviewed by Alexey Proskuryakov.

Add API in WKContext, implemented by WebContext, that allows callers to register a callback
retrieve an array containing installed plugin information. This API is exposed through WebContext
because it owns the PluginInfoStore used to fulfill the request.

Bump the WKContextClient API by 1:
* Shared/APIClientTraits.cpp:
* Shared/APIClientTraits.h:
* UIProcess/API/C/WKContext.h:

Add a client protocol to PluginInfoStore to notify the client when plugIn information has been
successfully loaded:
* UIProcess/Plugins/PluginInfoStore.cpp:
(WebKit::PluginInfoStore::PluginInfoStore): Initialize m_client to 0.
(WebKit::PluginInfoStore::loadPluginsIfNecessary): If the client is present, notify after loading the plugin store.
* UIProcess/Plugins/PluginInfoStore.h:
(WebKit::PluginInfoStoreClient::~PluginInfoStoreClient): Default destructor.
(WebKit::PluginInfoStoreClient::PluginInfoStoreClient): Default constructor.
(WebKit::PluginInfoStore::setClient): Simple setter.
(WebKit::PluginInfoStore::client): Simple getter.

* UIProcess/WebContext.cpp:
(WebKit::WebContext::WebContext): Set self as the client of PluginInfoStore.
(WebKit::WebContext::~WebContext): Clear the client of PluginInfoStore.
(WebKit::WebContext::pluginInfoStoreDidLoadPlugins): Pass the callback to own client.
* UIProcess/WebContext.h:
* UIProcess/WebContextClient.cpp:
(WebKit::WebContextClient::plugInInformationBecameAvailable): Pass the callback to the registered WK callback, if present.
* UIProcess/WebContextClient.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@144672 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/APIClientTraits.cpp
Source/WebKit2/Shared/APIClientTraits.h
Source/WebKit2/UIProcess/API/C/WKContext.h
Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp
Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h
Source/WebKit2/UIProcess/WebContext.cpp
Source/WebKit2/UIProcess/WebContext.h
Source/WebKit2/UIProcess/WebContextClient.cpp
Source/WebKit2/UIProcess/WebContextClient.h