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

Issue 2254533002: [FeaturePolicy] Initial implementation of Feature Policy (Closed)

Created:
4 years, 4 months ago by iclelland
Modified:
4 years, 1 month ago
CC:
chromium-reviews, tyoshino+watch_chromium.org, mlamouri+watch-blink_chromium.org, sof, eae+blinkwatch, dcheng, blink-reviews-dom_chromium.org, dglazkov+blink, blink-reviews-bindings_chromium.org, gavinp+loader_chromium.org, blink-reviews, Nate Chapin, loading-reviews_chromium.org, rwlbuis, alexmos
Base URL:
https://chromium.googlesource.com/chromium/src.git@fp-flag
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[FeaturePolicy] Initial implementation of Feature Policy This CL adds to each frame (local or remote) a FeaturePolicy object, which can be used to control the exposure and behaviour of web platform features. A frame's policy is computed from the policy declared in the "Feature-Policy" HTTP header, it's parent frame's policy, and the default policy for each feature. See https://wicg.github.io/feature-policy/ for the specification in development. Three features from the specification are implemented with this CL: cookie, domain, and docwrite. (This behaviour is all conditional on the runtime flag for Feature Policy) Future CLs are going to implement: - <iframe> attribute support - Layout tests - Parser fuzzing - Control over additional features BUG=623682 Committed: https://crrev.com/7d15b7fc471b33e2d52a45876cb8323a4fb0e780 Cr-Commit-Position: refs/heads/master@{#429623}

Patch Set 1 #

Patch Set 2 : Rebase; Fix policy combination and inheritance rules. #

Patch Set 3 : Rebase #

Patch Set 4 : Rewrite for new whitelist-only algorithm; add tests #

Patch Set 5 : Remove overaggressive bool transform #

Total comments: 17

Patch Set 6 : Rebase #

Patch Set 7 : Fixes; nested by-default feature policy inheritance #

Patch Set 8 : Rebase, format #

Patch Set 9 : Remove unneeded includes #

Patch Set 10 : More closely follow the new algorithms for policy inheritance and resolution. #

Patch Set 11 : Simplify processing; rebase #

Patch Set 12 : Rebsae #

Patch Set 13 : Clean up; add remaining policy-controlled features #

Total comments: 51

Patch Set 14 : Addressing review comments #

Patch Set 15 : Conform to JFV spec for header format #

Total comments: 25

Patch Set 16 : Addressing review comments from PS#13 and #15 #

Total comments: 10

Patch Set 17 : Addressing comments from PS#16 #

Total comments: 3

Patch Set 18 : Don't leak FeaturePolicy objects #

Total comments: 12

Patch Set 19 : Addressing feedback from PS#18 #

Total comments: 6

Patch Set 20 : Rebase #

Patch Set 21 : Addressing nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1261 lines, -6 lines) Patch
M third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +41 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Document.idl View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/frame/Frame.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +10 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/Frame.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +20 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +3 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +192 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +260 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +702 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/network/HTTPNames.in View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/network/HTTPParsers.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2 chunks +9 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/network/HTTPParsers.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2 chunks +11 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 104 (69 generated)
iclelland
Mailing to interested parties as FYI
4 years, 3 months ago (2016-09-13 23:00:36 UTC) #23
igrigorik
The diagrams in the test cases are super-helpful. Great stuff :) This doesn't handle <meta> ...
4 years, 3 months ago (2016-09-15 23:37:35 UTC) #24
raymes
Ian, thanks so much for getting this going! https://codereview.chromium.org/2254533002/diff/80001/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp File third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp (right): https://codereview.chromium.org/2254533002/diff/80001/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp#newcode58 third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp:58: bool ...
4 years, 3 months ago (2016-09-19 09:19:05 UTC) #25
lunalu1
https://codereview.chromium.org/2254533002/diff/80001/third_party/WebKit/Source/core/loader/FrameLoader.cpp File third_party/WebKit/Source/core/loader/FrameLoader.cpp (right): https://codereview.chromium.org/2254533002/diff/80001/third_party/WebKit/Source/core/loader/FrameLoader.cpp#newcode529 third_party/WebKit/Source/core/loader/FrameLoader.cpp:529: if (!isLoadingMainFrame()) { Personal preference: FeaturePolicy::createFromParentPolicy(!isLoadingMainFrame() ? m_frame->client()->parent()->getFeaturePolicy() : ...
4 years, 3 months ago (2016-09-20 14:55:49 UTC) #27
iclelland
https://codereview.chromium.org/2254533002/diff/80001/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp File third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp (right): https://codereview.chromium.org/2254533002/diff/80001/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp#newcode58 third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp:58: bool FeaturePolicy::Whitelist::targets(const SecurityOrigin* origin) const On 2016/09/19 09:19:05, raymes ...
4 years, 2 months ago (2016-09-27 15:06:28 UTC) #30
raymes
https://codereview.chromium.org/2254533002/diff/80001/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp File third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp (right): https://codereview.chromium.org/2254533002/diff/80001/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp#newcode92 third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp:92: } Hmm, I'm still not sure I feel comfortable ...
4 years, 2 months ago (2016-09-29 07:17:00 UTC) #33
iclelland
https://codereview.chromium.org/2254533002/diff/80001/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp File third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp (right): https://codereview.chromium.org/2254533002/diff/80001/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp#newcode92 third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp:92: } On 2016/09/29 07:17:00, raymes wrote: > Hmm, I'm ...
4 years, 2 months ago (2016-09-30 15:39:26 UTC) #34
iclelland
raymes, can you PTAL again? The |createFromParentPolicy| and |isFeatureEnabledForOrigin| methods follow pretty closely the algorithms ...
4 years, 2 months ago (2016-10-14 19:37:49 UTC) #47
dcheng
https://codereview.chromium.org/2254533002/diff/240001/third_party/WebKit/Source/core/frame/Frame.h File third_party/WebKit/Source/core/frame/Frame.h (right): https://codereview.chromium.org/2254533002/diff/240001/third_party/WebKit/Source/core/frame/Frame.h#newcode115 third_party/WebKit/Source/core/frame/Frame.h:115: m_featurePolicy = newPolicy; What's the plan for remote frames? ...
4 years, 2 months ago (2016-10-14 20:33:17 UTC) #49
iclelland
https://codereview.chromium.org/2254533002/diff/240001/third_party/WebKit/Source/core/frame/Frame.h File third_party/WebKit/Source/core/frame/Frame.h (right): https://codereview.chromium.org/2254533002/diff/240001/third_party/WebKit/Source/core/frame/Frame.h#newcode115 third_party/WebKit/Source/core/frame/Frame.h:115: m_featurePolicy = newPolicy; On 2016/10/14 20:33:16, dcheng wrote: > ...
4 years, 2 months ago (2016-10-15 01:55:34 UTC) #50
raymes
Thanks Ian, I feel much better about this! :) I haven't re-reviewed the tests yet ...
4 years, 2 months ago (2016-10-18 02:42:31 UTC) #51
dcheng
https://codereview.chromium.org/2254533002/diff/240001/third_party/WebKit/Source/core/frame/Frame.h File third_party/WebKit/Source/core/frame/Frame.h (right): https://codereview.chromium.org/2254533002/diff/240001/third_party/WebKit/Source/core/frame/Frame.h#newcode115 third_party/WebKit/Source/core/frame/Frame.h:115: m_featurePolicy = newPolicy; On 2016/10/15 01:55:34, iclelland wrote: > ...
4 years, 2 months ago (2016-10-18 04:11:18 UTC) #52
iclelland
https://codereview.chromium.org/2254533002/diff/240001/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp File third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp (right): https://codereview.chromium.org/2254533002/diff/240001/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp#newcode89 third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp:89: // If there is no frame, or if feature ...
4 years, 2 months ago (2016-10-19 12:51:56 UTC) #57
raymes
Looks great! Mostly just nits now. https://codereview.chromium.org/2254533002/diff/240001/third_party/WebKit/Source/core/frame/Frame.h File third_party/WebKit/Source/core/frame/Frame.h (right): https://codereview.chromium.org/2254533002/diff/240001/third_party/WebKit/Source/core/frame/Frame.h#newcode115 third_party/WebKit/Source/core/frame/Frame.h:115: m_featurePolicy = newPolicy; ...
4 years, 2 months ago (2016-10-19 23:47:37 UTC) #62
dcheng
https://codereview.chromium.org/2254533002/diff/280001/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp File third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp (right): https://codereview.chromium.org/2254533002/diff/280001/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp#newcode88 third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp:88: const Frame* frame) { Make this a LocalFrame. https://codereview.chromium.org/2254533002/diff/280001/third_party/WebKit/Source/core/frame/Frame.h ...
4 years, 2 months ago (2016-10-20 17:41:44 UTC) #63
iclelland
https://codereview.chromium.org/2254533002/diff/240001/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h File third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h (right): https://codereview.chromium.org/2254533002/diff/240001/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h#newcode26 third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h:26: // Equivalent to ["self"]. The feature is enabled for ...
4 years, 2 months ago (2016-10-21 13:38:26 UTC) #66
raymes
https://codereview.chromium.org/2254533002/diff/300001/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp File third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp (right): https://codereview.chromium.org/2254533002/diff/300001/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp#newcode54 third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp:54: continue; // Whitelist is not an array; skip nit: ...
4 years, 2 months ago (2016-10-23 23:31:05 UTC) #69
iclelland
https://codereview.chromium.org/2254533002/diff/300001/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp File third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp (right): https://codereview.chromium.org/2254533002/diff/300001/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp#newcode54 third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp:54: continue; // Whitelist is not an array; skip On ...
4 years, 2 months ago (2016-10-24 05:14:32 UTC) #71
raymes
lgtm! Thanks! https://codereview.chromium.org/2254533002/diff/320001/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h File third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h (right): https://codereview.chromium.org/2254533002/diff/320001/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h#newcode52 third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h:52: // feature is available when no policy ...
4 years, 2 months ago (2016-10-24 06:51:45 UTC) #73
haraken
Would you help me understand your plan about the relationship between OriginTrial and FeaturePolicy in ...
4 years, 1 month ago (2016-10-24 08:51:19 UTC) #76
iclelland
On 2016/10/24 08:51:19, haraken wrote: > Would you help me understand your plan about the ...
4 years, 1 month ago (2016-10-24 14:23:12 UTC) #77
haraken
On 2016/10/24 14:23:12, iclelland wrote: > On 2016/10/24 08:51:19, haraken wrote: > > Would you ...
4 years, 1 month ago (2016-10-24 18:30:50 UTC) #82
iclelland
On 2016/10/24 18:30:50, haraken wrote: > On 2016/10/24 14:23:12, iclelland wrote: > > On 2016/10/24 ...
4 years, 1 month ago (2016-10-24 18:47:29 UTC) #83
haraken
On 2016/10/24 18:47:29, iclelland wrote: > On 2016/10/24 18:30:50, haraken wrote: > > On 2016/10/24 ...
4 years, 1 month ago (2016-10-24 18:53:19 UTC) #84
dcheng
Also, do you have an idea of how this data will be serialized so we ...
4 years, 1 month ago (2016-10-24 19:16:45 UTC) #85
raymes
> Also, do you have an idea of how this data will be serialized so ...
4 years, 1 month ago (2016-10-25 05:11:44 UTC) #86
raymes
> Also, do you have an idea of how this data will be serialized so ...
4 years, 1 month ago (2016-10-25 05:11:44 UTC) #87
iclelland
https://codereview.chromium.org/2254533002/diff/340001/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp File third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp (right): https://codereview.chromium.org/2254533002/diff/340001/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp#newcode45 third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp:45: frame = toDocument(executionContext)->executingFrame(); On 2016/10/24 19:16:45, dcheng wrote: > ...
4 years, 1 month ago (2016-10-25 18:34:33 UTC) #89
iclelland
On 2016/10/24 19:16:45, dcheng wrote: > Also, do you have an idea of how this ...
4 years, 1 month ago (2016-11-01 19:47:11 UTC) #93
raymes
> dcheng, is this CL blocked on support for OOPIF, or is it okay to ...
4 years, 1 month ago (2016-11-03 05:28:54 UTC) #94
dcheng
LGTM, I think it's fine to land it and implement OOPIF in followups. https://codereview.chromium.org/2254533002/diff/360001/third_party/WebKit/Source/core/frame/Frame.cpp File ...
4 years, 1 month ago (2016-11-03 05:54:43 UTC) #95
iclelland
https://codereview.chromium.org/2254533002/diff/360001/third_party/WebKit/Source/core/frame/Frame.cpp File third_party/WebKit/Source/core/frame/Frame.cpp (right): https://codereview.chromium.org/2254533002/diff/360001/third_party/WebKit/Source/core/frame/Frame.cpp#newcode330 third_party/WebKit/Source/core/frame/Frame.cpp:330: m_featurePolicy(nullptr) { On 2016/11/03 05:54:43, dcheng wrote: > Nit: ...
4 years, 1 month ago (2016-11-03 14:59:21 UTC) #96
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/2254533002/400001
4 years, 1 month ago (2016-11-03 15:08:34 UTC) #100
commit-bot: I haz the power
Committed patchset #21 (id:400001)
4 years, 1 month ago (2016-11-03 16:58:38 UTC) #102
commit-bot: I haz the power
4 years, 1 month ago (2016-11-03 17:13:19 UTC) #104
Message was sent while issue was closed.
Patchset 21 (id:??) landed as
https://crrev.com/7d15b7fc471b33e2d52a45876cb8323a4fb0e780
Cr-Commit-Position: refs/heads/master@{#429623}

Powered by Google App Engine
This is Rietveld 408576698