-
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.
Terminate iframe processes when navigating away
https://bugs.webkit.org/show_bug.cgi?id=262056 rdar://116004705 Reviewed by Pascoe. While deciding what to do about all the processes that are currently being kept alive by the back/forward cache with site isolation on, I investigated and found that Chrome and Firefox both terminate iframe processes immediately after navigating away from a page. This can be seen by going to a site with many third-party iframes then opening example.com To accomplish this in WebKit, instead of keeping the domain-to-remote-page map on the SuspendedPageProxy, we remove all RemotePageProxy objects from all frames going into the back/forward cache when a SuspendedPageProxy is created. To get the process to actually terminate, I needed to change the WebProcessProxy's conditions for not shutting down from watching its ProvisionalFrameProxy and WebFrameProxy-with-remote-page count to just watching its RemotePageProxy count. This simplifies things, makes them easier to keep track of, and reflects the progression of how site isolation has developed: we started by having frames manage process lifetimes more and progressed to having the RemotePageProxy be in charge. * Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp: (WebKit::ProvisionalFrameProxy::ProvisionalFrameProxy): (WebKit::ProvisionalFrameProxy::~ProvisionalFrameProxy): Deleted. * Source/WebKit/UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::ProvisionalPageProxy): (WebKit::ProvisionalPageProxy::takeRemotePageMap): Deleted. * Source/WebKit/UIProcess/ProvisionalPageProxy.h: (WebKit::ProvisionalPageProxy::provisionalURL const): * Source/WebKit/UIProcess/RemotePageProxy.cpp: (WebKit::RemotePageProxy::RemotePageProxy): (WebKit::RemotePageProxy::~RemotePageProxy): * Source/WebKit/UIProcess/SuspendedPageProxy.cpp: (WebKit::SuspendedPageProxy::SuspendedPageProxy): (WebKit::SuspendedPageProxy::takeRemotePageMap): Deleted. * Source/WebKit/UIProcess/SuspendedPageProxy.h: * Source/WebKit/UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::commitProvisionalFrame): (WebKit::WebFrameProxy::removeRemotePagesForSuspension): * Source/WebKit/UIProcess/WebFrameProxy.h: * Source/WebKit/UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::swapToProvisionalPage): (WebKit::WebPageProxy::takeRemotePageMap): Deleted. * Source/WebKit/UIProcess/WebPageProxy.h: * Source/WebKit/UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::addRemotePageProxy): (WebKit::WebProcessProxy::removeRemotePageProxy): (WebKit::WebProcessProxy::canTerminateAuxiliaryProcess): (WebKit::WebProcessProxy::addProvisionalFrameProxy): Deleted. (WebKit::WebProcessProxy::removeProvisionalFrameProxy): Deleted. (WebKit::WebProcessProxy::provisionalFrameCommitted): Deleted. (WebKit::WebProcessProxy::removeFrameWithRemoteFrameProcess): Deleted. * Source/WebKit/UIProcess/WebProcessProxy.h: * Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm: (TestWebKitAPI::processStillRunning): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/268409@main
- Loading branch information
1 parent
d3f5298
commit b1554a5
Showing
13 changed files
with
69 additions
and
66 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