[webkit-changes] [WebKit/WebKit] 3130b4: Regression: Pages that update their title now get ...
Chris Dumez
noreply at github.com
Mon Mar 11 23:16:55 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3130b409ab451147e7df0c39c8a431e50547e7dd
https://github.com/WebKit/WebKit/commit/3130b409ab451147e7df0c39c8a431e50547e7dd
Author: Chris Dumez <cdumez at apple.com>
Date: 2024-03-11 (Mon, 11 Mar 2024)
Changed paths:
M Source/WebKit/UIProcess/ProcessThrottler.cpp
M Source/WebKit/UIProcess/ProcessThrottler.h
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/UIProcess/WebPageProxyInternals.h
Log Message:
-----------
Regression: Pages that update their title now get suspended when backgrounded
https://bugs.webkit.org/show_bug.cgi?id=270813
rdar://124222280
Reviewed by Ben Nham.
Pages that update their title now get suspended when backgrounded since we've
stopped taking near-suspended assertions on both iOS and macOS. We used to
monitor pages in the background for 8 minutes to see if they update their title
while in the background, if they did, we would let them keep running in the
background.
Since we no longer take near-suspended assertions, we can no longer observe
pages in the background (since they'd get suspended as soon as backgrounded).
To address the issue, we now monitor title changes while in the foreground. If
the page updates its title, we now take a background assertion to let it keep
running after backgrounding.
This is not perfect but this addresses the regression for now. We should
revisit though because this is too permissive. Maybe we only want to consider
title changes without recent user interaction for e.g.
* Source/WebKit/UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::ProcessThrottler):
(WebKit::ProcessThrottler::dropNearSuspendedAssertionTimerFired):
(WebKit::m_shouldTakeUIBackgroundAssertion): Deleted.
(WebKit::ProcessThrottler::pageAllowedToRunInTheBackgroundToken): Deleted.
(WebKit::ProcessThrottler::numberOfPagesAllowedToRunInTheBackgroundChanged): Deleted.
* Source/WebKit/UIProcess/ProcessThrottler.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::didFailLoadForFrame):
(WebKit::WebPageProxy::didReceiveTitleForFrame):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
* Source/WebKit/UIProcess/WebPageProxyInternals.h:
Canonical link: https://commits.webkit.org/275960@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list