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

Issue 2727803004: Replace string by enum in WebParsedFeaturePolicyDeclaration#feature (Closed)

Created:
3 years, 9 months ago by lunalu1
Modified:
3 years, 9 months ago
CC:
chromium-reviews, lunalu1, jam, dglazkov+blink, darin-cc_chromium.org, iclelland, blink-reviews, kinuko+watch, blink-reviews-api_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Initial Implementation of Iframe Attribute for Feature Policy (Part 3.a) Replace string by enum in WebParsedFeaturePolicyDeclaration#feature Use enum in WebParsedFeaturePolicyDeclaration for 2 reasons: 1. Memory efficient 2. Make code shareable for header policy and container policy Removed FeaturePolicy::Feature as we no longer need to store feature name (string) once the policy is parsed. Updated FeatureList (now a a mapping between feature to default policy) and tests as a result. Only downside is we no longer have explicit definition of each feature (e.g. kDocumentCookie{"cookie", EnableForAll}), we define the default policy directly in DefaultFeatureList feature is converted from string in parseFeaturePolicy now so we can drop the unrecognized features earlier instead of doing it in setHeaderPolicy BUG=682256 Review-Url: https://codereview.chromium.org/2727803004 Cr-Commit-Position: refs/heads/master@{#457884} Committed: https://chromium.googlesource.com/chromium/src/+/5fb4be2269ba2a16ebec49edf4f2817517f63ad5

Patch Set 1 #

Patch Set 2 : Set upstream #

Total comments: 5

Patch Set 3 : Removed FeaturePolicy::Feature as we don't need to store feature name(string) once features are par… #

Patch Set 4 : Filter out unrecognized features in parseFeaturePolicy (earlier) instead of setHeaderPolicy #

Total comments: 7

Patch Set 5 : Updated tests for parseFeaturePolicy #

Total comments: 1

Patch Set 6 : Codereview: remeve error message for unrecognized features in parser #

Total comments: 2

Patch Set 7 : Codereview: nit #

Total comments: 2

Patch Set 8 : Codereview: nit -- add comments to introduce features #

Unified diffs Side-by-side diffs Delta from patch set Stats (+158 lines, -209 lines) Patch
M content/browser/site_per_process_browsertest.cc View 1 2 3 4 5 6 7 7 chunks +19 lines, -17 lines 0 comments Download
M content/child/feature_policy/feature_policy_platform.cc View 1 2 3 4 5 2 chunks +2 lines, -3 lines 0 comments Download
M content/common/feature_policy/feature_policy.h View 1 2 3 4 5 6 7 3 chunks +5 lines, -19 lines 0 comments Download
M content/common/feature_policy/feature_policy.cc View 1 2 3 6 chunks +38 lines, -71 lines 0 comments Download
M content/common/feature_policy/feature_policy_unittest.cc View 1 2 31 chunks +63 lines, -69 lines 0 comments Download
M content/common/frame_messages.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h View 1 2 3 4 5 1 chunk +2 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp View 1 2 3 4 5 3 chunks +6 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp View 1 2 3 4 5 2 chunks +21 lines, -21 lines 0 comments Download
M third_party/WebKit/public/platform/WebFeaturePolicy.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 101 (68 generated)
lunalu1
3 years, 9 months ago (2017-03-02 20:56:19 UTC) #5
iclelland
This looks great! Just a couple of nits. Let's just make sure to hold off ...
3 years, 9 months ago (2017-03-06 13:55:59 UTC) #15
lunalu1
Could you PTAL? Thanks
3 years, 9 months ago (2017-03-07 15:43:10 UTC) #28
lunalu1
Could you PTAL? Thanks
3 years, 9 months ago (2017-03-07 15:43:14 UTC) #29
lunalu1
Hi Ian, After some thinking, I decided to remove FeaturePolicy::Feature (please see the issue description ...
3 years, 9 months ago (2017-03-08 19:56:27 UTC) #40
lunalu1
Hi, I added another change to filter out unrecognized features earlier that we don't need ...
3 years, 9 months ago (2017-03-09 01:12:42 UTC) #50
raymes
Looks good, just one question below. Thanks! https://codereview.chromium.org/2727803004/diff/180001/content/common/feature_policy/feature_policy.cc File content/common/feature_policy/feature_policy.cc (right): https://codereview.chromium.org/2727803004/diff/180001/content/common/feature_policy/feature_policy.cc#newcode133 content/common/feature_policy/feature_policy.cc:133: DCHECK(feature != ...
3 years, 9 months ago (2017-03-09 02:52:00 UTC) #56
lunalu1
Hi raymes@, thanks for reviewing my CL. Please see my comments below. Cheers https://codereview.chromium.org/2727803004/diff/180001/content/common/feature_policy/feature_policy.cc File ...
3 years, 9 months ago (2017-03-09 16:05:44 UTC) #58
raymes
lgtm https://codereview.chromium.org/2727803004/diff/180001/content/common/feature_policy/feature_policy.cc File content/common/feature_policy/feature_policy.cc (right): https://codereview.chromium.org/2727803004/diff/180001/content/common/feature_policy/feature_policy.cc#newcode133 content/common/feature_policy/feature_policy.cc:133: DCHECK(feature != blink::WebFeaturePolicyFeature::NotFound); On 2017/03/09 16:05:44, loonybear wrote: ...
3 years, 9 months ago (2017-03-12 23:43:39 UTC) #62
lunalu1
raymes LGTM'ed content/common/feature_policy/* and content/child_feature_policy/* nasko, could you please owner LGTM frame_messages.h pfeldman, could you ...
3 years, 9 months ago (2017-03-13 15:23:30 UTC) #64
nasko
On 2017/03/13 15:23:30, loonybear wrote: > raymes LGTM'ed content/common/feature_policy/* and > content/child_feature_policy/* > > nasko, ...
3 years, 9 months ago (2017-03-13 22:07:10 UTC) #65
iclelland
Other than the message, which I don't think should be an error, this LGTM https://codereview.chromium.org/2727803004/diff/200001/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp ...
3 years, 9 months ago (2017-03-15 15:33:02 UTC) #66
lunalu1
Done. Thanks pfeldman@ could you please owner LGTM? Thanks
3 years, 9 months ago (2017-03-15 16:09:30 UTC) #69
lunalu1
Done. Thanks pfeldman@ could you please owner LGTM? Thanks
3 years, 9 months ago (2017-03-15 16:09:34 UTC) #70
lunalu1
Done. Thanks pfeldman@ could you please owner LGTM? Thanks
3 years, 9 months ago (2017-03-15 16:09:35 UTC) #71
lunalu1
Done. Thanks pfeldman@ could you please owner LGTM? Thanks
3 years, 9 months ago (2017-03-15 16:09:35 UTC) #72
lunalu1
Done. Thanks pfeldman@ could you please owner LGTM? Thanks
3 years, 9 months ago (2017-03-15 16:09:38 UTC) #73
lunalu1
Done. Thanks pfeldman@ could you please owner LGTM? Thanks
3 years, 9 months ago (2017-03-15 16:09:41 UTC) #74
lunalu1
Done. Thanks pfeldman@ could you please owner LGTM? Thanks
3 years, 9 months ago (2017-03-15 16:09:41 UTC) #75
lunalu1
Done. Thanks pfeldman@ could you please owner LGTM? Thanks
3 years, 9 months ago (2017-03-15 16:09:41 UTC) #76
lunalu1
Done. Thanks pfeldman@ could you please owner LGTM? Thanks
3 years, 9 months ago (2017-03-15 16:09:41 UTC) #77
lunalu1
Done. Thanks pfeldman@ could you please owner LGTM? Thanks
3 years, 9 months ago (2017-03-15 16:09:42 UTC) #78
lunalu1
Done. Thanks pfeldman@ could you please owner LGTM? Thanks
3 years, 9 months ago (2017-03-15 16:09:42 UTC) #79
lunalu1
Done. Thanks pfeldman@ could you please owner LGTM? Thanks
3 years, 9 months ago (2017-03-15 16:09:42 UTC) #80
lunalu1
Done. Thanks pfeldman@ could you please owner LGTM? Thanks
3 years, 9 months ago (2017-03-15 16:09:43 UTC) #81
lunalu1
Ping Hi pfeldman and nasko, could you please owner lgtm? Thanks
3 years, 9 months ago (2017-03-16 21:58:48 UTC) #84
pfeldman
content/ and WebKit/ lgtm % nits https://codereview.chromium.org/2727803004/diff/220001/content/browser/site_per_process_browsertest.cc File content/browser/site_per_process_browsertest.cc (right): https://codereview.chromium.org/2727803004/diff/220001/content/browser/site_per_process_browsertest.cc#newcode720 content/browser/site_per_process_browsertest.cc:720: const blink::WebFeaturePolicyFeature feature, ...
3 years, 9 months ago (2017-03-17 01:12:21 UTC) #85
lunalu1
hi nasko, would you mind take a look at the ipc messages? Thanks
3 years, 9 months ago (2017-03-17 14:35:54 UTC) #88
nasko
IPC LGTM https://codereview.chromium.org/2727803004/diff/240001/content/common/feature_policy/feature_policy.h File content/common/feature_policy/feature_policy.h (left): https://codereview.chromium.org/2727803004/diff/240001/content/common/feature_policy/feature_policy.h#oldcode34 content/common/feature_policy/feature_policy.h:34: // Features nit: I don't understand why ...
3 years, 9 months ago (2017-03-17 16:35:56 UTC) #91
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/2727803004/240001
3 years, 9 months ago (2017-03-17 18:45:02 UTC) #94
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/2727803004/260001
3 years, 9 months ago (2017-03-17 18:51:59 UTC) #97
lunalu1
https://codereview.chromium.org/2727803004/diff/240001/content/common/feature_policy/feature_policy.h File content/common/feature_policy/feature_policy.h (left): https://codereview.chromium.org/2727803004/diff/240001/content/common/feature_policy/feature_policy.h#oldcode34 content/common/feature_policy/feature_policy.h:34: // Features On 2017/03/17 16:35:56, nasko (slow) wrote: > ...
3 years, 9 months ago (2017-03-17 18:52:55 UTC) #98
commit-bot: I haz the power
3 years, 9 months ago (2017-03-17 20:58:17 UTC) #101
Message was sent while issue was closed.
Committed patchset #8 (id:260001) as
https://chromium.googlesource.com/chromium/src/+/5fb4be2269ba2a16ebec49edf4f2...

Powered by Google App Engine
This is Rietveld 408576698