Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b913bf1da9bda30c2b35cdfa0b0cf6f5c7d0b40f
https://github.com/WebKit/WebKit/commit/b913bf1da9bda30c2b35cdfa0b0cf6f5c7d0b40f
Author: Rupin Mittal <[email protected]>
Date: 2026-06-05 (Fri, 05 Jun 2026)
Changed paths:
M LayoutTests/platform/mac-site-isolation/TestExpectations
M Source/WebKit/Sources.txt
M Source/WebKit/UIProcess/Media/RemoteMediaSessionManagerProxy.cpp
M Source/WebKit/UIProcess/Media/RemoteMediaSessionManagerProxy.h
A Source/WebKit/UIProcess/RemotePageMediaSessionManagerProxy.cpp
A Source/WebKit/UIProcess/RemotePageMediaSessionManagerProxy.h
M Source/WebKit/UIProcess/RemotePageProxy.cpp
M Source/WebKit/UIProcess/RemotePageProxy.h
M Source/WebKit/UIProcess/UserMediaPermissionRequestProxy.cpp
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/UIProcess/WebPageProxy.h
M Source/WebKit/UIProcess/WebPageProxy.messages.in
M Source/WebKit/WebKit.xcodeproj/project.pbxproj
M Source/WebKit/WebProcess/Media/RemoteMediaSessionManager.cpp
M Source/WebKit/WebProcess/Media/RemoteMediaSessionManager.h
M Source/WebKit/WebProcess/WebPage/WebPage.cpp
Log Message:
-----------
[Site Isolation] Webpage is constantly reloaded "invalid message
RemoteMediaSessionManagerProxy_RemoteAudioConfigurationChanged"
https://bugs.webkit.org/show_bug.cgi?id=314564
rdar://176803176
Reviewed by Sihui Liu.
On zillow.com, the page keeps reloading because "an error occurred".
The web process creates RemoteMediaSessionManager in WebPage::WebPage() when
RemoteMediaSessionManagerEnabled || SiteIsolationSharedProcessEnabled
(this was added in https://commits.webkit.org/304036@main).
But the UIProcess's generated message receiver accepts messages only when:
RemoteMediaSessionManagerEnabled || SiteIsolationEnabled
(from the EnabledBy attribute in RemoteMediaSessionManagerProxy.messages.in).
So if SiteIsolationSharedProcessEnabled is true (but both
RemoteMediaSessionManagerEnabled and SiteIsolationEnabled are false), the web
process will create the RemoteMediaSessionManager and send messages, but the
UIProcess will reject them and kill the web process.
There are more issues with RemoteMediaSessionManager as well.
In the WebPage constructor, if we don't find a topDocument (which is what
happens in
site isolation by design), we don't construct a RemoteMediaSessionManager for
this
WebPage. So currently, we only make a manager for the main frame's WebPage. And
RemoteMediaSessionManagerProxy is only ever talking to this one
RemoteMediaSessionManager.
The topDocument is being used only to send IPC messages to the WebPageProxy.
Since we
already route messages from WebPages to the WebPageProxy through the
RemotePageProxy,
we don't need the topDocument. So we amend the code so that:
1. The manager object is created when site isolation is enabled (it's currently
gated
on the shared process for site isolation being enabled, which is wrong.
2. No topDocument is needed. A manager is created for each WebPage.
3. RemoteMediaSessionManagerProxy::setCurrentSession() sends the message to the
correct web process.
4. RemoteMediaSessionManagerProxy follows the same model as other UI
processs-side
proxy objects that are per-WebPageProxy but may need to receive messages from
web processes besides the main frame's web process. So there is only one
RemoteMediaSessionManagerProxy, and we add
RemotePageMediaSessionManagerProxy,
which is per-RemotePageProxy and forwards messages to
RemoteMediaSessionManagerProxy.
Now that we are actually creating a RemoteMediaSessionManager per web page when
site
isolation is on, a number of layout tests are failing with site isolation on.
RemoteMediaSessionManager is currently "unstable" and not meant to be tested.
So this
is expected. We mark the tests as failing.
* Source/WebKit/Sources.txt:
* Source/WebKit/UIProcess/Media/RemoteMediaSessionClientProxy.cpp:
(WebKit::RemoteMediaSessionClientProxy::RemoteMediaSessionClientProxy):
* Source/WebKit/UIProcess/Media/RemoteMediaSessionManagerProxy.cpp:
(WebKit::RemoteMediaSessionManagerProxy::create):
(WebKit::RemoteMediaSessionManagerProxy::RemoteMediaSessionManagerProxy):
(WebKit::RemoteMediaSessionManagerProxy::~RemoteMediaSessionManagerProxy):
(WebKit::RemoteMediaSessionManagerProxy::setCurrentSession):
(WebKit::RemoteMediaSessionManagerProxy::messageSenderConnection const):
(WebKit::RemoteMediaSessionManagerProxy::messageSenderDestinationID const):
(WebKit::RemoteMediaSessionManagerProxy::sharedPreferencesForWebProcess const):
(WebKit::RemoteMediaSessionManagerProxy::addRemoteMediaSessionManager): Deleted.
(WebKit::RemoteMediaSessionManagerProxy::removeRemoteMediaSessionManager):
Deleted.
(WebKit::RemoteMediaSessionManagerProxy::forEachRemoteSessionManager): Deleted.
* Source/WebKit/UIProcess/Media/RemoteMediaSessionManagerProxy.h:
(WebKit::RemoteMediaSessionManagerProxy::process const):
(WebKit::RemoteMediaSessionManagerProxy::mainFrameProcess const): Deleted.
* Source/WebKit/UIProcess/Media/RemoteMediaSessionProxy.cpp:
(WebKit::RemoteMediaSessionProxy::RemoteMediaSessionProxy):
* Source/WebKit/UIProcess/RemotePageMediaSessionManagerProxy.cpp: Added.
(WebKit::RemotePageMediaSessionManagerProxy::create):
(WebKit::RemotePageMediaSessionManagerProxy::RemotePageMediaSessionManagerProxy):
(WebKit::RemotePageMediaSessionManagerProxy::~RemotePageMediaSessionManagerProxy):
(WebKit::RemotePageMediaSessionManagerProxy::didReceiveMessage):
* Source/WebKit/UIProcess/RemotePageMediaSessionManagerProxy.h: Added.
* Source/WebKit/UIProcess/RemotePageProxy.cpp:
(WebKit::RemotePageProxy::disconnect):
(WebKit::RemotePageProxy::injectPageIntoNewProcess):
* Source/WebKit/UIProcess/RemotePageProxy.h:
* Source/WebKit/UIProcess/UserMediaPermissionRequestProxy.cpp:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didAttachToRunningProcess):
(WebKit::WebPageProxy::resetState):
(WebKit::WebPageProxy::remoteMediaSessionManagerProxy):
(WebKit::WebPageProxy::addRemoteMediaSessionManager): Deleted.
(WebKit::WebPageProxy::removeRemoteMediaSessionManager): Deleted.
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.messages.in:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Source/WebKit/WebProcess/Media/RemoteMediaSessionManager.cpp:
(WebKit::RemoteMediaSessionManager::RemoteMediaSessionManager):
(WebKit::RemoteMediaSessionManager::~RemoteMediaSessionManager):
Canonical link: https://commits.webkit.org/314640@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications