Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Begin implementing back/forward cache for site isolation #21092

Conversation

achristensen07
Copy link
Contributor

@achristensen07 achristensen07 commented Nov 30, 2023

00dcbd8

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

b4b3d1e

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug   πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ§ͺ api-wpe
  πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1 βœ… πŸ›  gtk
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ§ͺ gtk-wk2
  πŸ›  tv βœ… πŸ§ͺ mac-AS-debug-wk2 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv-sim
βœ… πŸ›  watch
βœ… πŸ›  πŸ§ͺ unsafe-merge   πŸ›  watch-sim

@achristensen07 achristensen07 self-assigned this Nov 30, 2023
@achristensen07 achristensen07 added the WebKit Process Model Bugs related to WebKit's multi-process architecture label Nov 30, 2023
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Nov 30, 2023
@achristensen07 achristensen07 removed the merging-blocked Applied to prevent a change from being merged label Dec 5, 2023
@achristensen07 achristensen07 force-pushed the eng/Begin-implementing-backforward-cache-for-site-isolation branch from ab75d5c to 4bdab2f Compare December 5, 2023 23:15
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Dec 5, 2023
@achristensen07 achristensen07 removed the merging-blocked Applied to prevent a change from being merged label Dec 6, 2023
@achristensen07 achristensen07 force-pushed the eng/Begin-implementing-backforward-cache-for-site-isolation branch from 4bdab2f to 031e044 Compare December 6, 2023 00:16
@achristensen07 achristensen07 force-pushed the eng/Begin-implementing-backforward-cache-for-site-isolation branch from 031e044 to 4152719 Compare December 6, 2023 00:21
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Dec 6, 2023
@achristensen07 achristensen07 removed the merging-blocked Applied to prevent a change from being merged label Dec 6, 2023
@achristensen07 achristensen07 force-pushed the eng/Begin-implementing-backforward-cache-for-site-isolation branch from 4152719 to b4b3d1e Compare December 6, 2023 01:22
@achristensen07 achristensen07 added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Dec 6, 2023
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
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Begin-implementing-backforward-cache-for-site-isolation branch from b4b3d1e to 00dcbd8 Compare December 6, 2023 04:07
@webkit-commit-queue
Copy link
Collaborator

Committed 271590@main (00dcbd8): https://commits.webkit.org/271590@main

Reviewed commits have been landed. Closing PR #21092 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 00dcbd8 into WebKit:main Dec 6, 2023
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebKit Process Model Bugs related to WebKit's multi-process architecture
Projects
None yet
5 participants