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

Issue 1362803002: Add logic to resolve permission mismatches in Android M for webrtc. (Closed)

Created:
5 years, 3 months ago by Ted C
Modified:
4 years, 3 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org, mcasas+watch_chromium.org, mlamouri+watch-permissions_chromium.org, posciak+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add logic to resolve permission mismatches in Android M for webrtc. BUG=499393 Committed: https://crrev.com/d3cfebe04af22eed762bd9c44f63c1554d424fec Cr-Commit-Position: refs/heads/master@{#351425}

Patch Set 1 #

Patch Set 2 : Add comment in media_stream_devices_controller #

Total comments: 7

Patch Set 3 : Address comments and fix declining #

Total comments: 8

Patch Set 4 : Rebased #

Patch Set 5 : Address Mounir's comments #

Patch Set 6 : Fix StartPageService #

Patch Set 7 : Fix ChromeOS WebUI login usage #

Patch Set 8 : Rebased #

Total comments: 2

Patch Set 9 : Rebased #

Patch Set 10 : Add blankline #

Unified diffs Side-by-side diffs Delta from patch set Stats (+144 lines, -40 lines) Patch
M chrome/browser/chromeos/login/ui/webui_login_view.cc View 1 2 3 4 5 6 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/media/media_stream_devices_controller.h View 1 2 2 chunks +13 lines, -1 line 0 comments Download
M chrome/browser/media/media_stream_devices_controller.cc View 1 2 3 4 5 6 7 8 9 8 chunks +52 lines, -6 lines 0 comments Download
M chrome/browser/media/media_stream_infobar_delegate.h View 1 chunk +2 lines, -4 lines 0 comments Download
M chrome/browser/media/media_stream_infobar_delegate.cc View 1 chunk +1 line, -6 lines 0 comments Download
M chrome/browser/media/permission_bubble_media_access_handler.cc View 1 2 3 4 5 6 7 8 9 2 chunks +56 lines, -16 lines 0 comments Download
M chrome/browser/permissions/permission_update_infobar_delegate_android.h View 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/permissions/permission_update_infobar_delegate_android.cc View 1 2 4 chunks +10 lines, -2 lines 0 comments Download
M chrome/browser/ui/app_list/start_page_service.cc View 1 2 3 4 5 2 chunks +3 lines, -2 lines 0 comments Download

Messages

Total messages: 53 (21 generated)
Ted C
PTAL tommi - media* mlamouri - permissions*
5 years, 3 months ago (2015-09-22 23:26:59 UTC) #2
tommi (sloooow) - chröme
Per - do you mind taking a look?
5 years, 3 months ago (2015-09-23 10:43:42 UTC) #4
perkj_chrome
Sorry, I can't say I know this code. guidou?
5 years, 3 months ago (2015-09-23 12:46:12 UTC) #6
Guido Urdaneta
lgtm % nits https://codereview.chromium.org/1362803002/diff/20001/chrome/browser/media/media_stream_devices_controller.cc File chrome/browser/media/media_stream_devices_controller.cc (right): https://codereview.chromium.org/1362803002/diff/20001/chrome/browser/media/media_stream_devices_controller.cc#newcode100 chrome/browser/media/media_stream_devices_controller.cc:100: if (old_audio_setting_ == CONTENT_SETTING_ALLOW) Shouldn't you ...
5 years, 3 months ago (2015-09-23 13:32:14 UTC) #7
Ted C
I ended up needing to add a new method to the controller to force disable ...
5 years, 3 months ago (2015-09-23 19:45:34 UTC) #8
mlamouri (slow - plz ping)
lgtm https://codereview.chromium.org/1362803002/diff/40001/chrome/browser/media/media_stream_devices_controller.cc File chrome/browser/media/media_stream_devices_controller.cc (right): https://codereview.chromium.org/1362803002/diff/40001/chrome/browser/media/media_stream_devices_controller.cc#newcode105 chrome/browser/media/media_stream_devices_controller.cc:105: if (IsAllowedForVideo()) style: I believe you need to ...
5 years, 3 months ago (2015-09-24 10:57:02 UTC) #9
Ted C
https://codereview.chromium.org/1362803002/diff/40001/chrome/browser/media/media_stream_devices_controller.cc File chrome/browser/media/media_stream_devices_controller.cc (right): https://codereview.chromium.org/1362803002/diff/40001/chrome/browser/media/media_stream_devices_controller.cc#newcode105 chrome/browser/media/media_stream_devices_controller.cc:105: if (IsAllowedForVideo()) On 2015/09/24 10:57:02, Mounir Lamouri wrote: > ...
5 years, 3 months ago (2015-09-24 22:07:27 UTC) #10
Ted C
On 2015/09/24 22:07:27, Ted C wrote: > https://codereview.chromium.org/1362803002/diff/40001/chrome/browser/media/media_stream_devices_controller.cc > File chrome/browser/media/media_stream_devices_controller.cc (right): > > https://codereview.chromium.org/1362803002/diff/40001/chrome/browser/media/media_stream_devices_controller.cc#newcode105 ...
5 years, 3 months ago (2015-09-24 22:08:17 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1362803002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1362803002/80001
5 years, 2 months ago (2015-09-25 21:54:59 UTC) #14
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/118823)
5 years, 2 months ago (2015-09-25 22:08:17 UTC) #16
Ted C
+calamity for start_page_service.cc
5 years, 2 months ago (2015-09-25 22:38:52 UTC) #18
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1362803002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1362803002/100001
5 years, 2 months ago (2015-09-25 22:39:12 UTC) #20
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: chromeos_amd64-generic_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_amd64-generic_chromium_compile_only_ng/builds/37116) chromeos_daisy_chromium_compile_only_ng on ...
5 years, 2 months ago (2015-09-25 23:05:40 UTC) #22
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1362803002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1362803002/120001
5 years, 2 months ago (2015-09-25 23:12:05 UTC) #24
Ted C
+dzhioev for chromeos/login/ui/webui_login_view.cc Now I think I finally found all usages. Sorry for the spam.
5 years, 2 months ago (2015-09-26 00:21:01 UTC) #26
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 2 months ago (2015-09-26 00:21:31 UTC) #28
calamity
start_page_service.cc lgtm
5 years, 2 months ago (2015-09-28 02:24:32 UTC) #29
dzhioev (left Google)
On 2015/09/26 00:21:01, Ted C wrote: > +dzhioev for chromeos/login/ui/webui_login_view.cc > > Now I think ...
5 years, 2 months ago (2015-09-28 21:15:05 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1362803002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1362803002/120001
5 years, 2 months ago (2015-09-28 21:16:52 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_gn_rel on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_gn_rel/builds/9993) win8_chromium_ng on tryserver.chromium.win (JOB_FAILED, ...
5 years, 2 months ago (2015-09-28 21:20:23 UTC) #35
Ted C
tommi|ddorwin -- need media OWNERS stamp
5 years, 2 months ago (2015-09-28 21:59:51 UTC) #37
tommi (sloooow) - chröme
rs lgtm https://codereview.chromium.org/1362803002/diff/140001/chrome/browser/media/media_stream_devices_controller.cc File chrome/browser/media/media_stream_devices_controller.cc (right): https://codereview.chromium.org/1362803002/diff/140001/chrome/browser/media/media_stream_devices_controller.cc#newcode105 chrome/browser/media/media_stream_devices_controller.cc:105: if (IsAllowedForVideo()) { nit: empty line above ...
5 years, 2 months ago (2015-09-29 14:49:48 UTC) #38
Ted C
https://codereview.chromium.org/1362803002/diff/140001/chrome/browser/media/media_stream_devices_controller.cc File chrome/browser/media/media_stream_devices_controller.cc (right): https://codereview.chromium.org/1362803002/diff/140001/chrome/browser/media/media_stream_devices_controller.cc#newcode105 chrome/browser/media/media_stream_devices_controller.cc:105: if (IsAllowedForVideo()) { On 2015/09/29 14:49:48, tommi wrote: > ...
5 years, 2 months ago (2015-09-29 21:25:30 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1362803002/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1362803002/180001
5 years, 2 months ago (2015-09-29 21:26:17 UTC) #42
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_compile_dbg_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_compile_dbg_ng/builds/89154)
5 years, 2 months ago (2015-09-29 21:36:43 UTC) #43
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_compile_dbg_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_compile_dbg_ng/builds/89154) win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, ...
5 years, 2 months ago (2015-09-29 22:07:42 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1362803002/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1362803002/180001
5 years, 2 months ago (2015-09-29 22:19:04 UTC) #47
commit-bot: I haz the power
Committed patchset #10 (id:180001)
5 years, 2 months ago (2015-09-29 23:03:10 UTC) #48
commit-bot: I haz the power
Patchset 10 (id:??) landed as https://crrev.com/d3cfebe04af22eed762bd9c44f63c1554d424fec Cr-Commit-Position: refs/heads/master@{#351425}
5 years, 2 months ago (2015-09-29 23:04:05 UTC) #49
Peter Kasting
https://codereview.chromium.org/1362803002/diff/20001/chrome/browser/permissions/permission_update_infobar_delegate_android.cc File chrome/browser/permissions/permission_update_infobar_delegate_android.cc (right): https://codereview.chromium.org/1362803002/diff/20001/chrome/browser/permissions/permission_update_infobar_delegate_android.cc#newcode79 chrome/browser/permissions/permission_update_infobar_delegate_android.cc:79: PermissionUpdatedCallback cb = callback_; On 2015/09/23 19:45:34, Ted C ...
4 years, 3 months ago (2016-09-21 21:33:45 UTC) #51
Peter Kasting
https://codereview.chromium.org/1362803002/diff/20001/chrome/browser/permissions/permission_update_infobar_delegate_android.cc File chrome/browser/permissions/permission_update_infobar_delegate_android.cc (right): https://codereview.chromium.org/1362803002/diff/20001/chrome/browser/permissions/permission_update_infobar_delegate_android.cc#newcode79 chrome/browser/permissions/permission_update_infobar_delegate_android.cc:79: PermissionUpdatedCallback cb = callback_; On 2016/09/21 21:33:44, Peter Kasting ...
4 years, 3 months ago (2016-09-21 21:37:08 UTC) #52
Ted C
4 years, 3 months ago (2016-09-21 23:12:14 UTC) #53
Message was sent while issue was closed.
On 2016/09/21 21:37:08, Peter Kasting wrote:
>
https://codereview.chromium.org/1362803002/diff/20001/chrome/browser/permissi...
> File chrome/browser/permissions/permission_update_infobar_delegate_android.cc
> (right):
> 
>
https://codereview.chromium.org/1362803002/diff/20001/chrome/browser/permissi...
> chrome/browser/permissions/permission_update_infobar_delegate_android.cc:79:
> PermissionUpdatedCallback cb = callback_;
> On 2016/09/21 21:33:44, Peter Kasting wrote:
> > On 2015/09/23 19:45:34, Ted C wrote:
> > > On 2015/09/23 13:32:14, Guido Urdaneta wrote:
> > > > Can you use base::ResetAndReturn() here?
> > > 
> > > Neat!  Done
> > 
> > This change got referenced in another review I was doing for some Android
> > infobar code.
> > 
> > Why is it important to save off the callback before calling it (i.e. using
> > ResetAndReturn() instead of just a direct Run())?  This is subtle, and
> > 
> > (1) Other people are copying this without it being clear to me that they
need
> > it, and
> > (2) I'm not sure how to _be_ clear about when it's needed
> > 
> > Understanding why you were doing this would help me.
> 
> To be clear: I understand why you want to reset the callback, so it doesn't
run
> in the destructor.  What I _don't_ understand is why the order needs to be
> "reset first, then run" instead of just:
> 
>   callback_.Run();
>   callback_.Reset();
> 
> Can |callback_| destroy |this|?  But if it could, then the RemoveSelf() call
> wouldn't be safe either.  So I don't understand why the hoop-jumping.

I don't recall to be honest.

I wouldn't be surprised if I just copied the existing callback semantics in:
https://codereview.chromium.org/1362803002/diff/180001/chrome/browser/media/m...

If anything, I like that ResetAndReturn is on a single line.  But if
using it picks up unintended behavior baggage, then that isn't
desired either.

But then again, I haven't looked at this code in a year, so I also can't
guarantee that under some circumstances this was needed to avoid a double
callback trigger (although in my brief glance it didn't seem possible).

Powered by Google App Engine
This is Rietveld 408576698