[Mac] Allow throttling of background tabs that have media elements with no audible...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Oct 2016 14:56:05 +0000 (14:56 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Oct 2016 14:56:05 +0000 (14:56 +0000)
commit7e7ade9a4ae83eac5898794ddc3dcac9512db453
treeead433d11c7b958fa639ca07f9e5ee9f1657b2b9
parent84b7662eff2f4e54765007a443d79daa05a3c3b5
[Mac] Allow throttling of background tabs that have media elements with no audible audio
https://bugs.webkit.org/show_bug.cgi?id=163402
<rdar://problem/28056151>

Reviewed by Gavin Barraclough.

Allow throttling of background tabs that have media elements with no audible audio.
We were taking an media assertion from the PageThrottler as soon as there was a
media element playing on the page. This prevented throttling of background tabs
even if those media elements had no audible audio, which was unfortunate.

We now have more fine-grained rules for when HTMLMediaElement should take an
assertion. I also added release logging to help debug such issues in the
future.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setMuted):
(WebCore::HTMLMediaElement::updateVolume):
(WebCore::HTMLMediaElement::updatePlayState):
(WebCore::HTMLMediaElement::updateAudioAssertionState):
(WebCore::HTMLMediaElement::effectiveMuted): Deleted.
* html/HTMLMediaElement.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207338 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h