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

Prepare Frame constructor to have RemoteFrame as the main frame in a site-isolated iframe process #11067

Conversation

achristensen07
Copy link
Contributor

@achristensen07 achristensen07 commented Mar 4, 2023

a8f0d81

Prepare Frame constructor to have RemoteFrame as the main frame in a site-isolated iframe process
https://bugs.webkit.org/show_bug.cgi?id=253389

Reviewed by Chris Dumez.

There are two distinct types of Frames: one with an owner (subframe) and one without an owner (main frame).
We are about to need another type: a Frame with a parent in another process.  We will know about its parent
because we will have an AbstractFrame, but we won't have a HTMLFrameOwnerElement because it is in another process.
Frame::createSubframeHostedInAnotherProcess is introduced and soon to be used for this purpose.

Symmetrically, there needs to be three ways to construct a RemoteFrame: createMainFrame and createSubframe
just like the corresponding Frame constructors, but we will also need createSubframeWithContentsInAnotherProcess
to represent such a RemoteFrame in the process that has the HTMLFrameOwnerElement.

I also clean up the construction sites a little to pass non-null Pages and other parameters to where the should be.

* Source/WebCore/page/AbstractFrame.cpp:
(WebCore::AbstractFrame::AbstractFrame):
(WebCore::parentFrame): Deleted.
* Source/WebCore/page/AbstractFrame.h:
* Source/WebCore/page/Frame.cpp:
(WebCore::Frame::Frame):
(WebCore::Frame::createMainFrame):
(WebCore::Frame::createSubframe):
(WebCore::Frame::createSubframeHostedInAnotherProcess):
(WebCore::Frame::create): Deleted.
* Source/WebCore/page/Frame.h:
* Source/WebCore/page/Page.cpp:
(WebCore::Page::Page):
* Source/WebCore/page/RemoteFrame.cpp:
(WebCore::RemoteFrame::createMainFrame):
(WebCore::RemoteFrame::createSubframe):
(WebCore::RemoteFrame::createSubframeWithContentsInAnotherProcess):
(WebCore::RemoteFrame::RemoteFrame):
* Source/WebCore/page/RemoteFrame.h:
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
* Source/WebKit/WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::createSubframe):
(WebKit::WebFrame::didCommitLoadInAnotherProcess):
* Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::createFrame):
* Source/WebKitLegacy/mac/WebView/WebFrame.mm:
(+[WebFrame _createFrameWithPage:frameName:frameView:ownerElement:]):
(+[WebFrame _createSubframeWithOwnerElement:page:frameName:frameView:]):
(+[WebFrame _createSubframeWithOwnerElement:frameName:frameView:]): Deleted.
* Source/WebKitLegacy/mac/WebView/WebFrameInternal.h:

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

75caec7

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 βœ… πŸ›  gtk
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk1 βœ… πŸ§ͺ gtk-wk2
βœ… πŸ›  tv βœ… πŸ§ͺ mac-wk2 ❌ πŸ§ͺ api-gtk
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  watch   πŸ§ͺ mac-wk2-stress
βœ… πŸ›  watch-sim
βœ… πŸ›  πŸ§ͺ unsafe-merge

@achristensen07 achristensen07 self-assigned this Mar 4, 2023
@achristensen07 achristensen07 added the WebKit Process Model Bugs related to WebKit's multi-process architecture label Mar 4, 2023
@achristensen07 achristensen07 added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Mar 6, 2023
…site-isolated iframe process

https://bugs.webkit.org/show_bug.cgi?id=253389

Reviewed by Chris Dumez.

There are two distinct types of Frames: one with an owner (subframe) and one without an owner (main frame).
We are about to need another type: a Frame with a parent in another process.  We will know about its parent
because we will have an AbstractFrame, but we won't have a HTMLFrameOwnerElement because it is in another process.
Frame::createSubframeHostedInAnotherProcess is introduced and soon to be used for this purpose.

Symmetrically, there needs to be three ways to construct a RemoteFrame: createMainFrame and createSubframe
just like the corresponding Frame constructors, but we will also need createSubframeWithContentsInAnotherProcess
to represent such a RemoteFrame in the process that has the HTMLFrameOwnerElement.

I also clean up the construction sites a little to pass non-null Pages and other parameters to where the should be.

* Source/WebCore/page/AbstractFrame.cpp:
(WebCore::AbstractFrame::AbstractFrame):
(WebCore::parentFrame): Deleted.
* Source/WebCore/page/AbstractFrame.h:
* Source/WebCore/page/Frame.cpp:
(WebCore::Frame::Frame):
(WebCore::Frame::createMainFrame):
(WebCore::Frame::createSubframe):
(WebCore::Frame::createSubframeHostedInAnotherProcess):
(WebCore::Frame::create): Deleted.
* Source/WebCore/page/Frame.h:
* Source/WebCore/page/Page.cpp:
(WebCore::Page::Page):
* Source/WebCore/page/RemoteFrame.cpp:
(WebCore::RemoteFrame::createMainFrame):
(WebCore::RemoteFrame::createSubframe):
(WebCore::RemoteFrame::createSubframeWithContentsInAnotherProcess):
(WebCore::RemoteFrame::RemoteFrame):
* Source/WebCore/page/RemoteFrame.h:
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
* Source/WebKit/WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::createSubframe):
(WebKit::WebFrame::didCommitLoadInAnotherProcess):
* Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::createFrame):
* Source/WebKitLegacy/mac/WebView/WebFrame.mm:
(+[WebFrame _createFrameWithPage:frameName:frameView:ownerElement:]):
(+[WebFrame _createSubframeWithOwnerElement:page:frameName:frameView:]):
(+[WebFrame _createSubframeWithOwnerElement:frameName:frameView:]): Deleted.
* Source/WebKitLegacy/mac/WebView/WebFrameInternal.h:

Canonical link: https://commits.webkit.org/261270@main
@webkit-early-warning-system webkit-early-warning-system force-pushed the eng/Prepare-Frame-constructor-to-have-RemoteFrame-as-the-main-frame-in-a-site-isolated-iframe-process branch from 75caec7 to a8f0d81 Compare March 6, 2023 16:16
@webkit-commit-queue
Copy link
Collaborator

Committed 261270@main (a8f0d81): https://commits.webkit.org/261270@main

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

@webkit-early-warning-system webkit-early-warning-system merged commit a8f0d81 into WebKit:main Mar 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 Mar 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
4 participants