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

Issue 2869733005: Convert some audio code to OnceCallback. (Closed)

Created:
3 years, 7 months ago by Max Morin
Modified:
3 years, 7 months ago
Reviewers:
xhwang, tzik
CC:
chromium-reviews, posciak+watch_chromium.org, jam, feature-media-reviews_chromium.org, darin-cc_chromium.org, xjz+watch_chromium.org, mfoltz+watch_chromium.org, miu+watch_chromium.org, audio-mojo-cl_google.com, o1ka, ossu-chromium
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Convert some audio code to OnceCallback. Since PostTaskAndReply and friends are Onceified now, we can convert some code and save some refcouting. This also serves as documentation on which callbacks are only called once, which is nice. Also took care of lint issues. There are input code and also some general device management/permissions code which needs converting, but I feel this CL is big enough. BUG=714018 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/2869733005 Cr-Commit-Position: refs/heads/master@{#472059} Committed: https://chromium.googlesource.com/chromium/src/+/fd2012282b535b4fda0b1d581e0674f295dcd625

Patch Set 1 : Convert some audio code to OnceCallback. #

Patch Set 2 : Fix BindToCurrentLoop issues #

Total comments: 8

Patch Set 3 : Use ResetAndReturn in MediaStreamUIProxy, nits. #

Patch Set 4 : Fix compile. #

Patch Set 5 : rebase #

Total comments: 4

Patch Set 6 : Rebase, comments on unretained. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+342 lines, -311 lines) Patch
M content/browser/media/media_devices_permission_checker.h View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/media/media_devices_permission_checker.cc View 1 2 3 4 5 1 chunk +10 lines, -10 lines 0 comments Download
M content/browser/renderer_host/media/audio_input_device_manager.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/media/audio_input_device_manager.cc View 2 chunks +8 lines, -8 lines 0 comments Download
M content/browser/renderer_host/media/audio_output_authorization_handler.h View 1 1 chunk +4 lines, -5 lines 0 comments Download
M content/browser/renderer_host/media/audio_output_authorization_handler.cc View 1 2 3 4 5 8 chunks +31 lines, -26 lines 0 comments Download
M content/browser/renderer_host/media/audio_output_authorization_handler_unittest.cc View 1 2 3 4 5 11 chunks +34 lines, -26 lines 0 comments Download
M content/browser/renderer_host/media/audio_output_delegate_impl.cc View 1 3 chunks +11 lines, -9 lines 0 comments Download
M content/browser/renderer_host/media/audio_renderer_host.h View 2 chunks +1 line, -5 lines 0 comments Download
M content/browser/renderer_host/media/audio_renderer_host.cc View 3 chunks +9 lines, -9 lines 0 comments Download
M content/browser/renderer_host/media/audio_renderer_host_unittest.cc View 1 2 3 4 5 2 chunks +3 lines, -3 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc View 1 2 3 4 5 3 chunks +10 lines, -6 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_manager.cc View 1 2 3 4 5 9 chunks +32 lines, -32 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_ui_proxy.h View 5 chunks +15 lines, -16 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_ui_proxy.cc View 1 2 6 chunks +32 lines, -41 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_ui_proxy_unittest.cc View 8 chunks +17 lines, -16 lines 0 comments Download
M content/browser/renderer_host/media/render_frame_audio_output_stream_factory.cc View 1 3 chunks +16 lines, -15 lines 0 comments Download
M content/browser/renderer_host/media/render_frame_audio_output_stream_factory_unittest.cc View 1 2 3 4 5 6 chunks +20 lines, -19 lines 0 comments Download
M content/browser/renderer_host/media/renderer_audio_output_stream_factory_context_impl_unittest.cc View 1 2 3 4 5 3 chunks +8 lines, -9 lines 0 comments Download
M media/audio/audio_output_controller.h View 1 chunk +1 line, -1 line 0 comments Download
M media/audio/audio_output_controller.cc View 4 chunks +24 lines, -20 lines 0 comments Download
M media/audio/audio_output_controller_unittest.cc View 1 2 3 4 5 2 chunks +3 lines, -3 lines 0 comments Download
M media/audio/audio_system.h View 2 chunks +8 lines, -5 lines 0 comments Download
M media/audio/audio_system_impl.cc View 8 chunks +23 lines, -19 lines 0 comments Download
M media/mojo/services/mojo_audio_output_stream_provider.h View 1 2 chunks +5 lines, -2 lines 0 comments Download
M media/mojo/services/mojo_audio_output_stream_provider.cc View 1 2 3 4 5 2 chunks +14 lines, -4 lines 0 comments Download

Messages

Total messages: 43 (26 generated)
Max Morin
Tzik: Do you have some advice on how to have both a Once and Repeating ...
3 years, 7 months ago (2017-05-09 15:57:49 UTC) #5
Max Morin
On 2017/05/09 15:57:49, Max Morin wrote: > Tzik: Do you have some advice on how ...
3 years, 7 months ago (2017-05-09 17:18:20 UTC) #13
Max Morin
On 2017/05/09 17:18:20, Max Morin wrote: > On 2017/05/09 15:57:49, Max Morin wrote: > > ...
3 years, 7 months ago (2017-05-09 17:40:02 UTC) #16
tzik
https://codereview.chromium.org/2869733005/diff/60001/content/browser/renderer_host/media/audio_output_authorization_handler_unittest.cc File content/browser/renderer_host/media/audio_output_authorization_handler_unittest.cc (right): https://codereview.chromium.org/2869733005/diff/60001/content/browser/renderer_host/media/audio_output_authorization_handler_unittest.cc#newcode310 content/browser/renderer_host/media/audio_output_authorization_handler_unittest.cc:310: (base::BindOnce( nit: extra parenthes? https://codereview.chromium.org/2869733005/diff/60001/content/browser/renderer_host/media/audio_output_authorization_handler_unittest.cc#newcode336 content/browser/renderer_host/media/audio_output_authorization_handler_unittest.cc:336: (base::BindOnce( nitto
3 years, 7 months ago (2017-05-10 06:49:19 UTC) #19
o1ka
Nice cleanup! Drive-by: https://codereview.chromium.org/2869733005/diff/60001/content/browser/renderer_host/media/audio_output_authorization_handler.cc File content/browser/renderer_host/media/audio_output_authorization_handler.cc (right): https://codereview.chromium.org/2869733005/diff/60001/content/browser/renderer_host/media/audio_output_authorization_handler.cc#newcode161 content/browser/renderer_host/media/audio_output_authorization_handler.cc:161: base::Bind(&AudioOutputAuthorizationHandler::TranslateDeviceID, Once? https://codereview.chromium.org/2869733005/diff/60001/content/browser/renderer_host/media/media_stream_ui_proxy.cc File content/browser/renderer_host/media/media_stream_ui_proxy.cc (right): ...
3 years, 7 months ago (2017-05-10 08:03:02 UTC) #20
Max Morin
Thanks for the comments. Tzik: any advice for BindToCurrentLoop? https://codereview.chromium.org/2869733005/diff/60001/content/browser/renderer_host/media/audio_output_authorization_handler.cc File content/browser/renderer_host/media/audio_output_authorization_handler.cc (right): https://codereview.chromium.org/2869733005/diff/60001/content/browser/renderer_host/media/audio_output_authorization_handler.cc#newcode161 content/browser/renderer_host/media/audio_output_authorization_handler.cc:161: ...
3 years, 7 months ago (2017-05-10 10:39:59 UTC) #21
tzik
On 2017/05/10 10:39:59, Max Morin wrote: > Thanks for the comments. Tzik: any advice for ...
3 years, 7 months ago (2017-05-10 13:14:06 UTC) #22
Max Morin
Xhwang: PTAL.
3 years, 7 months ago (2017-05-15 07:47:55 UTC) #28
tzik
lgtm
3 years, 7 months ago (2017-05-15 08:37:09 UTC) #29
xhwang
lg in general with two nits https://codereview.chromium.org/2869733005/diff/120001/media/mojo/services/mojo_audio_output_stream_provider.cc File media/mojo/services/mojo_audio_output_stream_provider.cc (right): https://codereview.chromium.org/2869733005/diff/120001/media/mojo/services/mojo_audio_output_stream_provider.cc#newcode20 media/mojo/services/mojo_audio_output_stream_provider.cc:20: &MojoAudioOutputStreamProvider::OnError, base::Unretained(this))); Can ...
3 years, 7 months ago (2017-05-15 17:50:55 UTC) #30
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/2869733005/140001
3 years, 7 months ago (2017-05-16 07:14:54 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/437988)
3 years, 7 months ago (2017-05-16 07:23:10 UTC) #35
Max Morin
https://codereview.chromium.org/2869733005/diff/120001/media/mojo/services/mojo_audio_output_stream_provider.cc File media/mojo/services/mojo_audio_output_stream_provider.cc (right): https://codereview.chromium.org/2869733005/diff/120001/media/mojo/services/mojo_audio_output_stream_provider.cc#newcode20 media/mojo/services/mojo_audio_output_stream_provider.cc:20: &MojoAudioOutputStreamProvider::OnError, base::Unretained(this))); On 2017/05/15 17:50:55, xhwang wrote: > Can ...
3 years, 7 months ago (2017-05-16 07:27:34 UTC) #36
xhwang
lgtm
3 years, 7 months ago (2017-05-16 07:56:58 UTC) #37
Max Morin
Thanks!
3 years, 7 months ago (2017-05-16 07:58:25 UTC) #38
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/2869733005/140001
3 years, 7 months ago (2017-05-16 08:36:35 UTC) #40
commit-bot: I haz the power
3 years, 7 months ago (2017-05-16 10:31:11 UTC) #43
Message was sent while issue was closed.
Committed patchset #6 (id:140001) as
https://chromium.googlesource.com/chromium/src/+/fd2012282b535b4fda0b1d581e06...

Powered by Google App Engine
This is Rietveld 408576698