Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2a667bb936d24418a4a6def1f0fb90f23ed00186
      
https://github.com/WebKit/WebKit/commit/2a667bb936d24418a4a6def1f0fb90f23ed00186
  Author: Ben Nham <[email protected]>
  Date:   2026-06-26 (Fri, 26 Jun 2026)

  Changed paths:
    M Source/WebKit/Platform/spi/ios/RunningBoardServicesSPI.h
    M Source/WebKit/UIProcess/ios/ProcessStateMonitor.h
    M Source/WebKit/UIProcess/ios/ProcessStateMonitor.mm

  Log Message:
  -----------
  Only use ProcessStateMonitor on processes that are managed by RunningBoard
https://bugs.webkit.org/show_bug.cgi?id=317905
rdar://180159037

Reviewed by Per Arne Vollan.

There are some daemons that use WebKit to load webpages, but which are not 
managed by
RunningBoard. This doesn't work with ProcessStateMonitor, which we install once 
processes are in the
background (which is basically all the time in daemons).

In particular, a process that is not managed by
RunningBoard may still get RunningBoard state
updates. This causes `ProcessStateMonitor::checkRemainingRunTime()` to run. Then
`checkRemainingRunTime()` asks RunningBoard how much time the process has to 
run before it suspends
via `[[[RBSProcessHandle currentProcess] activeLimitations] runTime]`. For an 
unmanaged process,
this may return 0.

This then makes us think that the process is about to suspend immediately, 
which causes us to
invalidate all of the activities tracked by the process, which then causes all 
WebKit auxiliary
processes to suspend.

In this patch, we disable ProcessStateMonitor for one of the problematic 
daemons specifically
(textunderstandingd). This will be followed up by a patch that disables 
creation of the object for
any process that is unmanaged (the only reason we're not doing that in this 
patch is to mitigate
risk).

This works because The only client of `ProcessStateMonitor::create` already 
understands how to deal
with a null return
value.

* Source/WebKit/Platform/spi/ios/RunningBoardServicesSPI.h:
* Source/WebKit/UIProcess/ios/ProcessStateMonitor.h:
(WebKit::ProcessStateMonitor::create): Deleted.
* Source/WebKit/UIProcess/ios/ProcessStateMonitor.mm:
(WebKit::ProcessStateMonitor::create):

Canonical link: 
https://flagged.apple.com:443/proxy?t2=Dg6F3P4sf8&o=aHR0cHM6Ly9jb21taXRzLndlYmtpdC5vcmcvMzE1OTAyQG1haW4=&emid=13349392-af8d-4579-b640-f087bbe5ae55&c=11



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to