-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't wait 8 minutes to suspend background tabs on iOS
https://bugs.webkit.org/show_bug.cgi?id=265064 rdar://118578232 Reviewed by Chris Dumez. Disable the NearSuspended state, which allows background WebContent processes to suspend immediately rather than after 8 minutes. To do this, we need to fix the heuristic in `prepareToDropLastAssertion`, which fires just before a process task_suspends. Previously it was generally called after a process ended up in the process cache. Now that we are calling it earlier, we want it to prevent clearing out the caches from processes that might end up in the process cache in the future, so we have to consult `canBeAddedToWebProcessCache` about that. Another change is that the `SetIsInProcessCache` message might be sent while the process is task_suspended. To fix this, change that message to one with an async reply handler so that it takes out a background activity while the IPC is being handled. Finally, the `WebProcess::releaseMemory` IPC handler was often causing the process to completely exit, since it invokes the memory pressure handler, and the memory pressure handler exits if there are no active pages in the process. This seems undesired (if the UIProcess really wanted to terminate the WebProcess, it could just send the `AuxiliaryProcess::ShutDown` message). So we now suppress the memory pressure handler called by `WebProcess::releaseMemory` from exiting the process. * Source/WebKit/UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::setIsInProcessCache): (WebKit::WebProcessProxy::prepareToDropLastAssertion): * Source/WebKit/WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): (WebKit::WebProcess::setIsInProcessCache): (WebKit::WebProcess::releaseMemory): (WebKit::WebProcess::prepareToSuspend): * Source/WebKit/WebProcess/WebProcess.h: * Source/WebKit/WebProcess/WebProcess.messages.in: Canonical link: https://commits.webkit.org/272937@main
- Loading branch information
Showing
8 changed files
with
42 additions
and
17 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