← All issues

Site Isolation: multi-process BFCache restoration

fceeb85

Source/WebKit/UIProcess/SuspendedPageProxy.cpp

-void SuspendedPageProxy::unsuspend()
+void SuspendedPageProxy::unsuspend(WebCore::BackForwardFrameItemIdentifier mainFrameItemID)
{
sendWithAsyncReply(Messages::WebPage::SetIsSuspended(false), [](std::optional<bool> didSuspend) {
ASSERT(!didSuspend.has_value());
});
+ auto aggregator = MainRunLoopSuccessCallbackAggregator::create([weakPage = m_page](bool success) {
+ if (success) return;
+ RefPtr page = weakPage.get();
+ if (!page) return;
+ page->reload(WebCore::ReloadOption::ExpiredOnly);
+ });
+ m_browsingContextGroup->forEachRemotePage(*page, [...](auto& remotePage) {
// sends RestoreWithFrameItem to each subframe process
});

Source/WebKit/UIProcess/BrowsingContextGroup.cpp

void BrowsingContextGroup::addPage(WebPageProxy& page)
{
- ASSERT(!m_pages.contains(page));
+ if (m_pages.contains(page)) {
+ ASSERT(!hasMultiplePages());
+ return;
+ }
m_pages.add(page);

BFCache (Back-Forward Cache) preserves a full page snapshot in memory so back/forward navigation is instant. Under Site Isolation, cross-origin iframes run in separate WebContent processes, so a cached page can span N processes. SuspendedPageProxy is the UIProcess object that holds the suspended state; BrowsingContextGroup (BCG) tracks process-group membership and routes RemotePageProxy references. Previously restoration only handled the main-frame process. This commit splits the single SetIsSuspended IPC into separate SuspendWithFrameItem and RestoreWithFrameItem messages, fans RestoreWithFrameItem out to every subframe process via forEachRemotePage, and uses a MainRunLoopSuccessCallbackAggregator to trigger a full reload if any process fails to restore. The suspended page's BCG is reused for the new navigation so existing RemotePageProxy handles remain valid.

Restoration now coordinates suspend/resume across N WebContent processes simultaneously, expanding the multi-process boundary surface that has to remain consistent for cross-origin isolation to hold.

🔒

New multi-process coordination paths and routing changes — several edge cases in the restoration lifecycle are worth security investigation.

더 확인하려면 구독해 주세요