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

Issue 2815933003: Simplify RecordPermissionAction and Android permission callback (Closed)

Created:
3 years, 8 months ago by raymes
Modified:
3 years, 8 months ago
Reviewers:
Timothy Loh
CC:
chromium-reviews, chfremer+watch_chromium.org, feature-media-reviews_chromium.org, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Simplify RecordPermissionAction and Android permission callback This simplifies RecordPermissionAction and the Android permission callback in MediaStreamDevicesController. RecordPermissionAction is changed to pass in whether mic/camera are being requested rather than passing in the entire request. The Android OS permission callback is changed in several ways: 1) The callback used to be a standalone function, which then called into member functions in MediaStreamDevicesController. It now just calls into a member function directly, removing a layer of indirection. 2) It used to call into PermissionGranted on success which would then call RunCallback with the appropriate arguments. Instead we just call RunCallback directly in that case, as no modifying of the content settings values is needed. 3) It used to call into ForcePermissionDeniedTemporarily in the denial case. This would call RunCallback with CONTENT_SETTING_BLOCK passed for both mic/camera. This is actually slightly incorrect, and we only need to change the settings that were previously CONTENT_SETTING_ALLOW to BLOCK (as the setting may not have been requested at all). This is done and then RunCallback is called directly. 4) set_persist() does not need to be called as settings are only persisted when they are initially set to CONTENT_SETTING_ASK. That cannot be the case at the point this code is reached. BUG=596786 Review-Url: https://codereview.chromium.org/2815933003 Cr-Commit-Position: refs/heads/master@{#465440} Committed: https://chromium.googlesource.com/chromium/src/+/6093fbaf1efb92bfde140f4dbe17e7b38c2fa39f

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -53 lines) Patch
M chrome/browser/media/webrtc/media_stream_devices_controller.h View 1 chunk +4 lines, -8 lines 0 comments Download
M chrome/browser/media/webrtc/media_stream_devices_controller.cc View 7 chunks +47 lines, -45 lines 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 12 (8 generated)
raymes
3 years, 8 months ago (2017-04-13 01:56:42 UTC) #4
Timothy Loh
On 2017/04/13 01:56:42, raymes wrote: lgtm
3 years, 8 months ago (2017-04-18 01:47:51 UTC) #7
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/2815933003/1
3 years, 8 months ago (2017-04-18 23:30:23 UTC) #9
commit-bot: I haz the power
3 years, 8 months ago (2017-04-19 00:38:26 UTC) #12
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/6093fbaf1efb92bfde140f4dbe17...

Powered by Google App Engine
This is Rietveld 408576698