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

Issue 2424163004: Factor out authorization from AudioRendererHost. (Closed)

Created:
4 years, 2 months ago by Max Morin
Modified:
4 years, 1 month ago
CC:
audio-mojo-cl_google.com, chromium-reviews, darin-cc_chromium.org, feature-media-reviews_chromium.org, jam, miu+watch_chromium.org, posciak+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Factor out hadndling of the authorization IPC from AudioRendererHost. This is part of an effort to make AudioRendererHost small enough to easily replace with a class using mojo. The pending/completed authorizations are still stored in ARH, since the mojo implementation won't need to store pending authorizations. BUG=656923 CQ_INCLUDE_TRYBOTS=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 Committed: https://crrev.com/b08e842c3fab03521e0c1fb954c39453c96edeab Cr-Commit-Position: refs/heads/master@{#433160}

Patch Set 1 #

Patch Set 2 : Rename. #

Patch Set 3 : Add null check. Add comments. #

Patch Set 4 : Remove unnecessary weak pointer use. #

Total comments: 21

Patch Set 5 : . #

Total comments: 19

Patch Set 6 : Unit tests. Address other comments. #

Total comments: 4

Patch Set 7 : Guidos comments. #

Total comments: 16

Patch Set 8 : Dale's comments. #

Total comments: 33

Patch Set 9 : Threaded unit tests. More unit tests. #

Patch Set 10 : Minor fixes. #

Total comments: 7

Patch Set 11 : . #

Patch Set 12 : Don't use separate UI thread for test. #

Total comments: 21

Patch Set 13 : . #

Total comments: 20

Patch Set 14 : Rename things. #

Total comments: 11

Patch Set 15 : . #

Total comments: 1

Patch Set 16 : const& #

Unified diffs Side-by-side diffs Delta from patch set Stats (+980 lines, -317 lines) Patch
M content/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/bad_message.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -1 line 0 comments Download
M content/browser/renderer_host/media/audio_input_device_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +9 lines, -5 lines 0 comments Download
A content/browser/renderer_host/media/audio_output_authorization_handler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +100 lines, -0 lines 0 comments Download
A content/browser/renderer_host/media/audio_output_authorization_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +213 lines, -0 lines 0 comments Download
A content/browser/renderer_host/media/audio_output_authorization_handler_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +356 lines, -0 lines 0 comments Download
M content/browser/renderer_host/media/audio_renderer_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 7 chunks +14 lines, -36 lines 0 comments Download
M content/browser/renderer_host/media/audio_renderer_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 6 chunks +50 lines, -231 lines 0 comments Download
M content/browser/renderer_host/media/audio_renderer_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 16 chunks +210 lines, -41 lines 0 comments Download
M content/public/browser/media_device_id.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M content/public/browser/media_device_id.cc View 1 2 3 4 5 6 7 8 2 chunks +16 lines, -0 lines 0 comments Download
M content/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
M media/audio/fake_audio_manager.cc View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -2 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +2 lines, -1 line 0 comments Download

Messages

Total messages: 64 (21 generated)
Max Morin
Olga: WDYT? This code is exercised by the current tests of ARH, and this class ...
4 years, 2 months ago (2016-10-18 14:32:47 UTC) #6
Max Morin
Guido: Could you take a look at this? Basically, the device authorization checking flow is ...
4 years, 1 month ago (2016-10-27 13:22:53 UTC) #10
o1ka
Nice! https://codereview.chromium.org/2424163004/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/2424163004/diff/60001/content/browser/renderer_host/media/audio_output_authorization_handler.cc#newcode18 content/browser/renderer_host/media/audio_output_authorization_handler.cc:18: device_id == media::AudioDeviceDescription::kDefaultDeviceId || l.17 and 18 are ...
4 years, 1 month ago (2016-10-27 13:58:09 UTC) #12
o1ka
guidou@ - a question to you https://codereview.chromium.org/2424163004/diff/60001/content/browser/renderer_host/media/audio_renderer_host.h File content/browser/renderer_host/media/audio_renderer_host.h (left): https://codereview.chromium.org/2424163004/diff/60001/content/browser/renderer_host/media/audio_renderer_host.h#oldcode273 content/browser/renderer_host/media/audio_renderer_host.h:273: std::map<int, std::pair<bool, std::string>> ...
4 years, 1 month ago (2016-10-28 08:12:20 UTC) #13
Guido Urdaneta
https://codereview.chromium.org/2424163004/diff/60001/content/browser/renderer_host/media/audio_renderer_host.h File content/browser/renderer_host/media/audio_renderer_host.h (left): https://codereview.chromium.org/2424163004/diff/60001/content/browser/renderer_host/media/audio_renderer_host.h#oldcode273 content/browser/renderer_host/media/audio_renderer_host.h:273: std::map<int, std::pair<bool, std::string>> authorizations_; On 2016/10/28 08:12:20, o1ka wrote: ...
4 years, 1 month ago (2016-10-28 08:39:32 UTC) #14
Max Morin
https://codereview.chromium.org/2424163004/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/2424163004/diff/60001/content/browser/renderer_host/media/audio_output_authorization_handler.cc#newcode18 content/browser/renderer_host/media/audio_output_authorization_handler.cc:18: device_id == media::AudioDeviceDescription::kDefaultDeviceId || On 2016/10/27 13:58:09, o1ka wrote: ...
4 years, 1 month ago (2016-10-28 11:16:07 UTC) #15
o1ka
https://codereview.chromium.org/2424163004/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/2424163004/diff/60001/content/browser/renderer_host/media/audio_output_authorization_handler.cc#newcode118 content/browser/renderer_host/media/audio_output_authorization_handler.cc:118: AuthorizationCompletedCallback cb, On 2016/10/28 11:16:07, Max Morin Chromium wrote: ...
4 years, 1 month ago (2016-10-28 13:18:41 UTC) #16
Guido Urdaneta
Most of my comments are about documentation, but I also recommend to get rid of ...
4 years, 1 month ago (2016-10-28 15:17:29 UTC) #17
Max Morin
PTAL. Unit tests are added, and all comments should be resolved (otherwise, tell me). https://codereview.chromium.org/2424163004/diff/60001/content/browser/renderer_host/media/audio_renderer_host.cc ...
4 years, 1 month ago (2016-11-01 11:26:20 UTC) #18
Guido Urdaneta
Looking good. Still a few minor comments, but feel free to add owners to the ...
4 years, 1 month ago (2016-11-01 13:49:17 UTC) #19
Max Morin
Thanks for all the reviews so far! Dale: PTAL at everything as owner. Avi: PTAL ...
4 years, 1 month ago (2016-11-01 14:47:20 UTC) #23
Avi (use Gerrit)
lgtm stamp with nit https://codereview.chromium.org/2424163004/diff/120001/content/browser/renderer_host/media/audio_output_authorization_handler.h File content/browser/renderer_host/media/audio_output_authorization_handler.h (right): https://codereview.chromium.org/2424163004/diff/120001/content/browser/renderer_host/media/audio_output_authorization_handler.h#newcode90 content/browser/renderer_host/media/audio_output_authorization_handler.h:90: #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_AUTHORIZATION_HANDLER_H_ nit: two ...
4 years, 1 month ago (2016-11-01 15:06:34 UTC) #24
DaleCurtis
Nice cleanup! I think this has helped me see where our renderer hangs may be ...
4 years, 1 month ago (2016-11-01 22:01:13 UTC) #25
Guido Urdaneta
https://codereview.chromium.org/2424163004/diff/120001/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/2424163004/diff/120001/content/browser/renderer_host/media/audio_output_authorization_handler.cc#newcode139 content/browser/renderer_host/media/audio_output_authorization_handler.cc:139: permission_checker_.CheckPermission( On 2016/11/01 22:01:13, DaleCurtis wrote: > How does ...
4 years, 1 month ago (2016-11-01 22:08:17 UTC) #26
DaleCurtis
Thanks guidou@. lgtm % comments then.
4 years, 1 month ago (2016-11-01 23:17:53 UTC) #27
Max Morin
Avi: Please also take a look at content/browser/bad_message.h. The UNAUTHORIZED_URL message has the same meaning ...
4 years, 1 month ago (2016-11-02 11:47:07 UTC) #28
Avi (use Gerrit)
Bad message file LGTM. No worries about multiple reviews.
4 years, 1 month ago (2016-11-02 17:35:03 UTC) #30
Steven Holte
lgtm histograms lgtm
4 years, 1 month ago (2016-11-02 19:18:50 UTC) #31
o1ka
https://codereview.chromium.org/2424163004/diff/140001/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/2424163004/diff/140001/content/browser/renderer_host/media/audio_output_authorization_handler.cc#newcode89 content/browser/renderer_host/media/audio_output_authorization_handler.cc:89: cb.Run(media::OUTPUT_DEVICE_STATUS_OK, std::move(output_params), remove "move"? https://codereview.chromium.org/2424163004/diff/140001/content/browser/renderer_host/media/audio_output_authorization_handler.cc#newcode181 content/browser/renderer_host/media/audio_output_authorization_handler.cc:181: device_info.device_id)); +guidou@ - ...
4 years, 1 month ago (2016-11-03 10:07:23 UTC) #32
Guido Urdaneta
https://codereview.chromium.org/2424163004/diff/140001/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/2424163004/diff/140001/content/browser/renderer_host/media/audio_output_authorization_handler.cc#newcode181 content/browser/renderer_host/media/audio_output_authorization_handler.cc:181: device_info.device_id)); On 2016/11/03 10:07:22, o1ka wrote: > +guidou@ - ...
4 years, 1 month ago (2016-11-03 10:11:52 UTC) #33
o1ka
On 2016/11/03 10:11:52, Guido Urdaneta wrote: > https://codereview.chromium.org/2424163004/diff/140001/content/browser/renderer_host/media/audio_output_authorization_handler.cc > File content/browser/renderer_host/media/audio_output_authorization_handler.cc > (right): > > ...
4 years, 1 month ago (2016-11-03 10:12:33 UTC) #34
o1ka
On 2016/11/03 10:11:52, Guido Urdaneta wrote: > https://codereview.chromium.org/2424163004/diff/140001/content/browser/renderer_host/media/audio_output_authorization_handler.cc > File content/browser/renderer_host/media/audio_output_authorization_handler.cc > (right): > > ...
4 years, 1 month ago (2016-11-03 10:19:35 UTC) #35
Guido Urdaneta
On 2016/11/03 10:19:35, o1ka wrote: > On 2016/11/03 10:11:52, Guido Urdaneta wrote: > > > ...
4 years, 1 month ago (2016-11-03 10:27:12 UTC) #36
Guido Urdaneta
On 2016/11/03 10:27:12, Guido Urdaneta wrote: > On 2016/11/03 10:19:35, o1ka wrote: > > On ...
4 years, 1 month ago (2016-11-03 10:30:47 UTC) #37
Max Morin
PTAL https://codereview.chromium.org/2424163004/diff/140001/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/2424163004/diff/140001/content/browser/renderer_host/media/audio_output_authorization_handler.cc#newcode89 content/browser/renderer_host/media/audio_output_authorization_handler.cc:89: cb.Run(media::OUTPUT_DEVICE_STATUS_OK, std::move(output_params), On 2016/11/03 10:07:22, o1ka wrote: > ...
4 years, 1 month ago (2016-11-10 14:59:52 UTC) #39
Guido Urdaneta
Will check the tests later, although they look comprehensive at first glance. https://codereview.chromium.org/2424163004/diff/140001/content/browser/renderer_host/media/audio_output_authorization_handler.cc File content/browser/renderer_host/media/audio_output_authorization_handler.cc ...
4 years, 1 month ago (2016-11-10 15:26:05 UTC) #40
Max Morin
On 2016/11/10 15:26:05, Guido Urdaneta wrote: > Will check the tests later, although they look ...
4 years, 1 month ago (2016-11-10 15:47:27 UTC) #41
Guido Urdaneta
On 2016/11/10 15:47:27, Max Morin Chromium wrote: > On 2016/11/10 15:26:05, Guido Urdaneta wrote: > ...
4 years, 1 month ago (2016-11-10 15:53:40 UTC) #42
Max Morin
https://codereview.chromium.org/2424163004/diff/180001/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/2424163004/diff/180001/content/browser/renderer_host/media/audio_output_authorization_handler.cc#newcode16 content/browser/renderer_host/media/audio_output_authorization_handler.cc:16: media::AudioParameters MaybeFixAudioParameters( On 2016/11/10 15:26:04, Guido Urdaneta wrote: > ...
4 years, 1 month ago (2016-11-11 09:26:55 UTC) #43
o1ka
https://codereview.chromium.org/2424163004/diff/220001/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/2424163004/diff/220001/content/browser/renderer_host/media/audio_output_authorization_handler.cc#newcode89 content/browser/renderer_host/media/audio_output_authorization_handler.cc:89: // output nit: comment formating https://codereview.chromium.org/2424163004/diff/220001/content/browser/renderer_host/media/audio_output_authorization_handler.cc#newcode109 content/browser/renderer_host/media/audio_output_authorization_handler.cc:109: LOG(WARNING) << ...
4 years, 1 month ago (2016-11-14 13:24:04 UTC) #44
Max Morin
PTAL https://codereview.chromium.org/2424163004/diff/220001/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/2424163004/diff/220001/content/browser/renderer_host/media/audio_output_authorization_handler.cc#newcode89 content/browser/renderer_host/media/audio_output_authorization_handler.cc:89: // output On 2016/11/14 13:24:04, o1ka wrote: > ...
4 years, 1 month ago (2016-11-16 08:49:49 UTC) #45
Guido Urdaneta
https://codereview.chromium.org/2424163004/diff/240001/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/2424163004/diff/240001/content/browser/renderer_host/media/audio_output_authorization_handler.cc#newcode16 content/browser/renderer_host/media/audio_output_authorization_handler.cc:16: media::AudioParameters MaybeFixAudioParameters( If you are calling this function only ...
4 years, 1 month ago (2016-11-16 12:40:19 UTC) #46
Max Morin
https://codereview.chromium.org/2424163004/diff/240001/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/2424163004/diff/240001/content/browser/renderer_host/media/audio_output_authorization_handler.cc#newcode16 content/browser/renderer_host/media/audio_output_authorization_handler.cc:16: media::AudioParameters MaybeFixAudioParameters( On 2016/11/16 12:40:18, Guido Urdaneta wrote: > ...
4 years, 1 month ago (2016-11-16 14:12:19 UTC) #47
Guido Urdaneta
lgtm, but consider removing details from comments for the private methods. https://codereview.chromium.org/2424163004/diff/240001/content/browser/renderer_host/media/audio_output_authorization_handler.h File content/browser/renderer_host/media/audio_output_authorization_handler.h (right): ...
4 years, 1 month ago (2016-11-16 14:28:33 UTC) #48
o1ka
lgtm Good work! Let's hope unit tests caught all the bugs ;) https://codereview.chromium.org/2424163004/diff/260001/content/browser/renderer_host/media/audio_output_authorization_handler.cc File content/browser/renderer_host/media/audio_output_authorization_handler.cc ...
4 years, 1 month ago (2016-11-16 15:11:28 UTC) #49
Max Morin
Thanks everyone! Dale: Do you want to take another look at this before I commit ...
4 years, 1 month ago (2016-11-16 15:54:37 UTC) #50
o1ka
https://codereview.chromium.org/2424163004/diff/260001/content/browser/renderer_host/media/audio_renderer_host_unittest.cc File content/browser/renderer_host/media/audio_renderer_host_unittest.cc (right): https://codereview.chromium.org/2424163004/diff/260001/content/browser/renderer_host/media/audio_renderer_host_unittest.cc#newcode257 content/browser/renderer_host/media/audio_renderer_host_unittest.cc:257: // ScopedAudioManagerPtr. It will immediately destruct, cleaning up the ...
4 years, 1 month ago (2016-11-16 16:05:46 UTC) #51
Max Morin
Dale: Ping! Do you want to have a final look at this before I commit ...
4 years, 1 month ago (2016-11-17 19:50:56 UTC) #56
DaleCurtis
still lgtm % q. https://codereview.chromium.org/2424163004/diff/280001/content/browser/renderer_host/media/audio_renderer_host.cc File content/browser/renderer_host/media/audio_renderer_host.cc (right): https://codereview.chromium.org/2424163004/diff/280001/content/browser/renderer_host/media/audio_renderer_host.cc#newcode402 content/browser/renderer_host/media/audio_renderer_host.cc:402: url::Origin security_origin, Doesn't seem like ...
4 years, 1 month ago (2016-11-17 20:10:37 UTC) #57
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/2424163004/300001
4 years, 1 month ago (2016-11-18 07:51:42 UTC) #60
Max Morin
On 2016/11/17 20:10:37, DaleCurtis wrote: > still lgtm % q. > > https://codereview.chromium.org/2424163004/diff/280001/content/browser/renderer_host/media/audio_renderer_host.cc > File ...
4 years, 1 month ago (2016-11-18 07:52:19 UTC) #61
commit-bot: I haz the power
Committed patchset #16 (id:300001)
4 years, 1 month ago (2016-11-18 09:34:31 UTC) #62
commit-bot: I haz the power
4 years, 1 month ago (2016-11-18 09:37:28 UTC) #64
Message was sent while issue was closed.
Patchset 16 (id:??) landed as
https://crrev.com/b08e842c3fab03521e0c1fb954c39453c96edeab
Cr-Commit-Position: refs/heads/master@{#433160}

Powered by Google App Engine
This is Rietveld 408576698