Skip to content

Commit

Permalink
Remove use of the MediaPlayback assertion
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=271801
rdar://119496105

Reviewed by Chris Dumez and Andy Estes.

Disable the use of the MediaPlayback assertion for WebKit process extensions, since process runtime is
handled by Media endowments in this case.

* Source/WebKit/UIProcess/WebProcessPool.cpp:
* Source/WebKit/UIProcess/WebProcessProxy.cpp:

Canonical link: https://commits.webkit.org/276828@main
  • Loading branch information
pvollan committed Mar 29, 2024
1 parent 8b78e07 commit 5da0d35
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Source/WebKit/UIProcess/WebProcessPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
#include <WebCore/GamepadProvider.h>
#include <WebCore/MockRealtimeMediaSourceCenter.h>
#include <WebCore/NetworkStorageSession.h>
#include <WebCore/PlatformMediaSessionManager.h>
#include <WebCore/PlatformScreen.h>
#include <WebCore/ProcessIdentifier.h>
#include <WebCore/ProcessWarming.h>
Expand Down Expand Up @@ -2305,6 +2306,11 @@ void WebProcessPool::clearAudibleActivity()

void WebProcessPool::updateAudibleMediaAssertions()
{
#if ENABLE(EXTENSION_CAPABILITIES)
if (PlatformMediaSessionManager::mediaCapabilityGrantsEnabled())
return;
#endif

if (!m_webProcessWithAudibleMediaCounter.value()) {
WEBPROCESSPOOL_RELEASE_LOG(ProcessSuspension, "updateAudibleMediaAssertions: Starting timer to clear audible activity in %g seconds because we are no longer playing audio", audibleActivityClearDelay.seconds());
// We clear the audible activity on a timer for 2 reasons:
Expand Down
5 changes: 5 additions & 0 deletions Source/WebKit/UIProcess/WebProcessProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1860,6 +1860,11 @@ String WebProcessProxy::environmentIdentifier() const

void WebProcessProxy::updateAudibleMediaAssertions()
{
#if ENABLE(EXTENSION_CAPABILITIES)
if (PlatformMediaSessionManager::mediaCapabilityGrantsEnabled())
return;
#endif

bool hasAudibleWebPage = WTF::anyOf(pages(), [] (auto& page) {
return page->isPlayingAudio();
});
Expand Down

0 comments on commit 5da0d35

Please sign in to comment.