[webkit-changes] [WebKit/WebKit] ecb0f6: [iOS] MediaSessionManager continues to monitor wir...
aestes
noreply at github.com
Tue Jul 11 13:38:14 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ecb0f69a544d86d9b379987d73bc1a96562e4c4a
https://github.com/WebKit/WebKit/commit/ecb0f69a544d86d9b379987d73bc1a96562e4c4a
Author: Andy Estes <aestes at apple.com>
Date: 2023-07-11 (Tue, 11 Jul 2023)
Changed paths:
M LayoutTests/TestExpectations
A LayoutTests/media/wireless-route-monitoring-expected.txt
A LayoutTests/media/wireless-route-monitoring.html
M LayoutTests/platform/ios/TestExpectations
M Source/WebCore/html/MediaElementSession.cpp
M Source/WebCore/platform/audio/PlatformMediaSessionManager.h
M Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h
M Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm
M Source/WebCore/testing/Internals.cpp
M Source/WebCore/testing/Internals.h
M Source/WebCore/testing/Internals.idl
Log Message:
-----------
[iOS] MediaSessionManager continues to monitor wireless targets when a page is no longer visible
https://bugs.webkit.org/show_bug.cgi?id=259084
rdar://107220858
Reviewed by Jer Noble.
When a page contains a visible media element with a playback target availability listener (e.g.,
webkitplaybacktargetavailabilitychanged), MediaSessionManager starts to monitor for playback
targets. On iOS, this is implemented by asking AVRouteDetector to monitor for AirPlay routes,
increasing the system's power consumption.
MediaElementSession attempted to stop monitoring when its HTML element becomes invisible, but this
only occurred when m_clientDataBufferingTimer fired. However, while this timer was always scheduled
when the media element became invisible, in some cases it would be stopped before firing by code
calling updateClientDataBuffering() directly. In these cases MediaSessionManager would not be told
to stop monitoring target availability, increasing the system's power consumption for an arbitrary
amount of time.
Fixed this by calling PlatformMediaSessionManager::configureWirelessTargetMonitoring() whenever
MediaElementSession::updateClientDataBuffering() is called, whether directly or by
m_clientDataBufferingTimer firing. While here, also renamed configureWireLessTargetMonitoring to
configureWirelessTargetMonitoring.
* LayoutTests/TestExpectations: Skipped wireless-route-monitoring.html.
* LayoutTests/media/wireless-route-monitoring-expected.txt: Added.
* LayoutTests/media/wireless-route-monitoring.html: Added.
* LayoutTests/platform/ios/TestExpectations: Expected wireless-route-monitoring.html to pass on iOS.
* Source/WebCore/html/MediaElementSession.cpp:
(WebCore::MediaElementSession::clientDataBufferingTimerFired):
(WebCore::MediaElementSession::updateClientDataBuffering):
(WebCore::MediaElementSession::setHasPlaybackTargetAvailabilityListeners):
* Source/WebCore/platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::configureWirelessTargetMonitoring):
(WebCore::PlatformMediaSessionManager::isMonitoringWirelessTargets const):
(WebCore::PlatformMediaSessionManager::configureWireLessTargetMonitoring): Renamed to configureWirelessTargetMonitoring.
* Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h:
* Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::isMonitoringWirelessTargets const):
(WebCore::MediaSessionManageriOS::configureWirelessTargetMonitoring):
(WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring): Renamed to configureWirelessTargetMonitoring.
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::suspendAllMediaBuffering):
(WebCore::Internals::isMonitoringWirelessRoutes const):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:
Canonical link: https://commits.webkit.org/265965@main
More information about the webkit-changes
mailing list