-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement provisional load failure handling with site isolation
https://bugs.webkit.org/show_bug.cgi?id=260643 rdar://114360180 Reviewed by Chris Dumez. When a provisional load fails, we need to send WebPage::DidFinishLoadInAnotherProcess to the parent's process to tell the parent that one of its children is no longer loading, so it shouldn't delay its load event any more. I took RemoteFrame::didFinishLoadInAnotherProcess and made it a pure virtual function on Frame. If the Frame is a RemoteFrame, then behavior is unchanged. If the Frame is a LocalFrame and it receives a didFinishLoadInAnotherProcess call, that means the load failed before it was committed. I update the state indicating that the parent's load event should be delayed, then tell the parent to check if its load is complete. To have the frame tree clean up correctly, I needed to move ownership of the RemotePageProxy from the WebFrameProxy to the ProvisionalFrameProxy until the frame navigation is committed, at which point ownership is transferred to the WebFrameProxy and the ProvisionalFrameProxy is destroyed. This moves the RemotePageProxy::create call downstream a bit to WebFrameProxy::prepareForProvisionalNavigationInProcess which makes more sense anyways. The WebPageProxy::didFailProvisionalLoadForFrame was redundantly sending the FrameIdentifier as its own parameter and as part of the FrameInfoData. I removed the first one in favor of the second. The DidCreateNewProcess enum was unused. I removed it. Reusing a process when hasCommittedAnyProvisionalLoads returns false proved problematic. It is likely possible, but it's an optimization at this point. I disabled it to make the process to domain mapping constant with site isolation. * Source/WebCore/loader/FrameLoader.cpp: (WebCore::FrameLoader::provisionalLoadFailedInAnotherProcess): (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): * Source/WebCore/loader/FrameLoader.h: * Source/WebCore/page/Frame.h: * Source/WebCore/page/LocalFrame.cpp: (WebCore::LocalFrame::didFinishLoadInAnotherProcess): * Source/WebCore/page/LocalFrame.h: * Source/WebCore/page/RemoteFrame.cpp: (WebCore::RemoteFrame::didFinishLoadInAnotherProcess): * Source/WebCore/page/RemoteFrame.h: * Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp: (WebKit::ProvisionalFrameProxy::ProvisionalFrameProxy): (WebKit::ProvisionalFrameProxy::takeRemotePageProxy): * Source/WebKit/UIProcess/ProvisionalFrameProxy.h: * Source/WebKit/UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::cancel): (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame): * Source/WebKit/UIProcess/ProvisionalPageProxy.h: * Source/WebKit/UIProcess/RemotePageProxy.cpp: (WebKit::RemotePageProxy::didReceiveMessage): (WebKit::RemotePageProxy::didFailProvisionalLoadForFrame): * Source/WebKit/UIProcess/RemotePageProxy.h: * Source/WebKit/UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::takeProvisionalFrame): (WebKit::WebFrameProxy::didFailLoad): (WebKit::WebFrameProxy::prepareForProvisionalNavigationInProcess): (WebKit::WebFrameProxy::commitProvisionalFrame): (WebKit::WebFrameProxy::setRemotePageProxy): Deleted. * Source/WebKit/UIProcess/WebFrameProxy.h: * Source/WebKit/UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedNavigationPolicyDecision): (WebKit::WebPageProxy::didFailProvisionalLoadForFrame): (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared): * Source/WebKit/UIProcess/WebPageProxy.h: * Source/WebKit/UIProcess/WebPageProxy.messages.in: * Source/WebKit/UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigation): (WebKit::WebProcessPool::processForNavigationInternal): * Source/WebKit/UIProcess/WebProcessPool.h: * Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp: (WebKit::WebLocalFrameLoaderClient::dispatchDidFailProvisionalLoad): * Source/WebKit/WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::didFinishLoadInAnotherProcess): * Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/267264@main
- Loading branch information
1 parent
002b1d2
commit 77752e9
Showing
23 changed files
with
136 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.