Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(555)

Issue 439723003: Prevent GC of media elements that are delaying the load event (Closed)

Created:
6 years, 4 months ago by philipj_slow
Modified:
6 years, 4 months ago
CC:
blink-reviews, blink-reviews-html_chromium.org, gasubic, fs, eric.carlson_apple.com, feature-media-reviews_chromium.org, dglazkov+blink, nessy, vcarbune.chromium
Project:
blink
Visibility:
Public.

Description

Prevent GC of media elements that are delaying the load event The spec requires that "only once a media element is in a state where no further audio could ever be played by that element may the element be garbage collected." The delaying-the-load-event flag is true early during resource selection, typically until after the loadeddata event is fired. Preventing GC in this time frame means that the loadedmetadata and loadeddata events will be fired reliably. Note that it's still possible to write unreliable code e.g. by using preload=auto and calling play() in a canplaythrough event handler, but making that reliable requires loading potentially large amounts of data that may not ever be used. A spec bug for clarification was filed: https://www.w3.org/Bugs/Public/show_bug.cgi?id=26515 TEST=LayoutTests/media/gc-during-load.html TEST=LayoutTests/media/avtrack/addtrack.html (no longer flaky) BUG=397324

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -2 lines) Patch
A LayoutTests/media/gc-during-load.html View 1 chunk +12 lines, -0 lines 0 comments Download
A + LayoutTests/media/gc-during-load-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLMediaElement.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 5 (0 generated)
philipj_slow
PTAL
6 years, 4 months ago (2014-08-04 12:07:27 UTC) #1
philipj_slow
Hmm, apparently http/tests/media/media-source/mediasource-closed-on-htmlmediaelement-destruction.html assumes that GC will happen while the delaying-the-load-event flag is true. Is ...
6 years, 4 months ago (2014-08-04 13:11:00 UTC) #2
acolwell GONE FROM CHROMIUM
Wouldn't this prevent HTMLMediaElements from ever getting GCed in the preload=metadata case? I don't believe ...
6 years, 4 months ago (2014-08-04 15:41:16 UTC) #3
philipj_slow
I tied this into the delaying-the-load-event flag on the assumption that it's already robust against ...
6 years, 4 months ago (2014-08-05 05:23:09 UTC) #4
philipj_slow
6 years, 4 months ago (2014-08-05 18:18:44 UTC) #5

Powered by Google App Engine
This is Rietveld 408576698