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

Issue 2970003002: Add code generation for ConditionalFeatures bindings code (Closed)

Created:
3 years, 5 months ago by iclelland
Modified:
3 years, 5 months ago
Reviewers:
tkent, Yuki, chasej, haraken, tasak, bashi
CC:
blink-reviews, blink-reviews-bindings_chromium.org, chasej+watch_chromium.org, chromium-reviews, haraken, iclelland+watch_chromium.org, loonybear
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add code generation for ConditionalFeatures bindings code This replaces the handwritten ConditionalFeaturesFor{Core,Modules}.cpp files with a script which reads IDL files looking for the appropriate extended attributes (just OriginTrialEnabled currently) and generates the required code to install those features at runtime. BUG=615060 Review-Url: https://codereview.chromium.org/2970003002 Cr-Commit-Position: refs/heads/master@{#487917} Committed: https://chromium.googlesource.com/chromium/src/+/d25397270d7f955de0988221f919a0b67f91f159

Patch Set 1 #

Patch Set 2 : Fix imports #

Patch Set 3 : Guard against unused variables #

Patch Set 4 : Read origin trial attributes directly from IDL files #

Patch Set 5 : Normalize info file path #

Patch Set 6 : Rebase #

Patch Set 7 : Add awful dep from core to modules to get it to compile from clean #

Patch Set 8 : Clean up #

Total comments: 21

Patch Set 9 : Clean up templates and build rules #

Patch Set 10 : Removing hacks, adding TODOs #

Patch Set 11 : Move awkward dependency into scripts.gni with its counterpart #

Total comments: 20

Patch Set 12 : Addressing style issues, refactor single-use class into functions #

Patch Set 13 : Make code generation testable, add to bindings tests #

Total comments: 10

Patch Set 14 : Style fixes #

Total comments: 8

Patch Set 15 : Readability fixes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+585 lines, -463 lines) Patch
M third_party/WebKit/Source/bindings/bindings.gni View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +14 lines, -1 line 0 comments Download
D third_party/WebKit/Source/bindings/core/v8/ConditionalFeaturesForCore.h View 1 chunk +0 lines, -25 lines 0 comments Download
D third_party/WebKit/Source/bindings/core/v8/ConditionalFeaturesForCore.cpp View 1 chunk +0 lines, -104 lines 0 comments Download
M third_party/WebKit/Source/bindings/modules/v8/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +14 lines, -1 line 0 comments Download
D third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.h View 1 chunk +0 lines, -14 lines 0 comments Download
D third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp View 1 chunk +0 lines, -239 lines 0 comments Download
M third_party/WebKit/Source/bindings/modules/v8/v8.gni View 1 chunk +0 lines, -2 lines 0 comments Download
A third_party/WebKit/Source/bindings/scripts/generate_conditional_features.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +232 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/scripts/scripts.gni View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +52 lines, -0 lines 0 comments Download
A + third_party/WebKit/Source/bindings/templates/ConditionalFeaturesForCore.cpp.tmpl View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +46 lines, -38 lines 0 comments Download
A + third_party/WebKit/Source/bindings/templates/ConditionalFeaturesForCore.h.tmpl View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +5 lines, -3 lines 0 comments Download
A third_party/WebKit/Source/bindings/templates/ConditionalFeaturesForModules.cpp.tmpl View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +95 lines, -0 lines 0 comments Download
A + third_party/WebKit/Source/bindings/templates/ConditionalFeaturesForModules.h.tmpl View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +5 lines, -3 lines 0 comments Download
A + third_party/WebKit/Source/bindings/tests/results/core/ConditionalFeaturesForCore.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +9 lines, -1 line 0 comments Download
A + third_party/WebKit/Source/bindings/tests/results/core/ConditionalFeaturesForCore.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +34 lines, -29 lines 0 comments Download
A + third_party/WebKit/Source/bindings/tests/results/modules/ConditionalFeaturesForModules.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +9 lines, -1 line 0 comments Download
A third_party/WebKit/Source/bindings/tests/results/modules/ConditionalFeaturesForModules.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +62 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Tools/Scripts/webkitpy/bindings/bindings_tests.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +6 lines, -0 lines 0 comments Download

Messages

Total messages: 87 (64 generated)
iclelland
+r chasej -- There are still a couple of things I'm not 100% happy with ...
3 years, 5 months ago (2017-07-10 14:59:17 UTC) #30
chasej
Aside from the hacks mentioned, it looks pretty good! Thanks for figuring this all out. ...
3 years, 5 months ago (2017-07-11 20:12:32 UTC) #33
iclelland
https://codereview.chromium.org/2970003002/diff/140001/third_party/WebKit/Source/bindings/scripts/generate_conditional_features.py File third_party/WebKit/Source/bindings/scripts/generate_conditional_features.py (right): https://codereview.chromium.org/2970003002/diff/140001/third_party/WebKit/Source/bindings/scripts/generate_conditional_features.py#newcode33 third_party/WebKit/Source/bindings/scripts/generate_conditional_features.py:33: "condition": 'OriginTrials::%sEnabled' % uncapitalize(feature_name), On 2017/07/11 20:12:31, chasej wrote: ...
3 years, 5 months ago (2017-07-12 17:23:21 UTC) #36
chasej
Looks good, with a minor comment/question. I'm guessing final l-g-t-m should wait until the two ...
3 years, 5 months ago (2017-07-12 19:53:41 UTC) #39
iclelland
+r jbroman -- could you take a look? Especially at the dep in scripts.gni on ...
3 years, 5 months ago (2017-07-13 15:32:59 UTC) #45
iclelland
Ahh, looks like jbroman is OOO for a bit. haraken@, do you know whether the ...
3 years, 5 months ago (2017-07-13 18:27:47 UTC) #49
haraken
> haraken@, do you know whether the Scripts->Modules DEP is intentional, or if > there ...
3 years, 5 months ago (2017-07-14 01:23:31 UTC) #51
bashi
https://codereview.chromium.org/2970003002/diff/200001/third_party/WebKit/Source/bindings/scripts/scripts.gni File third_party/WebKit/Source/bindings/scripts/scripts.gni (right): https://codereview.chromium.org/2970003002/diff/200001/third_party/WebKit/Source/bindings/scripts/scripts.gni#newcode487 third_party/WebKit/Source/bindings/scripts/scripts.gni:487: # http://crbug.com/358074 On 2017/07/14 01:23:30, haraken wrote: > > ...
3 years, 5 months ago (2017-07-14 02:15:17 UTC) #52
iclelland
On 2017/07/14 02:15:17, bashi wrote: > https://codereview.chromium.org/2970003002/diff/200001/third_party/WebKit/Source/bindings/scripts/scripts.gni > File third_party/WebKit/Source/bindings/scripts/scripts.gni (right): > > https://codereview.chromium.org/2970003002/diff/200001/third_party/WebKit/Source/bindings/scripts/scripts.gni#newcode487 > ...
3 years, 5 months ago (2017-07-14 02:50:56 UTC) #53
Yuki
Could you add support of "third_party/WebKit/Tools/Scripts/run-bindings-tests" ? If you can add a test .idl file ...
3 years, 5 months ago (2017-07-14 03:30:08 UTC) #54
iclelland
Thanks, Yuki -- I've addressed a number of your comments. I'm still looking at adding ...
3 years, 5 months ago (2017-07-14 18:25:05 UTC) #57
iclelland
On 2017/07/14 18:25:05, iclelland wrote: > Thanks, Yuki -- I've addressed a number of your ...
3 years, 5 months ago (2017-07-14 20:03:08 UTC) #60
Yuki
LGTM with style nits. https://codereview.chromium.org/2970003002/diff/240001/third_party/WebKit/Source/bindings/scripts/generate_conditional_features.py File third_party/WebKit/Source/bindings/scripts/generate_conditional_features.py (right): https://codereview.chromium.org/2970003002/diff/240001/third_party/WebKit/Source/bindings/scripts/generate_conditional_features.py#newcode19 third_party/WebKit/Source/bindings/scripts/generate_conditional_features.py:19: from code_generator import initialize_jinja_env, normalize_and_sort_includes, ...
3 years, 5 months ago (2017-07-15 12:09:20 UTC) #63
Yuki
Just FYI, You may have already noticed it, but just in case, https://chromium-review.googlesource.com/c/508328/ seems going ...
3 years, 5 months ago (2017-07-15 12:24:04 UTC) #64
iclelland
On 2017/07/15 12:24:04, Yuki wrote: > Just FYI, > > You may have already noticed ...
3 years, 5 months ago (2017-07-15 14:17:24 UTC) #65
iclelland
haraken, can you approve the changes in these build files? -- third_party/WebKit/Source/core/BUILD.gn -- third_party/WebKit/Source/modules/BUILD.gn tkent, ...
3 years, 5 months ago (2017-07-16 04:23:06 UTC) #69
haraken
This is nice! LGTM. https://codereview.chromium.org/2970003002/diff/260001/third_party/WebKit/Source/bindings/scripts/generate_conditional_features.py File third_party/WebKit/Source/bindings/scripts/generate_conditional_features.py (right): https://codereview.chromium.org/2970003002/diff/260001/third_party/WebKit/Source/bindings/scripts/generate_conditional_features.py#newcode36 third_party/WebKit/Source/bindings/scripts/generate_conditional_features.py:36: "v8_class_or_partial": interface_info[2]} What is [1] ...
3 years, 5 months ago (2017-07-17 07:28:17 UTC) #73
iclelland
https://codereview.chromium.org/2970003002/diff/260001/third_party/WebKit/Source/bindings/scripts/generate_conditional_features.py File third_party/WebKit/Source/bindings/scripts/generate_conditional_features.py (right): https://codereview.chromium.org/2970003002/diff/260001/third_party/WebKit/Source/bindings/scripts/generate_conditional_features.py#newcode36 third_party/WebKit/Source/bindings/scripts/generate_conditional_features.py:36: "v8_class_or_partial": interface_info[2]} On 2017/07/17 07:28:17, haraken wrote: > > ...
3 years, 5 months ago (2017-07-17 14:24:21 UTC) #76
chasej
lgtm
3 years, 5 months ago (2017-07-17 20:41:15 UTC) #79
iclelland
tkent, ping :)
3 years, 5 months ago (2017-07-18 13:24:32 UTC) #80
tkent
lgtm
3 years, 5 months ago (2017-07-18 22:30:31 UTC) #81
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/2970003002/280001
3 years, 5 months ago (2017-07-19 15:01:49 UTC) #84
commit-bot: I haz the power
3 years, 5 months ago (2017-07-19 18:13:35 UTC) #87
Message was sent while issue was closed.
Committed patchset #15 (id:280001) as
https://chromium.googlesource.com/chromium/src/+/d25397270d7f955de0988221f919...

Powered by Google App Engine
This is Rietveld 408576698