Bug 259219 - Don't drop the GPUProcess media assertion too promptly after playback ends
Summary: Don't drop the GPUProcess media assertion too promptly after playback ends
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-07-14 10:20 PDT by Chris Dumez
Modified: 2023-07-14 12:41 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2023-07-14 10:20:12 PDT
Don't drop the GPUProcess media assertion too promptly after playback ends, instead, drop it on a timer.

There is a race where both the GPUProcess and the UIProcess get notified of a WebProcess exiting in parallel. When notified, the UIProcess would drop the media assertion on the GPUProcess, which could get it to suspend while the GPUProcess is STILL shutting down the media stack.

Dropping the media assertion on a timer makes it so that the GPUProcess is now extremely unlikely to lose the race and will have properly shut down the media stack by the time it gets suspended.
Comment 1 Chris Dumez 2023-07-14 10:20:22 PDT
<rdar://112003621>
Comment 2 Chris Dumez 2023-07-14 10:22:10 PDT
Pull request: https://github.com/WebKit/WebKit/pull/15842
Comment 3 EWS 2023-07-14 12:41:31 PDT
Committed 266069@main (e89c9b432a4e): <https://commits.webkit.org/266069@main>

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