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

Issue 2365723003: Break out WebAudio suspension code into new class. Add tests. (Closed)

Created:
4 years, 2 months ago by DaleCurtis
Modified:
4 years, 2 months ago
CC:
chromium-reviews, darin-cc_chromium.org, feature-media-reviews_chromium.org, jam, mlamouri+watch-content_chromium.org, posciak+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Break out WebAudio suspension code into new class. Add tests. We've had enough problems with this code over the past year that it needs to be extracted into something less burdensome on the WebAudio code. It also needs some better testing. This creates a new class called SilentSinkSuspender which is only used on Android today and adds tests for it. It also changes the implementation of suspension from directly calling into the sink to instead post tasks to a provided task runner (render thread). Notably, fake render callbacks are now driven on the media thread instead of the render thread since WebAudio and Oilpan have a plethora of checks around what is and isn't run on the main thread. This also means more than one Render() may occur during transition. Too many of these can disrupt the WebAudio clock, but given the 30 second timeout this should be pretty rare in actual WebAudio usage situations. BUG=649018, 614978 TEST=new unittests, no more deadlock upon idle timeout. Committed: https://crrev.com/b770266d26fc09ab8fb746562d008c5d436e4784 Cr-Commit-Position: refs/heads/master@{#421108}

Patch Set 1 #

Total comments: 13

Patch Set 2 : Add lock. Move to media. #

Patch Set 3 : Fix namespace. #

Patch Set 4 : Fix non-exported base. #

Total comments: 15

Patch Set 5 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+461 lines, -137 lines) Patch
M content/renderer/media/renderer_webaudiodevice_impl.h View 1 2 3 chunks +4 lines, -32 lines 0 comments Download
M content/renderer/media/renderer_webaudiodevice_impl.cc View 1 2 5 chunks +20 lines, -96 lines 0 comments Download
M media/base/BUILD.gn View 1 2 chunks +3 lines, -0 lines 0 comments Download
M media/base/fake_audio_render_callback.h View 1 1 chunk +4 lines, -0 lines 0 comments Download
M media/base/fake_audio_render_callback.cc View 1 2 chunks +17 lines, -9 lines 0 comments Download
A media/base/silent_sink_suspender.h View 1 2 3 4 1 chunk +110 lines, -0 lines 0 comments Download
A media/base/silent_sink_suspender.cc View 1 2 3 4 1 chunk +143 lines, -0 lines 0 comments Download
A media/base/silent_sink_suspender_unittest.cc View 1 1 chunk +160 lines, -0 lines 0 comments Download

Messages

Total messages: 42 (23 generated)
DaleCurtis
olka: PTAL at media/ code since you've complained about the odd calls in the code ...
4 years, 2 months ago (2016-09-23 00:34:15 UTC) #2
DaleCurtis
There's a minor test error due to fake changes, but this is otherwise good to ...
4 years, 2 months ago (2016-09-23 01:37:15 UTC) #7
hongchan
> Too many of these can disrupt the WebAudio clock, but given the 30 second ...
4 years, 2 months ago (2016-09-23 07:43:56 UTC) #8
o1ka
Right, I was complaining about races here https://bugs.chromium.org/p/chromium/issues/detail?id=614978. But if I understand the change correctly, ...
4 years, 2 months ago (2016-09-23 10:34:35 UTC) #11
ncarter (slow)
https://codereview.chromium.org/2365723003/diff/1/content/renderer/media/webaudio_suspender.h File content/renderer/media/webaudio_suspender.h (right): https://codereview.chromium.org/2365723003/diff/1/content/renderer/media/webaudio_suspender.h#newcode1 content/renderer/media/webaudio_suspender.h:1: // Copyright (c) 2012 The Chromium Authors. All rights ...
4 years, 2 months ago (2016-09-23 16:55:11 UTC) #12
DaleCurtis
hongchan@ there's not really any documentation on it other than what's written here and documented ...
4 years, 2 months ago (2016-09-23 20:24:19 UTC) #13
o1ka
lgtm % |transition_lock_| should be held everywhere. I love how RendererWebAudioDeviceImpl is cleaned up - ...
4 years, 2 months ago (2016-09-26 12:21:56 UTC) #23
o1ka
Added 614978 to BUG=, since this change fixes it as well.
4 years, 2 months ago (2016-09-26 12:25:18 UTC) #25
DaleCurtis
(just comment) https://codereview.chromium.org/2365723003/diff/60001/media/base/silent_sink_suspender.cc File media/base/silent_sink_suspender.cc (right): https://codereview.chromium.org/2365723003/diff/60001/media/base/silent_sink_suspender.cc#newcode131 media/base/silent_sink_suspender.cc:131: // Stop() is synchronous for the FakeWorker, ...
4 years, 2 months ago (2016-09-26 16:54:27 UTC) #26
ncarter (slow)
content/ lgtm though I don't think you need it anymore
4 years, 2 months ago (2016-09-26 17:16:52 UTC) #27
o1ka
On 2016/09/26 16:54:27, DaleCurtis wrote: > (just comment) > > https://codereview.chromium.org/2365723003/diff/60001/media/base/silent_sink_suspender.cc > File media/base/silent_sink_suspender.cc (right): ...
4 years, 2 months ago (2016-09-26 18:59:13 UTC) #28
o1ka
On 2016/09/26 18:59:13, o1ka wrote: > On 2016/09/26 16:54:27, DaleCurtis wrote: > > (just comment) ...
4 years, 2 months ago (2016-09-26 19:10:48 UTC) #29
DaleCurtis
Oh I see, you're worried about the case where we have real -> fake -> ...
4 years, 2 months ago (2016-09-26 19:24:19 UTC) #30
DaleCurtis
https://codereview.chromium.org/2365723003/diff/60001/media/base/silent_sink_suspender.cc File media/base/silent_sink_suspender.cc (right): https://codereview.chromium.org/2365723003/diff/60001/media/base/silent_sink_suspender.cc#newcode43 media/base/silent_sink_suspender.cc:43: base::AutoLock al(transition_lock_); On 2016/09/26 at 12:21:55, o1ka wrote: > ...
4 years, 2 months ago (2016-09-26 19:45:59 UTC) #32
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/2365723003/80001
4 years, 2 months ago (2016-09-26 19:47:03 UTC) #34
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/299963)
4 years, 2 months ago (2016-09-26 21:45:18 UTC) #36
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/2365723003/80001
4 years, 2 months ago (2016-09-27 03:12:49 UTC) #38
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 2 months ago (2016-09-27 04:55:00 UTC) #40
commit-bot: I haz the power
4 years, 2 months ago (2016-09-27 04:56:15 UTC) #42
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/b770266d26fc09ab8fb746562d008c5d436e4784
Cr-Commit-Position: refs/heads/master@{#421108}

Powered by Google App Engine
This is Rietveld 408576698