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

Issue 2723983004: Add PermissionManager::GetPermissionStatusForFrame function (Closed)

Created:
3 years, 9 months ago by raymes
Modified:
3 years, 9 months ago
CC:
chromium-reviews, mlamouri+watch-geolocation_chromium.org, toyoshim+midi_chromium.org, Peter Beverloo, chfremer+watch_chromium.org, mlamouri+watch-notifications_chromium.org, jam, raymes+watch_chromium.org, feature-media-reviews_chromium.org, mcasas+watch+vc_chromium.org, Michael van Ouwerkerk, mlamouri+watch-permissions_chromium.org, awdf+watch_chromium.org, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add PermissionManager::GetPermissionStatusForFrame function This adds a function to PermissionManager which allows checking the permission for a particular RenderFrameHost. Some permission checks depend on the exact context of the requesting frame. For example: -For permission delegation we need to know the FeaturePolicy associated with the frame, which is attached to the RenderFrameHost -Some ChromeOS media-related permission checks require the RenderFrameHost. These currently live in media_permissions.cc but it would be good to move them into the PermissionContext subclass. -Android permission checks currently require the WebContents in order to determine their state. A frame isn't always available when we want to determine the status of a permission, so when it's not available the old version of the function which takes in origins can be used. GetPermissionStatusForFrame should always perform more checks than GetPermissionStatus and tend to be used wherever possible. The RenderFrameHost is passed down to the PermissionContextBase::GetPermissionStatus. At this internal level of the code, its value may be nullptr if the call does not originate from a frame context. Subclasses should always check the RenderFrameHost before using it. TBR=peter@chromium.org,tommycli@chromium.org,xhwang@chromium.org,michaeln@chromium.org BUG=596786 Review-Url: https://codereview.chromium.org/2723983004 Cr-Commit-Position: refs/heads/master@{#455621} Committed: https://chromium.googlesource.com/chromium/src/+/f6104d499c9b96a1309360c378edfb24ad3d0028

Patch Set 1 #

Patch Set 2 : Add PermissionManager::GetPermissionStatusForFrame function #

Total comments: 3

Patch Set 3 : Add PermissionManager::GetPermissionStatusForFrame function #

Patch Set 4 : Add PermissionManager::GetPermissionStatusForFrame function #

Unified diffs Side-by-side diffs Delta from patch set Stats (+162 lines, -61 lines) Patch
M chrome/browser/geolocation/geolocation_permission_context_android.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/geolocation/geolocation_permission_context_android.cc View 1 2 3 2 chunks +5 lines, -3 lines 0 comments Download
M chrome/browser/media/midi_permission_context_unittest.cc View 1 chunk +6 lines, -2 lines 0 comments Download
M chrome/browser/media/protected_media_identifier_permission_context.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/media/protected_media_identifier_permission_context.cc View 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/media/webrtc/media_stream_device_permission_context.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/media/webrtc/media_stream_device_permission_context.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/media/webrtc/media_stream_device_permission_context_unittest.cc View 2 chunks +9 lines, -3 lines 0 comments Download
M chrome/browser/notifications/notification_permission_context.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/notifications/notification_permission_context.cc View 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/notifications/notification_permission_context_unittest.cc View 5 chunks +47 lines, -17 lines 0 comments Download
M chrome/browser/permissions/permission_context_base.h View 3 chunks +8 lines, -2 lines 0 comments Download
M chrome/browser/permissions/permission_context_base.cc View 4 chunks +7 lines, -4 lines 0 comments Download
M chrome/browser/permissions/permission_context_base_unittest.cc View 5 chunks +10 lines, -7 lines 0 comments Download
M chrome/browser/permissions/permission_manager.h View 1 2 chunks +13 lines, -0 lines 0 comments Download
M chrome/browser/permissions/permission_manager.cc View 1 2 chunks +32 lines, -11 lines 0 comments Download
M chrome/browser/plugins/flash_permission_context.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/plugins/flash_permission_context.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/storage/durable_storage_permission_context.cc View 1 chunk +8 lines, -6 lines 0 comments Download
M chrome/browser/storage/durable_storage_permission_context_unittest.cc View 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 39 (24 generated)
raymes
3 years, 9 months ago (2017-03-02 05:54:08 UTC) #2
dominickn
Looks pretty good to me. Thanks raymes! https://codereview.chromium.org/2723983004/diff/20001/chrome/browser/permissions/permission_manager.h File chrome/browser/permissions/permission_manager.h (right): https://codereview.chromium.org/2723983004/diff/20001/chrome/browser/permissions/permission_manager.h#newcode129 chrome/browser/permissions/permission_manager.h:129: PermissionResult GetPermissionStatusHelper( ...
3 years, 9 months ago (2017-03-02 06:54:33 UTC) #3
benwells
lgtm https://codereview.chromium.org/2723983004/diff/20001/chrome/browser/permissions/permission_manager.h File chrome/browser/permissions/permission_manager.h (right): https://codereview.chromium.org/2723983004/diff/20001/chrome/browser/permissions/permission_manager.h#newcode129 chrome/browser/permissions/permission_manager.h:129: PermissionResult GetPermissionStatusHelper( On 2017/03/02 06:54:33, dominickn wrote: > ...
3 years, 9 months ago (2017-03-02 07:33:05 UTC) #4
raymes
https://codereview.chromium.org/2723983004/diff/20001/chrome/browser/permissions/permission_manager.h File chrome/browser/permissions/permission_manager.h (right): https://codereview.chromium.org/2723983004/diff/20001/chrome/browser/permissions/permission_manager.h#newcode129 chrome/browser/permissions/permission_manager.h:129: PermissionResult GetPermissionStatusHelper( On 2017/03/02 07:33:05, benwells wrote: > On ...
3 years, 9 months ago (2017-03-07 02:31:15 UTC) #6
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/2723983004/40001
3 years, 9 months ago (2017-03-07 05:29:55 UTC) #13
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/379501)
3 years, 9 months ago (2017-03-07 05:39:32 UTC) #15
raymes
TBR OWNERs of client code: peter: chrome/browser/notifications/notification_permission_context.cc chrome/browser/notifications/notification_permission_context.h chrome/browser/notifications/notification_permission_context_unittest.cc tommycli: chrome/browser/plugins/flash_permission_context.cc chrome/browser/plugins/flash_permission_context.h xhwang: chrome/browser/media/midi_permission_context_unittest.cc chrome/browser/media/protected_media_identifier_permission_context.cc ...
3 years, 9 months ago (2017-03-07 06:12:14 UTC) #20
xhwang
A few comments for discussion: - MediaPermission exists because media/ doesn't depend on content/. So ...
3 years, 9 months ago (2017-03-07 06:28:17 UTC) #22
xhwang
On 2017/03/07 06:28:17, xhwang_slow wrote: > A few comments for discussion: > > - MediaPermission ...
3 years, 9 months ago (2017-03-07 06:32:12 UTC) #23
dcheng
I think this is a step in the right direction. Is there a plan for ...
3 years, 9 months ago (2017-03-07 08:25:00 UTC) #26
raymes
On 2017/03/07 06:28:17, xhwang_slow wrote: > A few comments for discussion: > > - MediaPermission ...
3 years, 9 months ago (2017-03-08 04:27:33 UTC) #30
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/2723983004/60001
3 years, 9 months ago (2017-03-08 04:27:53 UTC) #32
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/396761) win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, ...
3 years, 9 months ago (2017-03-08 04:30:39 UTC) #34
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/2723983004/60001
3 years, 9 months ago (2017-03-09 00:16:49 UTC) #36
commit-bot: I haz the power
3 years, 9 months ago (2017-03-09 01:22:15 UTC) #39
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/f6104d499c9b96a1309360c378ed...

Powered by Google App Engine
This is Rietveld 408576698