Chromium Code Reviews
DescriptionSimplify 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 #
Dependent Patchsets: Messages
Total messages: 21 (16 generated)
|
||||||||||||||||||||||||||||