Figure out whether a plug-in is playing audio.
authoradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Nov 2014 07:21:54 +0000 (07:21 +0000)
committeradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Nov 2014 07:21:54 +0000 (07:21 +0000)
commit92ba45895c9b2af67a0b6990eb628fb0edeffd9d
treea3004e0fc86eb6b11123e0bf02d490d24268091b
parent8e96bff3aec84593c8b79c9b752e498ecb134ff2
Figure out whether a plug-in is playing audio.
https://bugs.webkit.org/show_bug.cgi?id=137219

Reviewed by Anders Carlsson.

Source/WebCore:

Add NPPVpluginIsPlayingAudio. Export some WebCore methods that will be used in WebKit2.

No new tests, but manually tested with an example plugin.

* WebCore.exp.in:
* plugins/npapi.h:

Source/WebKit2:

Handle the setting of the NPPVpluginIsPlayingAudio variable.

* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::setPluginIsPlayingAudio):
Send a SetPluginIsPlayingAudio message to the WebProcess.
* PluginProcess/PluginControllerProxy.h:
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::NPN_SetValue):
Handle NPPVpluginIsPlayingAudio. Call NetscapePlugin::setIsPlayingAudio().
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::setIsPlayingAudio):
Call PluginControllerProxy::setPluginIsPlayingAudio().
* WebProcess/Plugins/Netscape/NetscapePlugin.h:
* WebProcess/Plugins/PluginController.h:
* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::setPluginIsPlayingAudio):
Call PluginView::setPluginIsPlayingAudio().
* WebProcess/Plugins/PluginProxy.h:
* WebProcess/Plugins/PluginProxy.messages.in:
Add the SetPluginIsPlayingAudio message.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::PluginView):
Initialize m_pluginIsPlayingAudio.
(WebKit::PluginView::~PluginView):
Remove itself from the Document's list of AudioProducers.
(WebKit::PluginView::initializePlugin):
Add itself to the Document's list of AudioProducers.
(WebKit::PluginView::pageMutedStateDidChange):
Add a FIXME.
(WebKit::PluginView::setPluginIsPlayingAudio):
If m_pluginIsPlayingAudio has changed, tell the Document to update its audio playing state.
* WebProcess/Plugins/PluginView.h:
Now inherits AudioProducer.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175686 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/plugins/npapi.h
Source/WebKit2/ChangeLog
Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
Source/WebKit2/PluginProcess/PluginControllerProxy.h
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
Source/WebKit2/WebProcess/Plugins/PluginController.h
Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp
Source/WebKit2/WebProcess/Plugins/PluginProxy.h
Source/WebKit2/WebProcess/Plugins/PluginProxy.messages.in
Source/WebKit2/WebProcess/Plugins/PluginView.cpp
Source/WebKit2/WebProcess/Plugins/PluginView.h