Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3ec8c62695a2acc1bd7470b552d105b350cc7943
      
https://github.com/WebKit/WebKit/commit/3ec8c62695a2acc1bd7470b552d105b350cc7943
  Author: Eric Carlson <[email protected]>
  Date:   2026-07-27 (Mon, 27 Jul 2026)

  Changed paths:
    M Source/WebCore/Headers.cmake
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    A Source/WebCore/platform/audio/MediaSessionManagerClient.h
    M Source/WebCore/platform/audio/MediaSessionManagerInterface.cpp
    M Source/WebCore/platform/audio/MediaSessionManagerInterface.h
    M Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.mm

  Log Message:
  -----------
  [Site Isolation] Define a MediaSessionManagerClient to route audio-session 
activation and NowPlaying
https://bugs.webkit.org/show_bug.cgi?id=320247
rdar://183175861

Reviewed by Jean-Yves Avenard.

MediaSessionManagerCocoa notifies the active NowPlaying session changing by 
looking up a
WebCore::Page via Page::fromPageIdentifier() and calling 
hasActiveNowPlayingSessionChanged()
on it. That does not work for the UI-process RemoteMediaSessionManagerProxy, 
which has no
WebCore::Page and aggregates media sessions from many web processes; when that 
class was
made a singleton in 317396@main the dependency was side-stepped by making the
PageIdentifier optional, with a note that a better abstraction was needed in a 
follow-up
to use a client of some sort.

This adds that abstraction. MediaSessionManagerClient is a small interface for 
the
environment-coupled NowPlaying notification. MediaSessionManagerInterface owns 
one,
defaulting to PageMediaSessionManagerClient, which reproduces the existing 
behavior
(resolve the PageIdentifier to a WebCore::Page and forward the call), so there 
is no
behavior change. A follow-up will let the UI-process singleton install its own 
client
that routes the notification to the right page.

No new tests; this is a behavior-preserving refactor covered by existing media 
tests.

* Source/WebCore/Headers.cmake:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/platform/audio/MediaSessionManagerClient.h: Added.
* Source/WebCore/platform/audio/MediaSessionManagerInterface.cpp:
(WebCore::MediaSessionManagerInterface::MediaSessionManagerInterface):
(WebCore::MediaSessionManagerInterface::client const):
* Source/WebCore/platform/audio/MediaSessionManagerInterface.h:
* Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(WebCore::MediaSessionManagerCocoa::removeSession):
(WebCore::MediaSessionManagerCocoa::updateActiveNowPlayingSession):

Canonical link: https://commits.webkit.org/317977@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to