New issue
Advanced search Search tips

Issue 888668 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 22
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac , Fuchsia
Pri: 3
Type: Task



Sign in to add a comment

Feature policy cleanup: Move methods from Frame to Document

Project Member Reported by iclell...@chromium.org, Sep 24

Issue description

Feature Policy is properly associated with a document, rather than a frame. The methods which currently exist on Frame and LocalFrame should be moved to SecurityContext and Document as necessary.

(From crrev.com/c/1241194:)

I think the methods were on Frame originally so that remote frames could be queried as easily as localframes, but a) that has mostly not happened, and b) RemoteSecurityContext works just as well for that use case if necessary.

FP is defined as being a property of Documents in the spec now; using SecurityContext makes sense:
 - As a parent class of Document
 - It's the location of the policy object in memory already
 - It will make it easier in the future to extend this to non-document contexts, such as workers.
 
Description: Show this description
Project Member

Comment 2 by bugdroid1@chromium.org, Sep 25

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/66fed53701e52753ebd138304db2d844d8e5f112

commit 66fed53701e52753ebd138304db2d844d8e5f112
Author: Ian Clelland <iclelland@chromium.org>
Date: Tue Sep 25 18:50:52 2018

Mark feature policy methods on frame deprecated

Feature Policy is properly associated with a document, rather than a
frame. This series of CLs moves both the feature enabled check and the
reporting methods from Frame/LocalFrame to SecurityContext/Document.

This mechanical CL renames the existing methods to mark them as
deprecated. Follow-up CLs will implement the new methods and change call
sites to use those instead.

Bug:  888668 
Cq-Include-Trybots: luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I3511a6299c9582175412463d43521c3578db27c2
Reviewed-on: https://chromium-review.googlesource.com/1240857
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Commit-Queue: Ian Clelland <iclelland@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594026}
[modify] https://crrev.com/66fed53701e52753ebd138304db2d844d8e5f112/third_party/blink/renderer/core/animation/css_interpolation_types_map.cc
[modify] https://crrev.com/66fed53701e52753ebd138304db2d844d8e5f112/third_party/blink/renderer/core/dom/document.cc
[modify] https://crrev.com/66fed53701e52753ebd138304db2d844d8e5f112/third_party/blink/renderer/core/frame/deprecation.cc
[modify] https://crrev.com/66fed53701e52753ebd138304db2d844d8e5f112/third_party/blink/renderer/core/frame/device_single_window_event_controller.cc
[modify] https://crrev.com/66fed53701e52753ebd138304db2d844d8e5f112/third_party/blink/renderer/core/frame/frame.cc
[modify] https://crrev.com/66fed53701e52753ebd138304db2d844d8e5f112/third_party/blink/renderer/core/frame/frame.h
[modify] https://crrev.com/66fed53701e52753ebd138304db2d844d8e5f112/third_party/blink/renderer/core/frame/local_frame.cc
[modify] https://crrev.com/66fed53701e52753ebd138304db2d844d8e5f112/third_party/blink/renderer/core/frame/local_frame.h
[modify] https://crrev.com/66fed53701e52753ebd138304db2d844d8e5f112/third_party/blink/renderer/core/fullscreen/fullscreen.cc
[modify] https://crrev.com/66fed53701e52753ebd138304db2d844d8e5f112/third_party/blink/renderer/core/html/media/autoplay_policy.cc
[modify] https://crrev.com/66fed53701e52753ebd138304db2d844d8e5f112/third_party/blink/renderer/core/html/media/media_element_parser_helpers.cc
[modify] https://crrev.com/66fed53701e52753ebd138304db2d844d8e5f112/third_party/blink/renderer/core/layout/layout_image.cc
[modify] https://crrev.com/66fed53701e52753ebd138304db2d844d8e5f112/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.cc
[modify] https://crrev.com/66fed53701e52753ebd138304db2d844d8e5f112/third_party/blink/renderer/modules/encryptedmedia/navigator_request_media_key_system_access.cc
[modify] https://crrev.com/66fed53701e52753ebd138304db2d844d8e5f112/third_party/blink/renderer/modules/geolocation/geolocation.cc
[modify] https://crrev.com/66fed53701e52753ebd138304db2d844d8e5f112/third_party/blink/renderer/modules/mediastream/user_media_request.cc
[modify] https://crrev.com/66fed53701e52753ebd138304db2d844d8e5f112/third_party/blink/renderer/modules/payments/payment_request.cc
[modify] https://crrev.com/66fed53701e52753ebd138304db2d844d8e5f112/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_controller_impl.cc
[modify] https://crrev.com/66fed53701e52753ebd138304db2d844d8e5f112/third_party/blink/renderer/modules/sensor/sensor.cc
[modify] https://crrev.com/66fed53701e52753ebd138304db2d844d8e5f112/third_party/blink/renderer/modules/vr/navigator_vr.cc
[modify] https://crrev.com/66fed53701e52753ebd138304db2d844d8e5f112/third_party/blink/renderer/modules/webmidi/navigator_web_midi.cc
[modify] https://crrev.com/66fed53701e52753ebd138304db2d844d8e5f112/third_party/blink/renderer/modules/webusb/usb.cc
[modify] https://crrev.com/66fed53701e52753ebd138304db2d844d8e5f112/third_party/blink/renderer/modules/xr/xr.cc

Project Member

Comment 3 by bugdroid1@chromium.org, Sep 25

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e9937698d9346004e88fef942f314b864ca3621a

commit e9937698d9346004e88fef942f314b864ca3621a
Author: Ian Clelland <iclelland@chromium.org>
Date: Tue Sep 25 20:10:20 2018

Move Feature Policy methods from Frame/LocalFrame to SecurityContext/Document

This CL moves the functionality that previously existed in
Frame::IsFeatureEnabled to SecurityContext, and from
LocalFrame::ReportFeaturePolicyViolation to Document. The existing
Deprecated* methods are changed to defer to these new locations.

Bug:  888668 
Change-Id: I2b926a88e9ac5c8428d4dc3cd4b3764b11f6d90d
Reviewed-on: https://chromium-review.googlesource.com/1241194
Commit-Queue: Ian Clelland <iclelland@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594074}
[modify] https://crrev.com/e9937698d9346004e88fef942f314b864ca3621a/third_party/blink/renderer/core/dom/document.cc
[modify] https://crrev.com/e9937698d9346004e88fef942f314b864ca3621a/third_party/blink/renderer/core/dom/document.h
[modify] https://crrev.com/e9937698d9346004e88fef942f314b864ca3621a/third_party/blink/renderer/core/execution_context/security_context.cc
[modify] https://crrev.com/e9937698d9346004e88fef942f314b864ca3621a/third_party/blink/renderer/core/execution_context/security_context.h
[modify] https://crrev.com/e9937698d9346004e88fef942f314b864ca3621a/third_party/blink/renderer/core/frame/frame.cc
[modify] https://crrev.com/e9937698d9346004e88fef942f314b864ca3621a/third_party/blink/renderer/core/frame/frame.h
[modify] https://crrev.com/e9937698d9346004e88fef942f314b864ca3621a/third_party/blink/renderer/core/frame/local_frame.cc
[modify] https://crrev.com/e9937698d9346004e88fef942f314b864ca3621a/third_party/blink/renderer/core/frame/local_frame.h
[modify] https://crrev.com/e9937698d9346004e88fef942f314b864ca3621a/third_party/blink/renderer/core/frame/reporting_context.h

Project Member

Comment 4 by bugdroid1@chromium.org, Sep 25

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b14d32dbfd04a2b1bace392d35d5780550eed95c

commit b14d32dbfd04a2b1bace392d35d5780550eed95c
Author: Ian Clelland <iclelland@chromium.org>
Date: Tue Sep 25 21:16:48 2018

Move Feature Policy checks from Frame to Document

This CL handles the features which are trivially migratable from
calling (Deprecated)IsFeatureEnabled on Frame to calling the equivalent
method on Document.

Bug:  888668 
Cq-Include-Trybots: luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: If7c548afd9974f83c86cbcb9876cb51654bb3267
Reviewed-on: https://chromium-review.googlesource.com/1243365
Commit-Queue: Ian Clelland <iclelland@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594103}
[modify] https://crrev.com/b14d32dbfd04a2b1bace392d35d5780550eed95c/third_party/blink/renderer/core/animation/css_interpolation_types_map.cc
[modify] https://crrev.com/b14d32dbfd04a2b1bace392d35d5780550eed95c/third_party/blink/renderer/core/frame/deprecation.cc
[modify] https://crrev.com/b14d32dbfd04a2b1bace392d35d5780550eed95c/third_party/blink/renderer/core/frame/device_single_window_event_controller.cc
[modify] https://crrev.com/b14d32dbfd04a2b1bace392d35d5780550eed95c/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.cc
[modify] https://crrev.com/b14d32dbfd04a2b1bace392d35d5780550eed95c/third_party/blink/renderer/modules/encryptedmedia/navigator_request_media_key_system_access.cc
[modify] https://crrev.com/b14d32dbfd04a2b1bace392d35d5780550eed95c/third_party/blink/renderer/modules/geolocation/geolocation.cc
[modify] https://crrev.com/b14d32dbfd04a2b1bace392d35d5780550eed95c/third_party/blink/renderer/modules/mediastream/user_media_request.cc
[modify] https://crrev.com/b14d32dbfd04a2b1bace392d35d5780550eed95c/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_controller_impl.cc
[modify] https://crrev.com/b14d32dbfd04a2b1bace392d35d5780550eed95c/third_party/blink/renderer/modules/sensor/sensor.cc
[modify] https://crrev.com/b14d32dbfd04a2b1bace392d35d5780550eed95c/third_party/blink/renderer/modules/vr/navigator_vr.cc
[modify] https://crrev.com/b14d32dbfd04a2b1bace392d35d5780550eed95c/third_party/blink/renderer/modules/webmidi/navigator_web_midi.cc
[modify] https://crrev.com/b14d32dbfd04a2b1bace392d35d5780550eed95c/third_party/blink/renderer/modules/xr/xr.cc

Project Member

Comment 5 by bugdroid1@chromium.org, Oct 2

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a166dc7af6b5867b4ba9804c8dd3874b9f4970dc

commit a166dc7af6b5867b4ba9804c8dd3874b9f4970dc
Author: Kent Tamura <tkent@chromium.org>
Date: Tue Oct 02 08:11:56 2018

Reduce the size of security_context.h

security_context.h is used in 2,700+ compilation units. crrev.com/594074
increased its pre-processed size by 1.32MB, and this CL fixes it.

Bug: 242216,  888668 
Change-Id: I623ad22e5351328f934a0b1cd7caece6b4b07944
Reviewed-on: https://chromium-review.googlesource.com/1256470
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595757}
[modify] https://crrev.com/a166dc7af6b5867b4ba9804c8dd3874b9f4970dc/third_party/blink/renderer/core/execution_context/security_context.h

Project Member

Comment 6 by bugdroid1@chromium.org, Oct 3

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/980885c6990b671fb71798693e2fe12cb5f09ff5

commit 980885c6990b671fb71798693e2fe12cb5f09ff5
Author: Ian Clelland <iclelland@chromium.org>
Date: Wed Oct 03 19:14:01 2018

Move WebUSB feature policy checks to Document

Bug:  888668 
Change-Id: Iddc72d0638ddebbab044f070237d6bd885c557aa
Reviewed-on: https://chromium-review.googlesource.com/c/1243523
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Ian Clelland <iclelland@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596314}
[modify] https://crrev.com/980885c6990b671fb71798693e2fe12cb5f09ff5/third_party/blink/renderer/modules/webusb/usb.cc

Project Member

Comment 7 by bugdroid1@chromium.org, Oct 3

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f688b327917ab525ec0727b59ace8ef20ebc2e1b

commit f688b327917ab525ec0727b59ace8ef20ebc2e1b
Author: Ian Clelland <iclelland@chromium.org>
Date: Wed Oct 03 19:14:09 2018

Move PaymentRequest feature policy checks to Document

Bug:  888668 
Change-Id: I2ca249628b9395480f5dfcaaf2b300046dba9b2c
Reviewed-on: https://chromium-review.googlesource.com/c/1243503
Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org>
Commit-Queue: Ian Clelland <iclelland@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596315}
[modify] https://crrev.com/f688b327917ab525ec0727b59ace8ef20ebc2e1b/third_party/blink/renderer/modules/payments/payment_request.cc

Project Member

Comment 8 by bugdroid1@chromium.org, Oct 4

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1358cf0c7eae73294140d167b0c59690b48b4fbe

commit 1358cf0c7eae73294140d167b0c59690b48b4fbe
Author: Ian Clelland <iclelland@chromium.org>
Date: Thu Oct 04 04:39:44 2018

Move Autoplay feature policy checks to Document

Bug:  888668 
Change-Id: I1ba1e04b8f5853e449d8a1316f6322d5839ed1b5
Reviewed-on: https://chromium-review.googlesource.com/c/1243524
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Commit-Queue: Ian Clelland <iclelland@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596503}
[modify] https://crrev.com/1358cf0c7eae73294140d167b0c59690b48b4fbe/third_party/blink/renderer/core/html/media/autoplay_policy.cc

Project Member

Comment 9 by bugdroid1@chromium.org, Oct 5

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d6b169ed9425317c9cc937fa4ef84cfa7c7d6cdc

commit d6b169ed9425317c9cc937fa4ef84cfa7c7d6cdc
Author: Ian Clelland <iclelland@chromium.org>
Date: Fri Oct 05 03:14:38 2018

Move Fullscreen feature policy checks to Document

Bug:  888668 
Change-Id: I7afdab5a71a6650b218e5fc16c930103d3069938
Reviewed-on: https://chromium-review.googlesource.com/c/1243114
Reviewed-by: Philip Jägenstedt <foolip@chromium.org>
Commit-Queue: Ian Clelland <iclelland@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596977}
[modify] https://crrev.com/d6b169ed9425317c9cc937fa4ef84cfa7c7d6cdc/third_party/blink/renderer/core/fullscreen/fullscreen.cc

 Issue 878861  has been merged into this issue.
Project Member

Comment 11 by bugdroid1@chromium.org, Nov 13

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/849358eddc6f4216832a85a74635c1682e34838e

commit 849358eddc6f4216832a85a74635c1682e34838e
Author: Ian Clelland <iclelland@chromium.org>
Date: Tue Nov 13 18:21:35 2018

Move feature policy checks for Image policies

This CL moves the IsFeatureAllowed checks for image policies
from the old location on Frame to the new methods on Document.

Bug:  888668 
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I3d44ce3f0263e2b9f3dec3f33f2a9c89f57f76ab
Reviewed-on: https://chromium-review.googlesource.com/c/1243168
Reviewed-by: Luna Lu <loonybear@chromium.org>
Reviewed-by: Steve Kobes <skobes@chromium.org>
Commit-Queue: Ian Clelland <iclelland@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607660}
[modify] https://crrev.com/849358eddc6f4216832a85a74635c1682e34838e/third_party/blink/renderer/core/html/html_image_element.cc
[modify] https://crrev.com/849358eddc6f4216832a85a74635c1682e34838e/third_party/blink/renderer/core/html/media/html_video_element.cc
[modify] https://crrev.com/849358eddc6f4216832a85a74635c1682e34838e/third_party/blink/renderer/core/html/media/media_element_parser_helpers.cc
[modify] https://crrev.com/849358eddc6f4216832a85a74635c1682e34838e/third_party/blink/renderer/core/html/media/media_element_parser_helpers.h
[modify] https://crrev.com/849358eddc6f4216832a85a74635c1682e34838e/third_party/blink/renderer/core/layout/layout_image.cc
[modify] https://crrev.com/849358eddc6f4216832a85a74635c1682e34838e/third_party/blink/renderer/core/svg/svg_image_element.cc

Status: Fixed (was: Started)

Sign in to add a comment