Bug 226529

Summary: HTMLMediaElement::virtualHasPendingActivity may keep objects alive unnecessarily
Product: WebKit Reporter: youenn fablet <youennf>
Component: AccessibilityAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: calvaris, cdumez, changseok, eric.carlson, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, hi, hta, jer.noble, philipj, sergio, tommyw, tsavell, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch ews-feeder: commit-queue-

Description youenn fablet 2021-06-02 01:26:24 PDT
HTMLMediaElement::virtualHasPendingActivity may keep objects alive unnecessarily
Comment 1 youenn fablet 2021-06-02 01:27:31 PDT
<rdar://78726921>
Comment 2 youenn fablet 2021-06-02 01:28:05 PDT
https://jsfiddle.net/cpx73bry/ is an example where we are keeping the object alive for no good reasons.
Comment 3 youenn fablet 2021-06-02 04:59:58 PDT
Created attachment 430336 [details]
Patch
Comment 4 youenn fablet 2021-06-02 05:58:29 PDT
Created attachment 430340 [details]
Patch
Comment 5 Chris Dumez 2021-06-02 07:34:27 PDT
Comment on attachment 430340 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=430340&action=review

> LayoutTests/fast/mediastream/mediaElement-gc.html:41
> +promise_test(async (test) => {

New test is flaky on EWS:
- PASS GC a video element once its srcObject gets ended
+ FAIL GC a video element once its srcObject gets ended assert_less_than: expected a number less than 100 but got 100
Comment 6 youenn fablet 2021-06-02 08:26:19 PDT
(In reply to Chris Dumez from comment #5)
> Comment on attachment 430340 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=430340&action=review
> 
> > LayoutTests/fast/mediastream/mediaElement-gc.html:41
> > +promise_test(async (test) => {
> 
> New test is flaky on EWS:
> - PASS GC a video element once its srcObject gets ended
> + FAIL GC a video element once its srcObject gets ended assert_less_than:
> expected a number less than 100 but got 100

Hum, not sure why it fails, let's start with the main bug.
The ended MediaStream case can be fixed as a follow-up.
Comment 7 youenn fablet 2021-06-02 08:27:37 PDT
Created attachment 430359 [details]
Patch
Comment 8 EWS 2021-06-02 09:44:24 PDT
Committed r278359 (238391@main): <https://commits.webkit.org/238391@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 430359 [details].
Comment 9 Truitt Savell 2021-06-14 15:05:18 PDT
It looks like the new test fast/mediastream/mediaElement-gc.html

added in https://trac.webkit.org/changeset/278359/webkit

has been a flaky failure on Mac sense introduction:
https://results.webkit.org/?suite=layout-tests&test=fast%2Fmediastream%2FmediaElement-gc.html

tracking in: https://bugs.webkit.org/show_bug.cgi?id=226991