[webkit-changes] [WebKit/WebKit] 7cd42a: Regression: Pages that update their title now get ...

Chris Dumez noreply at github.com
Wed Mar 20 14:09:55 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7cd42ac1d51cd7b8c245caf7e61f58173017d7f1
      https://github.com/WebKit/WebKit/commit/7cd42ac1d51cd7b8c245caf7e61f58173017d7f1
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2024-03-20 (Wed, 20 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
    M Source/WebKit/UIProcess/WebProcessProxy.cpp

  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::hasAllowedToRunInTheBackgroundActivity const):
(WebKit::WebPageProxy::didReceiveTitleForFrame):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
* Source/WebKit/UIProcess/WebPageProxyInternals.h:
* Source/WebKit/UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::canBeAddedToWebProcessCache const):

Canonical link: https://commits.webkit.org/276418@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