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

Issue 552303006: Prevent more script-observable cases of HTMLMediaElement GC (Closed)

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

Description

Prevent more script-observable cases of HTMLMediaElement GC This is intended to cover all cases where Gecko prevents GC: https://www.w3.org/Bugs/Public/show_bug.cgi?id=26515#c5 Additionally, change the behavior for MediaSource so that an HTMLMediaElement attached to a MediaSource is never collected. Since the reverse is also true (see MediaSource::hasPendingActivity) a connected media element + media source pair will now live as long as the document. LayoutTests for the new cases in HTMLMediaElement::hasPendingActivity() were added: media/gc-while-delaying-the-load-event.html (was timeout) http/tests/media/gc-while-network-loading.html (was timeout) media/gc-while-playing.html (was pass) media/gc-while-seeking.html (was timeout) http/tests/media/media-source/mediasource-htmlmediaelement-lifetime.html (was failure) BUG=400659 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=182247

Patch Set 1 #

Total comments: 4

Patch Set 2 : mediasource and tests #

Patch Set 3 : cleanup #

Total comments: 4

Patch Set 4 : update comments #

Patch Set 5 : assert only for oilpan #

Total comments: 4

Patch Set 6 : revert oilpan misunderstanding #

Patch Set 7 : potentiallyPlaying() -> couldPlayIfEnoughData() #

Patch Set 8 : documentation #

Patch Set 9 : documentation #

Patch Set 10 : make gc-while-seeking.html non-flaky #

Unified diffs Side-by-side diffs Delta from patch set Stats (+212 lines, -82 lines) Patch
A LayoutTests/http/tests/media/gc-while-network-loading.html View 1 2 3 1 chunk +33 lines, -0 lines 0 comments Download
D LayoutTests/http/tests/media/media-source/mediasource-closed-on-htmlmediaelement-destruction.html View 1 1 chunk +0 lines, -54 lines 0 comments Download
D LayoutTests/http/tests/media/media-source/mediasource-closed-on-htmlmediaelement-destruction-expected.txt View 1 1 chunk +0 lines, -7 lines 0 comments Download
A LayoutTests/http/tests/media/media-source/mediasource-htmlmediaelement-lifetime.html View 1 1 chunk +48 lines, -0 lines 0 comments Download
A LayoutTests/http/tests/media/media-source/mediasource-htmlmediaelement-lifetime-expected.txt View 1 1 chunk +7 lines, -0 lines 0 comments Download
M LayoutTests/media/autoplay.html View 1 chunk +0 lines, -2 lines 0 comments Download
M LayoutTests/media/autoplay-with-preload-none.html View 1 chunk +0 lines, -2 lines 0 comments Download
M LayoutTests/media/avtrack/addtrack.html View 1 chunk +0 lines, -2 lines 0 comments Download
M LayoutTests/media/avtrack/audio-track-enabled.html View 1 chunk +0 lines, -2 lines 0 comments Download
M LayoutTests/media/avtrack/forget-on-load.html View 1 chunk +0 lines, -2 lines 0 comments Download
M LayoutTests/media/avtrack/gc.html View 1 chunk +0 lines, -2 lines 0 comments Download
M LayoutTests/media/avtrack/getTrackById.html View 1 chunk +0 lines, -2 lines 0 comments Download
M LayoutTests/media/avtrack/video-track-selected.html View 1 chunk +0 lines, -2 lines 0 comments Download
A LayoutTests/media/gc-while-delaying-the-load-event.html View 1 1 chunk +19 lines, -0 lines 0 comments Download
A LayoutTests/media/gc-while-playing.html View 1 2 3 1 chunk +32 lines, -0 lines 0 comments Download
A LayoutTests/media/gc-while-seeking.html View 1 2 3 4 5 6 7 8 9 1 chunk +40 lines, -0 lines 0 comments Download
M LayoutTests/media/track/track-remove-track.html View 2 chunks +0 lines, -4 lines 0 comments Download
M Source/core/html/HTMLMediaElement.cpp View 1 2 3 4 5 6 7 1 chunk +33 lines, -1 line 0 comments Download

Messages

Total messages: 71 (8 generated)
philipj_slow
PTAL, kbr@ has said that fixing this is important. This is a repeat of an ...
6 years, 3 months ago (2014-09-11 10:06:37 UTC) #2
fs
On 2014/09/11 10:06:37, philipj wrote: > PTAL, kbr@ has said that fixing this is important. ...
6 years, 3 months ago (2014-09-11 11:22:37 UTC) #3
philipj_slow
On 2014/09/11 11:22:37, fs wrote: > On 2014/09/11 10:06:37, philipj wrote: > > > > ...
6 years, 3 months ago (2014-09-11 12:44:07 UTC) #4
fs
On 2014/09/11 12:44:07, philipj wrote: > On 2014/09/11 11:22:37, fs wrote: > > On 2014/09/11 ...
6 years, 3 months ago (2014-09-11 13:28:33 UTC) #5
acolwell GONE FROM CHROMIUM
On 2014/09/11 13:28:33, fs wrote: > On 2014/09/11 12:44:07, philipj wrote: > > On 2014/09/11 ...
6 years, 3 months ago (2014-09-11 16:33:34 UTC) #6
acolwell GONE FROM CHROMIUM
https://codereview.chromium.org/552303006/diff/1/Source/core/html/HTMLMediaElement.cpp File Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/552303006/diff/1/Source/core/html/HTMLMediaElement.cpp#newcode396 Source/core/html/HTMLMediaElement.cpp:396: setShouldDelayLoadEvent(false); You might be able to remove this and ...
6 years, 3 months ago (2014-09-11 16:33:41 UTC) #7
fs
On 2014/09/11 16:33:34, acolwell_leaving_chromium_9-23 wrote: > On 2014/09/11 13:28:33, fs wrote: > > On 2014/09/11 ...
6 years, 3 months ago (2014-09-11 17:27:35 UTC) #8
acolwell GONE FROM CHROMIUM
On 2014/09/11 17:27:35, fs wrote: > On 2014/09/11 16:33:34, acolwell_leaving_chromium_9-23 wrote: > > On 2014/09/11 ...
6 years, 3 months ago (2014-09-11 17:51:10 UTC) #9
Ken Russell (switch to Gerrit)
Thanks for working to fix this. The code looks good in general, especially the removal ...
6 years, 3 months ago (2014-09-11 18:20:57 UTC) #11
acolwell GONE FROM CHROMIUM
https://codereview.chromium.org/552303006/diff/1/Source/core/html/HTMLMediaElement.cpp File Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/552303006/diff/1/Source/core/html/HTMLMediaElement.cpp#newcode3477 Source/core/html/HTMLMediaElement.cpp:3477: if (potentiallyPlaying()) On 2014/09/11 18:20:56, Ken Russell wrote: > ...
6 years, 3 months ago (2014-09-11 19:02:24 UTC) #12
philipj_slow
On 2014/09/11 16:33:34, acolwell_leaving_chromium_9-23 wrote: > The MediaSource needs to be kept alive if it ...
6 years, 3 months ago (2014-09-11 19:27:38 UTC) #13
acolwell GONE FROM CHROMIUM
On 2014/09/11 19:27:38, philipj wrote: > On 2014/09/11 16:33:34, acolwell_leaving_chromium_9-23 wrote: > > The MediaSource ...
6 years, 3 months ago (2014-09-11 19:32:55 UTC) #14
philipj_slow
OK, I'll give "if (m_mediaSource) return true" a try tomorrow, writing the tests for this ...
6 years, 3 months ago (2014-09-11 19:36:56 UTC) #15
philipj_slow
https://codereview.chromium.org/552303006/diff/1/Source/core/html/HTMLMediaElement.cpp File Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/552303006/diff/1/Source/core/html/HTMLMediaElement.cpp#newcode3477 Source/core/html/HTMLMediaElement.cpp:3477: if (potentiallyPlaying()) On 2014/09/11 19:02:24, acolwell_leaving_chromium_9-23 wrote: > On ...
6 years, 3 months ago (2014-09-12 14:05:21 UTC) #16
philipj_slow
cleanup
6 years, 3 months ago (2014-09-12 14:14:54 UTC) #17
philipj_slow
OK, I think PS3 may just work. PTAL.
6 years, 3 months ago (2014-09-12 14:15:35 UTC) #18
acolwell GONE FROM CHROMIUM
lgtm https://codereview.chromium.org/552303006/diff/40001/LayoutTests/media/gc-while-playing.html File LayoutTests/media/gc-while-playing.html (right): https://codereview.chromium.org/552303006/diff/40001/LayoutTests/media/gc-while-playing.html#newcode17 LayoutTests/media/gc-while-playing.html:17: setTimeout(t.step_func(gcAndAwaitTimeupdate), 0); Isn't the reference to 'a' in ...
6 years, 3 months ago (2014-09-12 16:27:26 UTC) #19
scherkus (not reviewing)
lgtm -- thanks for tackling this philipj! https://codereview.chromium.org/552303006/diff/40001/Source/core/html/HTMLMediaElement.cpp File Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/552303006/diff/40001/Source/core/html/HTMLMediaElement.cpp#newcode3456 Source/core/html/HTMLMediaElement.cpp:3456: bool HTMLMediaElement::hasPendingActivity() ...
6 years, 3 months ago (2014-09-12 19:05:01 UTC) #20
philipj_slow
update comments
6 years, 3 months ago (2014-09-12 19:11:06 UTC) #21
philipj_slow
Thanks all, I'll try landing this now. https://codereview.chromium.org/552303006/diff/40001/LayoutTests/media/gc-while-playing.html File LayoutTests/media/gc-while-playing.html (right): https://codereview.chromium.org/552303006/diff/40001/LayoutTests/media/gc-while-playing.html#newcode17 LayoutTests/media/gc-while-playing.html:17: setTimeout(t.step_func(gcAndAwaitTimeupdate), 0); ...
6 years, 3 months ago (2014-09-12 19:13:00 UTC) #22
philipj_slow
Oops, I didn't notice that the trybots had caught a real regression: the new ASSERT(!m_shouldDelayLoadEvent) ...
6 years, 3 months ago (2014-09-12 19:56:50 UTC) #23
philipj_slow
assert only for oilpan
6 years, 3 months ago (2014-09-12 20:00:41 UTC) #24
philipj_slow
Oilpan reviewers, would one of you mind taking a look at the change to the ...
6 years, 3 months ago (2014-09-12 20:03:06 UTC) #26
Ken Russell (switch to Gerrit)
Philip: thanks for working on this. I'm afraid we've found a problem with your patch; ...
6 years, 3 months ago (2014-09-12 23:52:39 UTC) #27
sof
On 2014/09/12 20:03:06, philipj wrote: > Oilpan reviewers, would one of you mind taking a ...
6 years, 3 months ago (2014-09-13 08:43:51 UTC) #28
haraken
On 2014/09/13 08:43:51, sof wrote: > On 2014/09/12 20:03:06, philipj wrote: > > Oilpan reviewers, ...
6 years, 3 months ago (2014-09-15 05:02:13 UTC) #29
Mads Ager (chromium)
https://codereview.chromium.org/552303006/diff/80001/Source/core/html/HTMLMediaElement.cpp File Source/core/html/HTMLMediaElement.cpp (left): https://codereview.chromium.org/552303006/diff/80001/Source/core/html/HTMLMediaElement.cpp#oldcode385 Source/core/html/HTMLMediaElement.cpp:385: // If the HTMLMediaElement dies with the document we ...
6 years, 3 months ago (2014-09-15 07:01:18 UTC) #31
philipj_slow
On 2014/09/12 23:52:39, Ken Russell wrote: > Philip: thanks for working on this. I'm afraid ...
6 years, 3 months ago (2014-09-15 12:49:58 UTC) #32
philipj_slow
It seems like my understanding of wrapper objects was wrong and that I've made a ...
6 years, 3 months ago (2014-09-15 13:07:44 UTC) #33
Ken Russell (switch to Gerrit)
On 2014/09/15 12:49:58, philipj wrote: > On 2014/09/12 23:52:39, Ken Russell wrote: > > Philip: ...
6 years, 3 months ago (2014-09-16 15:49:16 UTC) #34
philipj_slow
I worked on this yesterday, but my workstation doesn't have the drivers to support WebGL ...
6 years, 3 months ago (2014-09-16 19:00:50 UTC) #35
scherkus (not reviewing)
On 2014/09/16 15:49:16, Ken Russell wrote: > On 2014/09/15 12:49:58, philipj wrote: > > On ...
6 years, 3 months ago (2014-09-16 19:03:31 UTC) #36
scherkus (not reviewing)
On 2014/09/16 19:03:31, scherkus wrote: > On 2014/09/16 15:49:16, Ken Russell wrote: > > On ...
6 years, 3 months ago (2014-09-16 19:03:45 UTC) #37
philipj_slow
OK, I successfully installed the drivers needed for WebGL and was able to reproduce the ...
6 years, 3 months ago (2014-09-17 14:39:42 UTC) #38
philipj_slow
Here's a WIP spec sync for potentiallyPlaying(): https://codereview.chromium.org/576073005 That doesn't pass the existing tests or ...
6 years, 3 months ago (2014-09-17 14:50:34 UTC) #39
philipj_slow
revert oilpan misunderstanding
6 years, 3 months ago (2014-09-18 08:35:01 UTC) #40
philipj_slow
potentiallyPlaying() -> couldPlayIfEnoughData()
6 years, 3 months ago (2014-09-18 08:36:21 UTC) #41
philipj_slow
On 2014/09/13 08:43:51, sof wrote: > Re: hasPendingActivity() - is the reasoning for making it ...
6 years, 3 months ago (2014-09-18 09:19:21 UTC) #42
philipj_slow
documentation
6 years, 3 months ago (2014-09-18 09:41:04 UTC) #43
philipj_slow
documentation
6 years, 3 months ago (2014-09-18 09:41:38 UTC) #44
philipj_slow
I see that additionally, HTMLMediaElement::stop() doesn't set m_paused to true, so couldPlayIfEnoughData() may continue to ...
6 years, 3 months ago (2014-09-18 09:51:52 UTC) #45
sof
On 2014/09/18 09:19:21, philipj wrote: > On 2014/09/13 08:43:51, sof wrote: > > Re: hasPendingActivity() ...
6 years, 3 months ago (2014-09-18 10:58:02 UTC) #46
jochen (gone - plz use gerrit)
On 2014/09/18 at 10:58:02, sigbjornf wrote: > On 2014/09/18 09:19:21, philipj wrote: > > On ...
6 years, 3 months ago (2014-09-18 11:00:38 UTC) #47
philipj_slow
On 2014/09/18 11:00:38, jochen wrote: > did you confirm that this fixes the webgl test? ...
6 years, 3 months ago (2014-09-18 11:12:48 UTC) #48
jochen (gone - plz use gerrit)
lgtm then thanks for fixing
6 years, 3 months ago (2014-09-18 11:17:53 UTC) #50
philipj_slow
On 2014/09/18 10:58:02, sof wrote: > On 2014/09/18 09:19:21, philipj wrote: > > On 2014/09/13 ...
6 years, 3 months ago (2014-09-18 11:43:53 UTC) #51
philipj_slow
Before landing I want to acknowledge a few things that I could have done but ...
6 years, 3 months ago (2014-09-18 12:10:43 UTC) #52
philipj_slow
make gc-while-seeking.html non-flaky
6 years, 3 months ago (2014-09-18 13:19:41 UTC) #53
Ken Russell (switch to Gerrit)
LGTM. Thank you for fixing this thoroughly, and adding the new test cases.
6 years, 3 months ago (2014-09-18 13:32:25 UTC) #54
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/552303006/170001
6 years, 3 months ago (2014-09-18 14:07:51 UTC) #56
commit-bot: I haz the power
Try jobs failed on following builders: win_blink_rel on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/win_blink_rel/builds/27707)
6 years, 3 months ago (2014-09-18 15:55:22 UTC) #58
acolwell GONE FROM CHROMIUM
lgtm. Thanks for working on this.
6 years, 3 months ago (2014-09-18 15:56:49 UTC) #59
Ken Russell (switch to Gerrit)
On 2014/09/18 15:55:22, I haz the power (commit-bot) wrote: > Try jobs failed on following ...
6 years, 3 months ago (2014-09-18 15:58:09 UTC) #60
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/552303006/170001
6 years, 3 months ago (2014-09-18 15:58:38 UTC) #62
commit-bot: I haz the power
Committed patchset #10 (id:170001) as 182247
6 years, 3 months ago (2014-09-18 16:31:32 UTC) #63
Dirk Pranke
On 2014/09/18 16:31:32, I haz the power (commit-bot) wrote: > Committed patchset #10 (id:170001) as ...
6 years, 3 months ago (2014-09-18 18:05:54 UTC) #64
Dirk Pranke
On 2014/09/18 18:05:54, Dirk Pranke wrote: > On 2014/09/18 16:31:32, I haz the power (commit-bot) ...
6 years, 3 months ago (2014-09-18 18:27:17 UTC) #65
philipj_slow
Thanks Dirk. The failure was this: This is a testharness.js-based test. FAIL GC while playing ...
6 years, 3 months ago (2014-09-18 18:50:38 UTC) #66
Dirk Pranke
On 2014/09/18 18:50:38, philipj wrote: > Thanks Dirk. The failure was this: > This is ...
6 years, 3 months ago (2014-09-18 19:07:34 UTC) #67
jochen (gone - plz use gerrit)
that's the assertion: ASSERTION FAILED: !m_asyncEventQueue->hasPendingEvents() guess it's wrong after all. Philip, should we just ...
6 years, 3 months ago (2014-09-18 19:22:50 UTC) #68
Dirk Pranke
On 2014/09/18 19:22:50, jochen wrote: > that's the assertion: ASSERTION FAILED: !m_asyncEventQueue->hasPendingEvents() > > guess ...
6 years, 3 months ago (2014-09-18 20:25:27 UTC) #69
philipj_slow
Hmm, if that assert is failing then something is indeed not as I expected. It's ...
6 years, 3 months ago (2014-09-18 21:05:47 UTC) #70
philipj_slow
6 years, 3 months ago (2014-09-18 21:05:47 UTC) #71
Message was sent while issue was closed.
Hmm, if that assert is failing then something is indeed not as I expected. It's
close to bedtime for me, so if you want to revert it I can investigate tomorrow.

Powered by Google App Engine
This is Rietveld 408576698