|
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
Total comments: 3
|
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
|
Total messages: 39 (24 generated)
|