Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fceeb850c1e2dc758581520cdce13e04c4f0ff25
      
https://github.com/WebKit/WebKit/commit/fceeb850c1e2dc758581520cdce13e04c4f0ff25
  Author: Basuke Suzuki <[email protected]>
  Date:   2026-05-11 (Mon, 11 May 2026)

  Changed paths:
    M Source/WebKit/UIProcess/BrowsingContextGroup.cpp
    M Source/WebKit/UIProcess/ProvisionalPageProxy.cpp
    M Source/WebKit/UIProcess/SuspendedPageProxy.cpp
    M Source/WebKit/UIProcess/SuspendedPageProxy.h
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebProcessPool.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.h
    M Source/WebKit/WebProcess/WebPage/WebPage.messages.in
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm

  Log Message:
  -----------
  [Site Isolation] Add multi-process BFCache restoration with Site Isolation
https://bugs.webkit.org/show_bug.cgi?id=313027
rdar://173743733

Reviewed by Sihui Liu.

Complete multi-process BFCache restoration: when navigating back to a BFCache'd 
page under Site
Isolation, restore cached iframe processes alongside the main frame.

Key changes:
- Split WebPage::setIsSuspendedWithFrameItem into WebPage::suspendWithFrameItem 
and
  WebPage::restoreWithFrameItem, backed by two distinct IPC messages
  (SuspendWithFrameItem / RestoreWithFrameItem). The new functions update
  m_isSuspended only after the underlying BackForwardCache operation succeeds,
  eliminating the transient-state window of the previous bool-flag design.
- In SuspendedPageProxy::unsuspend(mainFrameItemID), send RestoreWithFrameItem 
to
  each subframe process with aggregated failure handling that triggers a reload 
fallback.
- In WebProcessPool::processForNavigation, give a SuspendedPage explicit 
priority
  over site-based routing under Site Isolation by calling 
prepareProcessForNavigation
  directly when the target back/forward item has a suspended page.
- In receivedNavigationActionPolicyDecision, use the suspended page's 
BrowsingContextGroup for
  the new navigation so preserved subframe RemotePageProxies are reachable 
during restoration,
  and guard removeEntriesForPageAndProcess with frame->isMainFrame() so that 
cross-site iframe
  process swaps do not evict main-frame BFCache entries from the destination 
process.
- Make BrowsingContextGroup::addPage() idempotent when the page is already a 
member, guarded
  by ASSERT(!hasMultiplePages()) - the idempotent branch is only valid during 
suspended-BCG
  restoration, where the BCG holds exactly this one page. At suspension the BCG 
stays inert
  while held by SuspendedPageProxy, so m_pages can keep the entry through the 
suspend/restore
  cycle without a separate detach step.
- In WebPage::suspendForProcessSwap, guard against a null corePage and switch 
to the
  frame-item-keyed addIfCacheable signature.
- Strengthen MultiProcessBFCacheGoForward and 
MultiProcessBFCacheSameSiteNavAfterRestore with
  window-scoped markers that only survive when the page is restored from 
BFCache, not when it
  is reloaded from the network.

Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm

* Source/WebKit/UIProcess/BrowsingContextGroup.cpp:
(WebKit::BrowsingContextGroup::addPage):
* Source/WebKit/UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
* Source/WebKit/UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::startSuspension):
(WebKit::SuspendedPageProxy::unsuspend):
(WebKit::SuspendedPageProxy::suspendSubframeProcesses):
* Source/WebKit/UIProcess/SuspendedPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationActionPolicyDecision):
* Source/WebKit/UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigation):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::suspendForProcessSwap):
(WebKit::WebPage::suspendWithFrameItem):
(WebKit::WebPage::restoreWithFrameItem):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm:
(TestWebKitAPI::(SiteIsolation, MultiProcessBFCacheGoForwardSimple)):
(TestWebKitAPI::(SiteIsolation, MultiProcessBFCacheGoForward)):
(TestWebKitAPI::(SiteIsolation, MultiProcessBFCacheSameSiteNavAfterRestore)):

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



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

Reply via email to