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

Issue 2821203005: Add a mojo implementation of AudioOutputIPC. (Closed)

Created:
3 years, 8 months ago by Max Morin
Modified:
3 years, 6 months ago
CC:
Aaron Boodman, abarth-chromium, alokp+watch_chromium.org, audio-mojo-cl_google.com, chromium-reviews, creis+watch_chromium.org, darin (slow to review), darin-cc_chromium.org, feature-media-reviews_chromium.org, jam, mlamouri+watch-content_chromium.org, nasko+codewatch_chromium.org, ossu-chromium, posciak+watch_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add a mojo implementation of AudioOutputIPC. A couple of tricky points: * The requirement to always call CloseStream is added to media/audio/audio_output_ipc.h. This requirement isn't new, but it wasn't documented before. * If the RendererAudioOutputStreamFactory used by MojoAudioOutputIPC is destroyed prior to receiving authorization (e.g. because of frame destruction), we need to signal the AudioOutputDevice anyways to avoid waiting forever. We pass a ScopedClosureRunner into the authorization callback to make sure we get a callback even if the factory is destroyed early. * Code for intergrating this into the AudioDeviceFactory is in https://codereview.chromium.org/2890753003 * Browser tests (using this and the dependent CL) in https://codereview.chromium.org/2812883003/#ps380001. BUG=425368 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Review-Url: https://codereview.chromium.org/2821203005 Cr-Commit-Position: refs/heads/master@{#475827} Committed: https://chromium.googlesource.com/chromium/src/+/aa9020e577bcd1f459094168b00a07aaba063a9f

Patch Set 1 #

Total comments: 49

Patch Set 2 : Comments, fix issue with factory disconnected #

Patch Set 3 : Fix test issues #

Total comments: 71

Patch Set 4 : Comments. SWITCH TO MACRO-BASED THREAD CHECKER. #

Total comments: 2

Patch Set 5 : Comments. Tests! #

Patch Set 6 : Move factory to separate CL #

Patch Set 7 : rebase #

Total comments: 22

Patch Set 8 : Death tests, Olga's comments #

Total comments: 19

Patch Set 9 : Use ScopedClosureRunner. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+854 lines, -2 lines) Patch
M content/renderer/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
A content/renderer/media/mojo_audio_output_ipc.h View 1 2 3 4 5 6 7 8 1 chunk +85 lines, -0 lines 0 comments Download
A content/renderer/media/mojo_audio_output_ipc.cc View 1 2 3 4 5 6 7 8 1 chunk +200 lines, -0 lines 0 comments Download
A content/renderer/media/mojo_audio_output_ipc_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +556 lines, -0 lines 0 comments Download
M content/test/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M media/audio/audio_output_ipc.h View 1 2 3 4 5 1 chunk +4 lines, -1 line 0 comments Download
M media/mojo/interfaces/audio_output_stream.mojom View 1 2 3 4 1 chunk +6 lines, -1 line 0 comments Download

Dependent Patchsets:

Messages

Total messages: 84 (45 generated)
Max Morin
Olga: This code isn't unit tested but is otherwise ready for review. Could you take ...
3 years, 8 months ago (2017-04-19 10:41:12 UTC) #3
o1ka
Only structural comments so far, but I'm not sure I followed all the paths yet. ...
3 years, 8 months ago (2017-04-20 10:36:00 UTC) #5
Max Morin
New revision. There is now a mechanism for ensuring that the authorization callback is always ...
3 years, 7 months ago (2017-05-05 13:10:59 UTC) #7
Max Morin
https://codereview.chromium.org/2821203005/diff/1/content/renderer/render_thread_impl.h File content/renderer/render_thread_impl.h (right): https://codereview.chromium.org/2821203005/diff/1/content/renderer/render_thread_impl.h#newcode644 content/renderer/render_thread_impl.h:644: base::Optional<AudioIPCFactory> audio_ipc_factory_; On 2017/05/05 13:10:59, Max Morin wrote: > ...
3 years, 7 months ago (2017-05-05 14:06:15 UTC) #8
Max Morin
I added a diagram to the CL description. I tried to find a good compromise ...
3 years, 7 months ago (2017-05-05 14:52:08 UTC) #10
Max Morin
Ken: Could you take a look at this WIP CL? I have a couple of ...
3 years, 7 months ago (2017-05-08 14:10:16 UTC) #12
Ken Rockot(use gerrit already)
The callback thing seems reasonable. This pattern has come up in a few other places, ...
3 years, 7 months ago (2017-05-08 16:04:24 UTC) #14
Max Morin
Thanks for the fast response! On 2017/05/08 16:04:24, Ken Rockot wrote: > The callback thing ...
3 years, 7 months ago (2017-05-08 16:14:03 UTC) #15
Ken Rockot(use gerrit already)
On 2017/05/08 at 16:14:03, maxmorin wrote: > Thanks for the fast response! > > On ...
3 years, 7 months ago (2017-05-08 16:17:45 UTC) #16
Ken Rockot(use gerrit already)
On 2017/05/08 at 16:17:45, Ken Rockot wrote: > On 2017/05/08 at 16:14:03, maxmorin wrote: > ...
3 years, 7 months ago (2017-05-08 16:24:56 UTC) #17
Ken Rockot(use gerrit already)
On 2017/05/08 at 16:24:56, Ken Rockot wrote: > On 2017/05/08 at 16:17:45, Ken Rockot wrote: ...
3 years, 7 months ago (2017-05-08 16:25:43 UTC) #18
Max Morin
Awesome, thanks. I posted https://groups.google.com/a/chromium.org/forum/#!topic/cxx/5JWdjOKuqh8 about the state of moved-from objects.
3 years, 7 months ago (2017-05-09 10:09:40 UTC) #19
Ken Rockot(use gerrit already)
On 2017/05/09 at 10:09:40, maxmorin wrote: > Awesome, thanks. I posted https://groups.google.com/a/chromium.org/forum/#!topic/cxx/5JWdjOKuqh8 about the state ...
3 years, 7 months ago (2017-05-09 17:46:11 UTC) #20
o1ka
Nice work! https://codereview.chromium.org/2821203005/diff/60001/content/renderer/media/audio_device_factory.cc File content/renderer/media/audio_device_factory.cc (right): https://codereview.chromium.org/2821203005/diff/60001/content/renderer/media/audio_device_factory.cc#newcode15 content/renderer/media/audio_device_factory.cc:15: #include "content/public/common/content_features.h" Not needed? https://codereview.chromium.org/2821203005/diff/60001/content/renderer/media/audio_device_factory.cc#newcode55 content/renderer/media/audio_device_factory.cc:55: std::move(ipc), ...
3 years, 7 months ago (2017-05-11 10:58:41 UTC) #21
Max Morin
Will re-run browser tests tomorrow and start writing unit tests. https://codereview.chromium.org/2821203005/diff/60001/content/renderer/media/audio_device_factory.cc File content/renderer/media/audio_device_factory.cc (right): https://codereview.chromium.org/2821203005/diff/60001/content/renderer/media/audio_device_factory.cc#newcode15 ...
3 years, 7 months ago (2017-05-11 15:31:18 UTC) #23
o1ka
https://codereview.chromium.org/2821203005/diff/1/content/renderer/media/audio_ipc_factory.h File content/renderer/media/audio_ipc_factory.h (right): https://codereview.chromium.org/2821203005/diff/1/content/renderer/media/audio_ipc_factory.h#newcode32 content/renderer/media/audio_ipc_factory.h:32: static AudioIPCFactory* get() { On 2017/05/05 13:10:58, Max Morin ...
3 years, 7 months ago (2017-05-15 13:27:08 UTC) #24
Max Morin
Could you explain like I'm five why CHECKs are needed?
3 years, 7 months ago (2017-05-15 14:30:43 UTC) #25
chromium-reviews
To not debug werid out of memory crashes? On May 15, 2017 4:30 PM, <maxmorin@chromium.org> ...
3 years, 7 months ago (2017-05-15 14:34:39 UTC) #26
Max Morin
By https://chromium.googlesource.com/chromium/src/+/master/styleguide/c++/c++.md#CHECK_DCHECK_and-NOTREACHED, we should only CHECK when code has security implications. Having some sort of ...
3 years, 7 months ago (2017-05-15 14:40:12 UTC) #27
o1ka
On 2017/05/15 14:34:39, chromium-reviews wrote: > To not debug werid out of memory crashes? > ...
3 years, 7 months ago (2017-05-15 14:41:54 UTC) #28
o1ka
On 2017/05/15 14:40:12, Max Morin wrote: > By > https://chromium.googlesource.com/chromium/src/+/master/styleguide/c++/c++.md#CHECK_DCHECK_and-NOTREACHED, > we should only CHECK ...
3 years, 7 months ago (2017-05-15 14:44:15 UTC) #29
Max Morin
On 2017/05/15 14:44:15, o1ka wrote: > On 2017/05/15 14:40:12, Max Morin wrote: > > By ...
3 years, 7 months ago (2017-05-15 14:46:31 UTC) #30
chromium-reviews
Sgtm On May 15, 2017 4:46 PM, <maxmorin@chromium.org> wrote: > On 2017/05/15 14:44:15, o1ka wrote: ...
3 years, 7 months ago (2017-05-15 14:58:25 UTC) #31
Max Morin
I updated the comment in media/mojo/interfaces/audio_output_stream.mojom to address the validity of the passed handles. Added ...
3 years, 7 months ago (2017-05-16 15:51:35 UTC) #34
Max Morin
Ok, this CL is now only for MojoAudioOutputIPC, with the factory being in https://codereview.chromium.org/2890753003#ps1
3 years, 7 months ago (2017-05-17 10:59:53 UTC) #42
o1ka
LGTM! (%nits) https://codereview.chromium.org/2821203005/diff/160001/content/renderer/media/mojo_audio_output_ipc.cc File content/renderer/media/mojo_audio_output_ipc.cc (right): https://codereview.chromium.org/2821203005/diff/160001/content/renderer/media/mojo_audio_output_ipc.cc#newcode43 content/renderer/media/mojo_audio_output_ipc.cc:43: AuthorizationCallbackWrapper&& other) = delete; It has a ...
3 years, 7 months ago (2017-05-18 09:16:50 UTC) #52
Max Morin
Thanks! https://codereview.chromium.org/2821203005/diff/160001/content/renderer/media/mojo_audio_output_ipc.cc File content/renderer/media/mojo_audio_output_ipc.cc (right): https://codereview.chromium.org/2821203005/diff/160001/content/renderer/media/mojo_audio_output_ipc.cc#newcode43 content/renderer/media/mojo_audio_output_ipc.cc:43: AuthorizationCallbackWrapper&& other) = delete; On 2017/05/18 09:16:50, o1ka ...
3 years, 7 months ago (2017-05-18 12:30:18 UTC) #54
Max Morin
Tommi: PTAL at media/ and content/renderer/media/. Ken: Do you have anything to add about mojo_audio_output_ipc?
3 years, 7 months ago (2017-05-18 12:33:19 UTC) #56
Ken Rockot(use gerrit already)
Nothing to add, LGTM
3 years, 7 months ago (2017-05-18 16:08:13 UTC) #57
Max Morin
Changing media reviewer as Tommi seems busy. Dale: PTAL.
3 years, 7 months ago (2017-05-23 14:52:46 UTC) #63
DaleCurtis
https://codereview.chromium.org/2821203005/diff/180001/content/renderer/media/mojo_audio_output_ipc.cc File content/renderer/media/mojo_audio_output_ipc.cc (right): https://codereview.chromium.org/2821203005/diff/180001/content/renderer/media/mojo_audio_output_ipc.cc#newcode101 content/renderer/media/mojo_audio_output_ipc.cc:101: AuthorizationCallbackWrapper::Wrap( Hmm, why not just have a bool set ...
3 years, 7 months ago (2017-05-24 01:36:55 UTC) #65
DaleCurtis
oh, lgtm otherwise defer to olka@ for final stamp if more changes are needed.
3 years, 7 months ago (2017-05-24 01:45:13 UTC) #66
Max Morin
I reran the browser tests for PS9 to make sure they pass. Olga: I changed ...
3 years, 6 months ago (2017-05-30 14:17:11 UTC) #70
Avi (use Gerrit)
lgtm
3 years, 6 months ago (2017-05-30 14:40:39 UTC) #73
o1ka
still lgtm
3 years, 6 months ago (2017-05-30 15:09:38 UTC) #74
Tom Sepez
LGTM on adding comment.
3 years, 6 months ago (2017-05-30 17:15:08 UTC) #77
Max Morin
Thanks everyone for the fast and helpful reviews!
3 years, 6 months ago (2017-05-31 06:14:16 UTC) #78
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/2821203005/200001
3 years, 6 months ago (2017-05-31 06:14:47 UTC) #81
commit-bot: I haz the power
3 years, 6 months ago (2017-05-31 06:19:13 UTC) #84
Message was sent while issue was closed.
Committed patchset #9 (id:200001) as
https://chromium.googlesource.com/chromium/src/+/aa9020e577bcd1f459094168b00a...

Powered by Google App Engine
This is Rietveld 408576698