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

Issue 1593763002: Keep AudioSourceNode from premature GC with ScriptWrappable::hasPendingActivity() (Closed)

Created:
4 years, 11 months ago by hongchan
Modified:
4 years, 9 months ago
Reviewers:
haraken, sof, Raymond Toy, Yuki
CC:
Raymond Toy, blink-reviews, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add ScriptWrappable to SchduledSourceNode and ScriptProcessorNode |onended| event in OscillatorNode, AudioBufferSourceNode and |onaudioprocess| event in ScriptProcessor node are not fired once the JS reference of the node goes out of local scope. This CL is to keep those nodes from being collected when they still has a pending activity. This can be done by adding ScriptWrappable.hasPendingActivity() to them. The change in ScriptWrappable is: https://codereview.chromium.org/1609343002/ BUG=577431, 484176, 559220 TEST=LayoutTests/webaudio/audiosource-premature-gc.html Committed: https://crrev.com/cfa51385f9a17df78576c607827910f91f4c6683 Cr-Commit-Position: refs/heads/master@{#377231} Committed: https://crrev.com/97be0f5a7309a7da5c7da95c637eda34236f25f2 Cr-Commit-Position: refs/heads/master@{#377783}

Patch Set 1 : Initial Patch #

Total comments: 1

Patch Set 2 : [DO NOT SUBMIT] ActiveDOMObject to ScriptWrappable #

Patch Set 3 : Added [DependentLifetime] #

Total comments: 1

Patch Set 4 : Error fixed in releaseActiveSourceNodes() #

Total comments: 2

Patch Set 5 : Simplify changes (-AbstractAudioContext) #

Total comments: 11

Patch Set 6 : Simplify changes (startNode > start) #

Total comments: 1

Patch Set 7 : Fixed ordering issue in test #

Total comments: 9

Patch Set 8 : Cleaning up test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+109 lines, -0 lines) Patch
A third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html View 1 2 3 4 5 6 7 1 chunk +82 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc-expected.txt View 1 2 3 4 5 6 1 chunk +11 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.h View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp View 1 2 3 4 5 1 chunk +12 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/webaudio/AudioSourceNode.idl View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 102 (33 generated)
hongchan
PTAL. Note: the new test 100% fails on the build without this patch. https://codereview.chromium.org/1593763002/diff/20001/third_party/WebKit/LayoutTests/webaudio/scriptprocessornode-premature-death-expected.txt File ...
4 years, 11 months ago (2016-01-15 22:40:06 UTC) #3
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1593763002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1593763002/20001
4 years, 11 months ago (2016-01-18 03:32:30 UTC) #7
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 11 months ago (2016-01-18 04:37:16 UTC) #9
hongchan
PTAL - dominicc@ and haraken@ This is the initial attempt to make AudioNode as ActiveDOMObject. ...
4 years, 11 months ago (2016-01-18 04:41:12 UTC) #10
dominicc (has gone to gerrit)
Thanks for your tireless work improving Web Audio! Let me check my understanding--the problem here ...
4 years, 11 months ago (2016-01-18 05:37:46 UTC) #11
hongchan
On 2016/01/18 05:37:46, (out until Jan 5) dominicc wrote: > Thanks for your tireless work ...
4 years, 11 months ago (2016-01-18 18:14:21 UTC) #12
haraken
My question is why you need to make the entire AudioNode an ActiveDOMObject. Is it ...
4 years, 11 months ago (2016-01-19 02:29:41 UTC) #13
hongchan
On 2016/01/19 02:29:41, haraken wrote: > My question is why you need to make the ...
4 years, 11 months ago (2016-01-19 15:30:14 UTC) #14
haraken
On 2016/01/19 15:30:14, hoch wrote: > On 2016/01/19 02:29:41, haraken wrote: > > My question ...
4 years, 11 months ago (2016-01-19 15:32:24 UTC) #15
hongchan
> It is a common programming pattern to make only a part of a big ...
4 years, 11 months ago (2016-01-19 16:47:40 UTC) #16
haraken
On 2016/01/19 16:47:40, hoch wrote: > > It is a common programming pattern to make ...
4 years, 11 months ago (2016-01-19 17:02:22 UTC) #17
hongchan
On 2016/01/19 17:02:22, haraken wrote: > On 2016/01/19 16:47:40, hoch wrote: > > > It ...
4 years, 11 months ago (2016-01-19 17:19:07 UTC) #18
dominicc (has gone to gerrit)
Nit: It would be helpful to simplify the BUG= line to 577431, or at least ...
4 years, 11 months ago (2016-01-25 05:18:35 UTC) #19
hongchan
On 2016/01/25 05:18:35, (out until Jan 5) dominicc wrote: > Nit: It would be helpful ...
4 years, 11 months ago (2016-01-25 18:24:13 UTC) #21
dominicc (has gone to gerrit)
On 2016/01/25 at 18:24:13, hongchan wrote: > On 2016/01/25 05:18:35, (out until Jan 5) dominicc ...
4 years, 10 months ago (2016-02-09 08:09:09 UTC) #22
dominicc (has gone to gerrit)
On 2016/02/09 at 08:09:09, (out until Jan 5) dominicc wrote: > On 2016/01/25 at 18:24:13, ...
4 years, 10 months ago (2016-02-09 08:09:24 UTC) #23
haraken
On 2016/02/09 08:09:24, (out until Jan 5) dominicc wrote: > On 2016/02/09 at 08:09:09, (out ...
4 years, 10 months ago (2016-02-09 08:26:21 UTC) #24
hongchan
haraken@ PTAL. I've changed ActiveDOMObject to ScriptWrappable, but all the attached tests are failing. Here ...
4 years, 10 months ago (2016-02-10 19:21:46 UTC) #26
haraken
On 2016/02/10 19:21:46, hoch wrote: > haraken@ PTAL. > > I've changed ActiveDOMObject to ScriptWrappable, ...
4 years, 10 months ago (2016-02-11 00:24:52 UTC) #27
haraken
On 2016/02/11 00:24:52, haraken wrote: > On 2016/02/10 19:21:46, hoch wrote: > > haraken@ PTAL. ...
4 years, 10 months ago (2016-02-11 01:03:41 UTC) #28
hongchan
On 2016/02/11 01:03:41, haraken wrote: > On 2016/02/11 00:24:52, haraken wrote: > > On 2016/02/10 ...
4 years, 10 months ago (2016-02-11 16:35:43 UTC) #29
haraken
On 2016/02/11 16:35:43, hoch wrote: > On 2016/02/11 01:03:41, haraken wrote: > > On 2016/02/11 ...
4 years, 10 months ago (2016-02-12 04:26:28 UTC) #30
hongchan
> You can just return 'true' from hasPendingActivity. Then the wrapper will be > kept ...
4 years, 10 months ago (2016-02-12 16:54:11 UTC) #31
haraken
On 2016/02/12 16:54:11, hoch wrote: > > You can just return 'true' from hasPendingActivity. Then ...
4 years, 10 months ago (2016-02-13 15:13:06 UTC) #33
hongchan
> That is because AudioScheduledSourceNode does not have a DOM wrapper (i.e., > AudioScheduledSourceNode doesn't ...
4 years, 10 months ago (2016-02-16 19:42:05 UTC) #34
haraken
On 2016/02/16 19:42:05, hoch wrote: > > That is because AudioScheduledSourceNode does not have a ...
4 years, 10 months ago (2016-02-16 19:47:20 UTC) #35
hongchan
On 2016/02/16 19:47:20, haraken wrote: > On 2016/02/16 19:42:05, hoch wrote: > > > That ...
4 years, 10 months ago (2016-02-16 19:58:56 UTC) #36
hongchan
So I invoked hasPendingActivity() on an AudioNode manually in LLDB right after the instantiation, then ...
4 years, 10 months ago (2016-02-17 22:40:08 UTC) #37
haraken
On 2016/02/17 22:40:08, hoch wrote: > So I invoked hasPendingActivity() on an AudioNode manually in ...
4 years, 10 months ago (2016-02-18 10:06:55 UTC) #39
Yuki
On 2016/02/18 10:06:55, haraken wrote: > On 2016/02/17 22:40:08, hoch wrote: > > So I ...
4 years, 10 months ago (2016-02-18 13:04:37 UTC) #40
haraken
On 2016/02/18 13:04:37, Yuki wrote: > On 2016/02/18 10:06:55, haraken wrote: > > On 2016/02/17 ...
4 years, 10 months ago (2016-02-18 13:13:03 UTC) #41
hongchan
yukishino@ Thanks! Now hasPendingActivity() works correctly. haraken@ However, now I have a different issue: It ...
4 years, 10 months ago (2016-02-19 00:46:47 UTC) #42
haraken
On 2016/02/19 00:46:47, hoch wrote: > yukishino@ > Thanks! Now hasPendingActivity() works correctly. > > ...
4 years, 10 months ago (2016-02-19 08:40:57 UTC) #43
hongchan
PTAL. I fixed a (stupid) bug in AbstractAudioContext::releaseActiveSourceNodes(). Now all the layout tests are passing ...
4 years, 10 months ago (2016-02-19 17:28:11 UTC) #44
haraken
https://codereview.chromium.org/1593763002/diff/80001/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp File third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp (right): https://codereview.chromium.org/1593763002/diff/80001/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp#newcode279 third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp:279: if (m_isMarkedForGC) Instead of introducing m_isMarkedForGC, can we do ...
4 years, 10 months ago (2016-02-19 17:46:00 UTC) #46
hongchan
Using context()->isContextClosed() makes more sense because all the node derived from a context should be ...
4 years, 10 months ago (2016-02-19 18:13:49 UTC) #47
haraken
On 2016/02/19 18:13:49, hoch wrote: > Using context()->isContextClosed() makes more sense because all the node ...
4 years, 10 months ago (2016-02-19 21:59:35 UTC) #48
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1593763002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1593763002/100001
4 years, 10 months ago (2016-02-19 22:18:37 UTC) #51
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 10 months ago (2016-02-20 00:10:54 UTC) #53
hongchan
PTAL - rtoy@ WebAudio changes. yukishiino@ Usage of ScriptWrappable::hasPendingActivity().
4 years, 10 months ago (2016-02-22 16:51:25 UTC) #54
Raymond Toy
Does the premature-gc test fail without your fix? https://codereview.chromium.org/1593763002/diff/100001/third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html File third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html (right): https://codereview.chromium.org/1593763002/diff/100001/third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html#newcode37 third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html:37: var ...
4 years, 10 months ago (2016-02-22 17:43:51 UTC) #55
hongchan
https://codereview.chromium.org/1593763002/diff/100001/third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html File third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html (right): https://codereview.chromium.org/1593763002/diff/100001/third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html#newcode37 third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html:37: var dummy = context.createBuffer(1, 44100 * 1.5, 44100); On ...
4 years, 10 months ago (2016-02-23 18:01:33 UTC) #56
Raymond Toy
https://codereview.chromium.org/1593763002/diff/100001/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp File third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp (right): https://codereview.chromium.org/1593763002/diff/100001/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp#newcode271 third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp:271: // still returns true. On 2016/02/23 18:01:33, hoch wrote: ...
4 years, 10 months ago (2016-02-23 18:12:05 UTC) #57
Raymond Toy
lgtm
4 years, 10 months ago (2016-02-23 18:13:19 UTC) #58
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1593763002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1593763002/120001
4 years, 10 months ago (2016-02-23 19:06:34 UTC) #60
hongchan
FYI: ToT fails on the new test 100% out of 10 consecutive trials. (ran the ...
4 years, 10 months ago (2016-02-23 23:11:47 UTC) #61
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 10 months ago (2016-02-23 23:13:28 UTC) #63
Yuki
lgtm
4 years, 10 months ago (2016-02-24 05:50:41 UTC) #64
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1593763002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1593763002/120001
4 years, 10 months ago (2016-02-24 06:05:11 UTC) #67
commit-bot: I haz the power
Committed patchset #6 (id:120001)
4 years, 10 months ago (2016-02-24 06:11:25 UTC) #69
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/cfa51385f9a17df78576c607827910f91f4c6683 Cr-Commit-Position: refs/heads/master@{#377231}
4 years, 10 months ago (2016-02-24 06:12:38 UTC) #71
sof
https://codereview.chromium.org/1593763002/diff/120001/third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html File third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html (right): https://codereview.chromium.org/1593763002/diff/120001/third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html#newcode22 third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html:22: (function () { There's an output ordering issue here, ...
4 years, 10 months ago (2016-02-24 07:51:10 UTC) #73
hongchan
A revert of this CL (patchset #6 id:120001) has been created in https://codereview.chromium.org/1727333002/ by hongchan@chromium.org. ...
4 years, 10 months ago (2016-02-24 09:12:23 UTC) #74
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1593763002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1593763002/140001
4 years, 10 months ago (2016-02-25 00:55:58 UTC) #77
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/179190)
4 years, 10 months ago (2016-02-25 05:18:02 UTC) #79
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1593763002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1593763002/140001
4 years, 10 months ago (2016-02-25 16:23:41 UTC) #81
hongchan
rtoy@ sof@ PTAL. I've rewritten the layout test to resolve the ordering issue.
4 years, 10 months ago (2016-02-25 16:24:07 UTC) #82
sof
thanks for test rewrite - lgtm as far as i'm concerned. https://codereview.chromium.org/1593763002/diff/140001/third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html File third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html (right): ...
4 years, 10 months ago (2016-02-25 16:31:55 UTC) #83
Raymond Toy
https://codereview.chromium.org/1593763002/diff/140001/third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html File third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html (right): https://codereview.chromium.org/1593763002/diff/140001/third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html#newcode36 third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html:36: let dummy = context.createBuffer(1, sampleRate, sampleRate); Pick a more ...
4 years, 10 months ago (2016-02-25 16:34:57 UTC) #84
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 10 months ago (2016-02-25 17:45:29 UTC) #86
hongchan
Thanks all for the review! https://codereview.chromium.org/1593763002/diff/140001/third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html File third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html (right): https://codereview.chromium.org/1593763002/diff/140001/third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html#newcode36 third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html:36: let dummy = context.createBuffer(1, ...
4 years, 10 months ago (2016-02-25 18:00:36 UTC) #88
Raymond Toy
https://codereview.chromium.org/1593763002/diff/140001/third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html File third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html (right): https://codereview.chromium.org/1593763002/diff/140001/third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html#newcode85 third_party/WebKit/LayoutTests/webaudio/audiosource-premature-gc.html:85: succesfullyParsed = true; On 2016/02/25 18:00:36, hoch wrote: > ...
4 years, 10 months ago (2016-02-25 18:02:20 UTC) #89
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1593763002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1593763002/160001
4 years, 10 months ago (2016-02-25 18:02:49 UTC) #90
Raymond Toy
lgtm
4 years, 10 months ago (2016-02-25 19:06:58 UTC) #91
Raymond Toy
lgtm
4 years, 10 months ago (2016-02-25 19:07:03 UTC) #92
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/185897)
4 years, 10 months ago (2016-02-25 19:55:18 UTC) #94
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1593763002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1593763002/160001
4 years, 10 months ago (2016-02-26 01:35:18 UTC) #97
commit-bot: I haz the power
Committed patchset #8 (id:160001)
4 years, 10 months ago (2016-02-26 02:38:19 UTC) #99
commit-bot: I haz the power
4 years, 10 months ago (2016-02-26 02:39:39 UTC) #101
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/97be0f5a7309a7da5c7da95c637eda34236f25f2
Cr-Commit-Position: refs/heads/master@{#377783}

Powered by Google App Engine
This is Rietveld 408576698