Bug 252415

Summary: [Cocoa] Prevent active background page processes from suspending
Product: WebKit Reporter: Miguel Salinas <miguel_salinas>
Component: WebKit Process ModelAssignee: Miguel Salinas <miguel_salinas>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Mac (Apple Silicon)   
OS: macOS 13   

Description Miguel Salinas 2023-02-16 12:11:06 PST
When a page is backgrounded we try to suspend its process if possible. When the internal setting "Take WebKit:Suspended assertion..." is disabled, this will cause the UI process to drop all of its process assertions on the web content process, effectively making it un-schedulable. This means that pages which may still be active will completely stop. This wasn't an issue before since the web content process would still be schedulable because it was holding the WebKit:Suspended assertion (this is very confusing since the WebKit:Suspended process assertion actually _prevents_ suspension). Instead of dropping all process assertions immediately upon being backgrounded, we should give the page/process some time to be scheduled and if it performs any observable work (e.g. changing document title text, sending a local notification, etc.) we should extend this time to be scheduled.
Comment 1 Miguel Salinas 2023-02-16 12:14:00 PST
rdar://105413250
Comment 2 Miguel Salinas 2023-02-16 14:37:15 PST
Pull request: https://github.com/WebKit/WebKit/pull/10228
Comment 3 EWS 2023-02-17 17:26:06 PST
Committed 260482@main (06fe365b1602): <https://commits.webkit.org/260482@main>

Reviewed commits have been landed. Closing PR #10228 and removing active labels.