Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b8e586fe8c3068f916f90de3e2ccd5e305af81fe
      
https://github.com/WebKit/WebKit/commit/b8e586fe8c3068f916f90de3e2ccd5e305af81fe
  Author: Sihui Liu <[email protected]>
  Date:   2026-09-03 (Thu, 03 Sep 2026)

  Changed paths:
    M Source/WebKit/UIProcess/BrowsingContextGroup.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm

  Log Message:
  -----------
  [Site Isolation] New pages added to BrowsingContextGroup are not registered 
with shared process
https://bugs.webkit.org/show_bug.cgi?id=323149
rdar://186407140

Reviewed by Per Arne Vollan.

When SiteIsolationSharedProcessEnabled is on, BrowsingContextGroup::addPage() 
only creates RemotePageProxys for pages
joining per-site FrameProcesses in m_processMap, not for m_sharedProcess. A 
page that joins a group which already has a
shared process (e.g. a same-site window.open() popup) never gets registered 
there, so a later WebPage::LoadRequest to a
site already hosted in the shared process targets a PageIdentifier with no 
registered receiver, and
WebProcess::filterUnhandledMessage() silently drops it, hanging the page. Fixed 
addPage() to create a RemotePageProxy in
the shared process when a page joins.

Also, since RemotePageDrawingAreaProxy keys its message receiver by (page, 
process) rather than by site, only one
RemotePageProxy can be created per (page, process); the existing code loops 
over every m_sharedProcessSites entry per
page and creates duplicates, which would lead to crashes in 
MessageReceiverMap::addMessageReceiver. Fixed this by
ensuring to create one RemotePageProxy per (page, process). For RemotePageProxy 
in shared process, we use an arbitrary
site as a placeholder since RemotePageProxy::site() is meaningless under shared 
process mode (as multiple sites will be
put in the same process and share the same remote page).

This patch also consolidated the pre-existing "this process is the main frame 
process so don't need a remote page" check
into createRemotePageIfNeeded() functions, so new call sites won't omit the 
check by mistake.

Tests: SiteIsolation.OpenerProcessSharing
       SiteIsolation.OpenerProcessSharingWithSharedProcess
       Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm

* Source/WebKit/UIProcess/BrowsingContextGroup.cpp:
(WebKit::BrowsingContextGroup::addPage):
(WebKit::BrowsingContextGroup::addFrameProcessAndInjectPageContextIf):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm:
(TestWebKitAPI::TEST(SiteIsolation, OpenerProcessSharing)):
(TestWebKitAPI::TEST(SiteIsolation, OpenerProcessSharingWithSharedProcess)):

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



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

Reply via email to