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

Issue 2913303002: Avoid unsafe heap access from audio thread. (Closed)

Created:
3 years, 6 months ago by sof
Modified:
3 years, 6 months ago
CC:
chromium-reviews, hongchan
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Avoid unsafe heap access from audio thread. The audio thread tries to touch main thread Blink GCed objects in a select few places, which isn't safe as a GC might concurrently run. Avoid such cross off-thread usage, rearrange the processing of finished nodes from the audio thread to the main thread. R=hongchan,rtoy,haraken BUG=727091, 729275 Review-Url: https://codereview.chromium.org/2913303002 Cr-Commit-Position: refs/heads/master@{#478084} Committed: https://chromium.googlesource.com/chromium/src/+/548a4efe0d1cf9aa4958b1b73d53a9f0b1126a89

Patch Set 1 #

Total comments: 8

Patch Set 2 : clean up stoppable nodes on the main thread #

Patch Set 3 : rebased upto r477617 #

Patch Set 4 : bring back comment #

Total comments: 2

Patch Set 5 : support optional GC locking #

Patch Set 6 : experiment with moving post-render finished node cleanup to main thread #

Patch Set 7 : adjust source handler locking to actually work #

Patch Set 8 : more ThreadState undo #

Patch Set 9 : remove unwanted assert #

Patch Set 10 : fix comment spelling #

Total comments: 3

Patch Set 11 : improve method documentation #

Unified diffs Side-by-side diffs Delta from patch set Stats (+98 lines, -112 lines) Patch
M third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h View 1 2 3 4 5 6 7 8 9 10 5 chunks +27 lines, -27 lines 0 comments Download
M third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp View 1 2 3 4 5 6 7 8 7 chunks +71 lines, -81 lines 0 comments Download
M third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp View 1 2 3 4 5 1 chunk +0 lines, -4 lines 0 comments Download

Messages

Total messages: 63 (37 generated)
sof
please take a look (% bots coming through green) A fallout from enabling vector arena ...
3 years, 6 months ago (2017-05-31 21:14:43 UTC) #4
haraken
Thanks for looking into this. Hmm. In general it's not encouraged to let one thread ...
3 years, 6 months ago (2017-06-01 01:16:27 UTC) #8
sof
On 2017/06/01 01:16:27, haraken wrote: > Thanks for looking into this. > > Hmm. In ...
3 years, 6 months ago (2017-06-01 05:25:54 UTC) #10
hongchan
Thanks for working on this! (and few drive-by comments) https://codereview.chromium.org/2913303002/diff/1/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp File third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp (right): https://codereview.chromium.org/2913303002/diff/1/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp#newcode685 third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp:685: ...
3 years, 6 months ago (2017-06-01 16:08:55 UTC) #12
Raymond Toy
https://codereview.chromium.org/2913303002/diff/1/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp File third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp (right): https://codereview.chromium.org/2913303002/diff/1/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp#newcode685 third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp:685: ThreadState::GCLockScope gc_lock(ThreadState::MainThreadState()); On 2017/06/01 16:08:55, hongchan wrote: > rtoy@ ...
3 years, 6 months ago (2017-06-01 18:20:47 UTC) #14
sof
https://codereview.chromium.org/2913303002/diff/1/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp File third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp (right): https://codereview.chromium.org/2913303002/diff/1/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp#newcode685 third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp:685: ThreadState::GCLockScope gc_lock(ThreadState::MainThreadState()); On 2017/06/01 18:20:47, Raymond Toy wrote: > ...
3 years, 6 months ago (2017-06-01 21:10:05 UTC) #15
Raymond Toy
On 2017/06/01 21:10:05, sof wrote: > https://codereview.chromium.org/2913303002/diff/1/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp > File third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp (right): > > https://codereview.chromium.org/2913303002/diff/1/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp#newcode685 > ...
3 years, 6 months ago (2017-06-01 22:35:33 UTC) #16
haraken
https://codereview.chromium.org/2913303002/diff/1/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp File third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp (right): https://codereview.chromium.org/2913303002/diff/1/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp#newcode685 third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp:685: ThreadState::GCLockScope gc_lock(ThreadState::MainThreadState()); On 2017/06/01 21:10:05, sof wrote: > On ...
3 years, 6 months ago (2017-06-02 02:42:25 UTC) #17
sof
https://codereview.chromium.org/2913303002/diff/1/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp File third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp (right): https://codereview.chromium.org/2913303002/diff/1/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp#newcode685 third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp:685: ThreadState::GCLockScope gc_lock(ThreadState::MainThreadState()); On 2017/06/02 02:42:25, haraken wrote: > On ...
3 years, 6 months ago (2017-06-02 05:39:40 UTC) #18
sof
On 2017/06/01 22:35:33, Raymond Toy wrote: > On 2017/06/01 21:10:05, sof wrote: > > > ...
3 years, 6 months ago (2017-06-07 12:47:57 UTC) #21
Raymond Toy
On 2017/06/07 at 12:47:57, sigbjornf wrote: > On 2017/06/01 22:35:33, Raymond Toy wrote: > > ...
3 years, 6 months ago (2017-06-07 15:33:28 UTC) #22
Raymond Toy
lgtm
3 years, 6 months ago (2017-06-07 15:33:48 UTC) #23
haraken
This doesn't seem like a good solution but I'll stamp LGTM... https://codereview.chromium.org/2913303002/diff/60001/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp File third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp (right): ...
3 years, 6 months ago (2017-06-08 01:07:55 UTC) #24
Raymond Toy
On 2017/06/08 at 01:07:55, haraken wrote: > This doesn't seem like a good solution but ...
3 years, 6 months ago (2017-06-08 03:06:15 UTC) #25
sof
On 2017/06/08 03:06:15, Raymond Toy wrote: > On 2017/06/08 at 01:07:55, haraken wrote: > > ...
3 years, 6 months ago (2017-06-08 08:22:56 UTC) #30
haraken
On 2017/06/08 08:22:56, sof wrote: > On 2017/06/08 03:06:15, Raymond Toy wrote: > > On ...
3 years, 6 months ago (2017-06-08 08:34:23 UTC) #31
sof
On 2017/06/08 08:34:23, haraken wrote: > On 2017/06/08 08:22:56, sof wrote: > > On 2017/06/08 ...
3 years, 6 months ago (2017-06-08 08:42:09 UTC) #32
haraken
On 2017/06/08 08:42:09, sof wrote: > On 2017/06/08 08:34:23, haraken wrote: > > On 2017/06/08 ...
3 years, 6 months ago (2017-06-08 08:57:16 UTC) #33
sof
On 2017/06/08 08:57:16, haraken wrote: > On 2017/06/08 08:42:09, sof wrote: > > On 2017/06/08 ...
3 years, 6 months ago (2017-06-08 11:23:56 UTC) #42
Raymond Toy
lgtm with nit. Thanks so much for doing this work! https://codereview.chromium.org/2913303002/diff/170001/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp File third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp (right): https://codereview.chromium.org/2913303002/diff/170001/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp#newcode875 ...
3 years, 6 months ago (2017-06-08 15:06:20 UTC) #48
sof
https://codereview.chromium.org/2913303002/diff/170001/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp File third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp (right): https://codereview.chromium.org/2913303002/diff/170001/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp#newcode875 third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp:875: void BaseAudioContext::ResolvePromisesForResume() { On 2017/06/08 15:06:20, Raymond Toy wrote: ...
3 years, 6 months ago (2017-06-08 15:24:39 UTC) #49
hongchan
lgtm Thanks for doing this!
3 years, 6 months ago (2017-06-08 15:58:57 UTC) #50
sof
thanks for the reviews, will go ahead and try landing. Should it cause perf problems ...
3 years, 6 months ago (2017-06-08 18:46:34 UTC) #54
Raymond Toy
On 2017/06/08 at 18:46:34, sigbjornf wrote: > thanks for the reviews, will go ahead and ...
3 years, 6 months ago (2017-06-08 19:24:27 UTC) #55
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2913303002/190001
3 years, 6 months ago (2017-06-08 21:06:50 UTC) #60
commit-bot: I haz the power
3 years, 6 months ago (2017-06-08 21:11:00 UTC) #63
Message was sent while issue was closed.
Committed patchset #11 (id:190001) as
https://chromium.googlesource.com/chromium/src/+/548a4efe0d1cf9aa4958b1b73d53...

Powered by Google App Engine
This is Rietveld 408576698