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

Issue 2814993003: Simplify the code for updating Android permissions in MediaStreamDevicesController (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 the code for updating Android permissions in MediaStreamDevicesController Currently the checks for whether to update Android permissions happen twice: once in the constructor of MediaStreamDevicesController and once in the static RequestPermissionsWithDelegate function, where the permissions will be requested. This is currently needed because if the check fails, RunCallback can be run from inside the constructor. This CL refactors that code to eliminate the duplication. The call to RunCallback no longer occurs in the constructor, instead a function is exposed: RequestFinishedNoPrompt() which calls RunCallback if no permission prompt needs to be shown. Since RunCallback is no longer called from the constructor, we need to also track the value of the denial reason so that it is known at the time RequestFinishedNoPrompt is called. This is stored in a member variable. The values of the content setting are also tracked in member variables and updated through the lifetime of the request. BUG=596786 Review-Url: https://codereview.chromium.org/2814993003 Cr-Commit-Position: refs/heads/master@{#466569} Committed: https://chromium.googlesource.com/chromium/src/+/583e49bd24f395a014cc4ac9c51cc8b359fe97a3

Patch Set 1 #

Patch Set 2 : Simplify the code for updating Android permissions in MediaStreamDevicesController #

Patch Set 3 : Simplify the code for updating Android permissions in MediaStreamDevicesController #

Patch Set 4 : Simplify the code for updating Android permissions in MediaStreamDevicesController #

Patch Set 5 : Simplify the code for updating Android permissions in MediaStreamDevicesController #

Patch Set 6 : Simplify the code for updating Android permissions in MediaStreamDevicesController #

Total comments: 1

Patch Set 7 : Simplify the code for updating Android permissions in MediaStreamDevicesController #

Unified diffs Side-by-side diffs Delta from patch set Stats (+84 lines, -111 lines) Patch
M chrome/browser/media/webrtc/media_stream_devices_controller.h View 1 2 3 3 chunks +10 lines, -9 lines 0 comments Download
M chrome/browser/media/webrtc/media_stream_devices_controller.cc View 1 2 3 4 5 6 4 chunks +74 lines, -102 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 21 (16 generated)
raymes
3 years, 8 months ago (2017-04-21 03:03:21 UTC) #4
Timothy Loh
lgtm https://codereview.chromium.org/2814993003/diff/100001/chrome/browser/media/webrtc/media_stream_devices_controller.cc File chrome/browser/media/webrtc/media_stream_devices_controller.cc (right): https://codereview.chromium.org/2814993003/diff/100001/chrome/browser/media/webrtc/media_stream_devices_controller.cc#newcode392 chrome/browser/media/webrtc/media_stream_devices_controller.cc:392: DCHECK(old_audio_setting_ != CONTENT_SETTING_ASK && Trybots will probably catch ...
3 years, 8 months ago (2017-04-21 04:50:05 UTC) #8
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/2814993003/110003
3 years, 8 months ago (2017-04-21 05:05:49 UTC) #11
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/2814993003/110003
3 years, 8 months ago (2017-04-23 22:15:28 UTC) #18
commit-bot: I haz the power
3 years, 8 months ago (2017-04-23 22:49:32 UTC) #21
Message was sent while issue was closed.
Committed patchset #7 (id:110003) as
https://chromium.googlesource.com/chromium/src/+/583e49bd24f395a014cc4ac9c51c...

Powered by Google App Engine
This is Rietveld 408576698