Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e97a07211a6228a960e13def9c2b789a07010066
https://github.com/WebKit/WebKit/commit/e97a07211a6228a960e13def9c2b789a07010066
Author: Basuke Suzuki <[email protected]>
Date: 2026-05-26 (Tue, 26 May 2026)
Changed paths:
M Source/WebCore/loader/FrameLoader.cpp
M Source/WebCore/loader/FrameLoader.h
M Source/WebCore/loader/FrameLoaderTypes.h
M Source/WebCore/loader/HistoryController.cpp
M Source/WebCore/loader/HistoryController.h
M Source/WebCore/page/Page.cpp
M Source/WebCore/page/Page.h
M Source/WebKit/Scripts/webkit/messages.py
M Source/WebKit/Shared/GoToBackForwardItemParameters.h
M Source/WebKit/Shared/GoToBackForwardItemParameters.serialization.in
M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
M Source/WebKit/UIProcess/ProvisionalPageProxy.cpp
M Source/WebKit/UIProcess/ProvisionalPageProxy.h
M Source/WebKit/UIProcess/WebFrameProxy.cpp
M Source/WebKit/UIProcess/WebFrameProxy.h
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/UIProcess/WebPageProxy.h
M Source/WebKit/UIProcess/WebPageProxy.messages.in
M Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp
M Source/WebKit/WebProcess/WebPage/WebPage.cpp
Log Message:
-----------
[BFCache] Plumb ShouldRestoreFromBackForwardCache and
RestoredFromBackForwardCache signals as preparation
https://bugs.webkit.org/show_bug.cgi?id=315606
rdar://177985347
Reviewed by Alex Christensen.
Preparation for UIP-driven BFCache restore (bug 313657). No behavior change.
Adds a ShouldRestoreFromBackForwardCache enum and threads it as a parameter
from Page::goToItem through HistoryController and FrameLoader down to
continueLoadAfterNavigationPolicy, so the UIProcess can later direct the
WebProcess to perform a BFCache restore even when the WebProcess-side cache
probe is racing. All current callers pass ShouldRestoreFromBackForwardCache::No;
continueLoadAfterNavigationPolicy does not consult the new argument yet. Default
value `ShouldRestoreFromBackForwardCache::No` is provided on every method in the
chain so non-BFCache callers (URL loads, reloads, redirects) are not touched.
BFCache-relevant call sites still pass explicit values to thread the actual
state.
Also adds a RestoredFromBackForwardCache enum (paired with the directive
ShouldRestoreFromBackForwardCache; past tense lives in the type name) to
Messages::WebPageProxy::DidCommitLoadForFrame, sourced in the WebProcess from
the existing FrameLoader::loadingFromCachedPage() (newly exposed as a public
accessor). The UIProcess receiver carries the value through commit dispatchers
but does not act on it yet. No default is provided on this signature because
all callers are BFCache-aware IPC dispatchers that set the value explicitly.
GoToBackForwardItemParameters gains a shouldRestoreFromBackForwardCache field
(typed as the new enum). All construction sites set it to ::No, matching
origin/main behavior.
* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadWithNavigationAction):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::reloadWithOverrideEncoding):
(WebCore::FrameLoader::reload):
(WebCore::FrameLoader::loadPostRequest):
(WebCore::FrameLoader::loadURLIntoChildFrame):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
(WebCore::FrameLoader::loadDifferentDocumentItem):
(WebCore::FrameLoader::loadItem):
(WebCore::FrameLoader::loadRequestedHistoryItem):
(WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
* Source/WebCore/loader/FrameLoader.h:
(WebCore::FrameLoader::loadingFromCachedPage const):
* Source/WebCore/loader/FrameLoaderTypes.h:
* Source/WebCore/loader/HistoryController.cpp:
(WebCore::HistoryController::goToItem):
(WebCore::HistoryController::goToItemForNavigationAPI):
(WebCore::HistoryController::setDefersLoading):
(WebCore::HistoryController::recursiveGoToItem):
* Source/WebCore/loader/HistoryController.h:
* Source/WebCore/page/Page.cpp:
(WebCore::Page::goToItem):
* Source/WebCore/page/Page.h:
* Source/WebKit/Shared/GoToBackForwardItemParameters.h:
* Source/WebKit/Shared/GoToBackForwardItemParameters.serialization.in:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::goToBackForwardItem):
(WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
* Source/WebKit/UIProcess/ProvisionalPageProxy.h:
* Source/WebKit/UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::commitProvisionalFrame):
* Source/WebKit/UIProcess/WebFrameProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::launchProcessForReload):
(WebKit::WebPageProxy::goToBackForwardItem):
(WebKit::WebPageProxy::commitProvisionalPage):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
(WebKit::WebPageProxy::didCommitLoadForFrame):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.messages.in:
* Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp:
(WebKit::WebLocalFrameLoaderClient::dispatchDidCommitLoad):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::goToBackForwardItem):
Canonical link: https://commits.webkit.org/313940@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications