-
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.
[Site Isolation] Handle more cases of provisional navigations cancell…
…ing other provisional navigations https://bugs.webkit.org/show_bug.cgi?id=274179 rdar://128083411 Reviewed by Sihui Liu. In order to get more tests to work correctly, a few changes were needed: 1. The accounting for whether a frame identifier is a root frame identifier needed to be more robust for the assertion to be correct near the time when a root frame was transitioning to or from being local. I introduced the debug-only class FrameLifetimeVerifier for this. Instead of keeping track of just the most recently created Frame with a given identifier, keep track of both the most recently created LocalFrame and the most recently created RemoteFrame. Then we can strengthen our assertions to make sure that Frame existence is exactly as we expect: there should only be one except during the time of transitioning from one type to the other. 2. If Frame::detachFromPage is ever called before destruction of a Frame, then we would be unable to inform the Page of the destruction of a root frame. To make this work, move that informing to Frame::detachFromPage and have the root frame collections contain all the root frames that are attached to a Page instead of all the root frames that haven't been destroyed. 3. WebFrameProxy::prepareForProvisionalLoadInProcess was missing a case when there is a ProvisionalFrameProxy but it's from a provisional navigation to a different process that we are now cancelling. In that case, we do need to make a new ProvisionalFrameProxy representing the navigation to the new process. 4. WebFrame::loadDidCommitInAnotherProcess was missing a call to FrameLoader::detachFromParent which is needed to drop all strong references to the LocalFrame so it can be destroyed so we don't have multiple LocalFrames in the same process with the same identifier. I also updated checkFrameTreesInProcesses to copy the expected results so they print out correctly if they don't match the actual results in a place in the frame tree that is not the beginning. * Source/WebCore/page/Frame.cpp: (WebCore::FrameLifetimeVerifier::singleton): (WebCore::FrameLifetimeVerifier::frameCreated): (WebCore::FrameLifetimeVerifier::frameDestroyed): (WebCore::FrameLifetimeVerifier::isRootFrameIdentifier): (WebCore::Frame::Frame): (WebCore::Frame::~Frame): (WebCore::Frame::detachFromPage): (WebCore::Frame::isRootFrameIdentifier): (WebCore::allFrames): Deleted. * Source/WebCore/page/Frame.h: * Source/WebCore/page/LocalFrame.cpp: (WebCore::LocalFrame::~LocalFrame): * Source/WebKit/UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::prepareForProvisionalLoadInProcess): * Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::addRootFrame): * Source/WebKit/WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::loadDidCommitInAnotherProcess): * Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm: (TestWebKitAPI::checkFrameTreesInProcesses): (TestWebKitAPI::TEST(SiteIsolation, CancelProvisionalLoad)): Canonical link: https://commits.webkit.org/278823@main
- Loading branch information
1 parent
0db49f6
commit 84d2d48
Showing
8 changed files
with
113 additions
and
40 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