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

Issue 2898663002: Implement feature policy checks in the browser process (Closed)

Created:
3 years, 7 months ago by raymes
Modified:
3 years, 6 months ago
CC:
chromium-reviews, mcasas+geolocation_chromium.org, toyoshim+midi_chromium.org, mlamouri+watch-geolocation_chromium.org, feature-media-reviews_chromium.org, iclelland+watch_chromium.org, chfremer+watch_chromium.org, mlamouri+watch-notifications_chromium.org, jam, chasej+watch_chromium.org, raymes+watch_chromium.org, Peter Beverloo, darin-cc_chromium.org, jkarlin+watch_chromium.org, mlamouri+watch-permissions_chromium.org, awdf+watch_chromium.org, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement permissions feature policy checks in the browser process This adds feature policy checks for Geolocation, Midi/sysex, Protected media, and Mic/Camera to the browser process. These checks are also implemented in the content layer in the Permission Service (see https://codereview.chromium.org/2874053003/). The reason to have these checks implemented in the content/ layer is because they are standardized checks and we want to ensure that other embedders of content implement the same behavior. However there are 2 pitfalls to this: 1) The results returned from the permission service are used to make decisions in the renderer process and so are not trustworthy. Because of this, most features that have permission will add additional checks in the browser process. 2) The permission checks that happen in the browser process most often happen in the chrome/ layer (through the PermissionManager) so this is also where feature policy checks need to happen. In the long term, both chrome/ and content/ should make permission checks through the same API/mojo service where common permission checks like this one can live. BUG=689802 TBR=tommycli@chromium.org,peter@chromium.org Review-Url: https://codereview.chromium.org/2898663002 Cr-Commit-Position: refs/heads/master@{#475826} Committed: https://chromium.googlesource.com/chromium/src/+/21b9affc7f019d878b3118c2c0833822d78dfec4

Patch Set 1 #

Patch Set 2 : Implement feature policy checks in the browser process #

Patch Set 3 : Implement feature policy checks in the browser process #

Patch Set 4 : Implement feature policy checks in the browser process #

Patch Set 5 : Implement feature policy checks in the browser process #

Patch Set 6 : Implement feature policy checks in the browser process #

Patch Set 7 : Implement feature policy checks in the browser process #

Patch Set 8 : Implement feature policy checks in the browser process #

Total comments: 4

Patch Set 9 : Implement feature policy checks in the browser process #

Unified diffs Side-by-side diffs Delta from patch set Stats (+277 lines, -12 lines) Patch
M chrome/browser/background_sync/background_sync_permission_context.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/geolocation/geolocation_permission_context.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/media/midi_permission_context.cc View 1 2 3 4 5 6 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/media/midi_sysex_permission_context.cc View 1 2 3 4 5 6 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/media/protected_media_identifier_permission_context.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/media/webrtc/media_stream_device_permission_context.cc View 1 2 3 4 5 6 7 8 1 chunk +16 lines, -1 line 0 comments Download
M chrome/browser/notifications/notification_permission_context.cc View 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/permissions/permission_context_base.h View 1 4 chunks +6 lines, -1 line 0 comments Download
M chrome/browser/permissions/permission_context_base.cc View 1 2 3 4 5 6 7 4 chunks +27 lines, -1 line 0 comments Download
A chrome/browser/permissions/permission_context_base_feature_policy_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +178 lines, -0 lines 0 comments Download
M chrome/browser/permissions/permission_context_base_unittest.cc View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/plugins/flash_permission_context.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/storage/durable_storage_permission_context.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/test/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M content/public/common/content_features.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M content/public/common/content_features.cc View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M content/public/test/test_renderer_host.h View 1 2 3 4 5 6 7 8 1 chunk +8 lines, -0 lines 0 comments Download
M content/test/test_render_frame_host.h View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -0 lines 0 comments Download
M content/test/test_render_frame_host.cc View 1 2 3 4 5 6 7 8 1 chunk +10 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 38 (27 generated)
raymes
3 years, 7 months ago (2017-05-24 03:33:25 UTC) #8
Timothy Loh
On 2017/05/24 03:33:25, raymes wrote: lgtm
3 years, 7 months ago (2017-05-26 06:30:33 UTC) #18
raymes
+alexmos: could you ptal at the changes in content/ to make the tests possible? Thanks!
3 years, 6 months ago (2017-05-29 00:31:53 UTC) #20
raymes
TBR OWNERS of client code michaeln: chrome/browser/storage/durable_storage_permission_context.cc tommycli: chrome/browser/plugins/flash_permission_context.cc sergeyu: chrome/browser/media/midi_permission_context.cc chrome/browser/media/midi_sysex_permission_context.cc chrome/browser/media/protected_media_identifier_permission_context.cc peter: chrome/browser/notifications/notification_permission_context.cc ...
3 years, 6 months ago (2017-05-29 00:41:10 UTC) #22
iclelland
On 2017/05/29 00:41:10, raymes wrote: > TBR OWNERS of client code > iclelland: > chrome/browser/background_sync/background_sync_permission_context.cc ...
3 years, 6 months ago (2017-05-30 15:09:02 UTC) #27
Sergey Ulanov
chrome/browser/media lgtm https://codereview.chromium.org/2898663002/diff/140001/chrome/browser/media/webrtc/media_stream_device_permission_context.cc File chrome/browser/media/webrtc/media_stream_device_permission_context.cc (right): https://codereview.chromium.org/2898663002/diff/140001/chrome/browser/media/webrtc/media_stream_device_permission_context.cc#newcode23 chrome/browser/media/webrtc/media_stream_device_permission_context.cc:23: } else { No else after return, ...
3 years, 6 months ago (2017-05-30 18:21:07 UTC) #28
alexmos
content/ LGTM https://codereview.chromium.org/2898663002/diff/140001/content/public/test/test_renderer_host.h File content/public/test/test_renderer_host.h (right): https://codereview.chromium.org/2898663002/diff/140001/content/public/test/test_renderer_host.h#newcode147 content/public/test/test_renderer_host.h:147: virtual void SetFeaturePolicyHeader( nit: SimulateFeaturePolicyHeader might be ...
3 years, 6 months ago (2017-05-30 20:37:57 UTC) #29
michaeln
r/s lgtm
3 years, 6 months ago (2017-05-30 22:49:00 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/2898663002/160001
3 years, 6 months ago (2017-05-31 04:46:34 UTC) #34
commit-bot: I haz the power
Committed patchset #9 (id:160001) as https://chromium.googlesource.com/chromium/src/+/21b9affc7f019d878b3118c2c0833822d78dfec4
3 years, 6 months ago (2017-05-31 06:15:41 UTC) #37
raymes
3 years, 6 months ago (2017-05-31 07:07:54 UTC) #38
Message was sent while issue was closed.
https://codereview.chromium.org/2898663002/diff/140001/chrome/browser/media/w...
File chrome/browser/media/webrtc/media_stream_device_permission_context.cc
(right):

https://codereview.chromium.org/2898663002/diff/140001/chrome/browser/media/w...
chrome/browser/media/webrtc/media_stream_device_permission_context.cc:23: } else
{
On 2017/05/30 18:21:06, Sergey Ulanov wrote:
> No else after return, please
> https://chromium.googlesource.com/chromium/src/+/master/styleguide/c++/c++.md
> 
> Or alternatively use switch statement here

Done.

https://codereview.chromium.org/2898663002/diff/140001/content/public/test/te...
File content/public/test/test_renderer_host.h (right):

https://codereview.chromium.org/2898663002/diff/140001/content/public/test/te...
content/public/test/test_renderer_host.h:147: virtual void
SetFeaturePolicyHeader(
On 2017/05/30 20:37:57, alexmos wrote:
> nit: SimulateFeaturePolicyHeader might be more consistent with other function
> names here.

Done.

Powered by Google App Engine
This is Rietveld 408576698