[webkit-changes] [WebKit/WebKit] 00dcbd: Begin implementing back/forward cache for site iso...

Alex Christensen noreply at github.com
Tue Dec 5 20:07:59 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 00dcbd8c70b8cb1baa57c6ba0ccdd5a15819887f
      https://github.com/WebKit/WebKit/commit/00dcbd8c70b8cb1baa57c6ba0ccdd5a15819887f
  Author: Alex Christensen <achristensen at apple.com>
  Date:   2023-12-05 (Tue, 05 Dec 2023)

  Changed paths:
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/history/CachedFrame.cpp
    M Source/WebCore/history/CachedFrame.h
    M Source/WebCore/history/CachedPage.cpp
    M Source/WebCore/loader/FrameLoader.cpp
    M Source/WebCore/loader/FrameLoader.h
    M Source/WebCore/loader/HistoryController.cpp
    M Source/WebCore/loader/HistoryController.h
    M Source/WebKit/UIProcess/ProvisionalPageProxy.cpp
    M Source/WebKit/UIProcess/ProvisionalPageProxy.h
    M Source/WebKit/UIProcess/RemotePageProxy.cpp
    M Source/WebKit/UIProcess/RemotePageProxy.h
    A Source/WebKit/UIProcess/RemotePageProxyState.h
    M Source/WebKit/UIProcess/SuspendedPageProxy.cpp
    M Source/WebKit/UIProcess/SuspendedPageProxy.h
    M Source/WebKit/UIProcess/WebFrameProxy.cpp
    M Source/WebKit/UIProcess/WebFrameProxy.h
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxyInternals.h
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm

  Log Message:
  -----------
  Begin implementing back/forward cache for site isolation
https://bugs.webkit.org/show_bug.cgi?id=265561
rdar://118965412

Reviewed by Pascoe.

My approach before was to terminate the iframe processes when we navigate away,
which seems to match other browsers but doesn't match our existing behavior of
being able to quickly navigate back to a fully functional page.  We need to keep
the processes alive and make CachedFrame able to handle RemoteFrames in order to
keep that speed.  If we get a memory pressure warning, we will remove back/forward
cache entries, but if we have the memory let's keep the existing behavior.

This is the first of at least two PRs to get back/forward navigation working with
site isolation.  I make CachedFrame able to handle RemoteFrames, I made
HistoryController a non-nested class to be able to be owned by RemoteFrames (but
I didn't change that ownership yet), and I swap RemotePageProxy state to a
SuspendedPageProxy when suspending.

* Source/WebCore/dom/Document.cpp:
(WebCore::Document::attachToCachedFrame):
* Source/WebCore/history/CachedFrame.cpp:
(WebCore::CachedFrameBase::CachedFrameBase):
(WebCore::CachedFrameBase::restore):
(WebCore::CachedFrame::CachedFrame):
(WebCore::CachedFrame::open):
(WebCore::CachedFrame::destroy):
* Source/WebCore/history/CachedFrame.h:
(WebCore::CachedFrameBase::view const):
* Source/WebCore/history/CachedPage.cpp:
(WebCore::CachedPage::CachedPage):
(WebCore::firePageShowEvent):
(WebCore::CachedPage::restore):
* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::open):
* Source/WebKit/UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::SuspendedPageProxy):
* Source/WebKit/UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::removeRemotePagesForSuspension): Deleted.
* Source/WebKit/UIProcess/WebFrameProxy.h:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm:
(TestWebKitAPI::TEST):

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




More information about the webkit-changes mailing list