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

Issue 386963003: [WIP][NotForLand] IDL dictionary support (Closed)

Created:
6 years, 5 months ago by bashi
Modified:
6 years ago
CC:
tasak (please_use_google.com)
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

[WIP][NotForReview] IDL dictionary support TODOs: - GN version. - Composite types (arrays and sequences) support - Nullable support - Inheritance support (For WebAnimation, WebCrypto) Usage examples: - core/dom/SomeDictionary{,User}.idl BUG=321462

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 93

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : #

Patch Set 10 : sequence and array support #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1199 lines, -77 lines) Patch
A LayoutTests/fast/dom/some-dictionary.html View 1 2 3 4 5 6 7 8 9 1 chunk +34 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/some-dictionary-expected.txt View 1 2 3 4 5 6 7 8 9 1 chunk +20 lines, -0 lines 0 comments Download
M Source/bindings/core/v8/DictionaryHelperForCore.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +30 lines, -0 lines 0 comments Download
M Source/bindings/core/v8/generated.gyp View 1 2 3 2 chunks +27 lines, -0 lines 0 comments Download
M Source/bindings/core/v8/generated.gypi View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
A Source/bindings/scripts/aggregate_generated_dictionaries.py View 1 2 3 4 5 6 1 chunk +61 lines, -0 lines 0 comments Download
M Source/bindings/scripts/code_generator_v8.py View 1 2 3 4 5 6 4 chunks +102 lines, -24 lines 0 comments Download
M Source/bindings/scripts/compute_interfaces_info_individual.py View 1 2 3 4 5 6 5 chunks +14 lines, -7 lines 0 comments Download
M Source/bindings/scripts/generate_global_constructors.py View 2 chunks +2 lines, -1 line 0 comments Download
M Source/bindings/scripts/idl_compiler.py View 1 2 3 4 5 6 4 chunks +13 lines, -13 lines 0 comments Download
M Source/bindings/scripts/idl_definitions.py View 2 chunks +6 lines, -2 lines 0 comments Download
M Source/bindings/scripts/idl_reader.py View 1 chunk +13 lines, -11 lines 0 comments Download
M Source/bindings/scripts/idl_types.py View 1 2 3 4 5 chunks +14 lines, -0 lines 0 comments Download
M Source/bindings/scripts/interface_dependency_resolver.py View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M Source/bindings/scripts/scripts.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M Source/bindings/scripts/utilities.py View 2 chunks +8 lines, -0 lines 0 comments Download
A Source/bindings/scripts/v8_dictionary.py View 1 2 3 4 5 6 7 8 9 1 chunk +167 lines, -0 lines 0 comments Download
M Source/bindings/scripts/v8_methods.py View 1 2 3 4 5 6 2 chunks +6 lines, -2 lines 0 comments Download
M Source/bindings/scripts/v8_types.py View 1 2 3 4 5 6 7 8 9 6 chunks +14 lines, -7 lines 0 comments Download
A Source/bindings/templates/dictionary_impl.h View 1 2 3 4 5 6 7 8 1 chunk +43 lines, -0 lines 0 comments Download
A Source/bindings/templates/dictionary_impl.cpp View 1 2 3 4 5 6 7 8 1 chunk +36 lines, -0 lines 0 comments Download
A Source/bindings/templates/dictionary_v8.h View 1 2 3 4 5 6 1 chunk +31 lines, -0 lines 0 comments Download
A Source/bindings/templates/dictionary_v8.cpp View 1 2 3 4 5 6 7 8 1 chunk +48 lines, -0 lines 0 comments Download
M Source/bindings/templates/templates.gypi View 1 chunk +4 lines, -0 lines 0 comments Download
A Source/bindings/tests/idls/TestDictionary.idl View 1 2 3 4 5 6 7 8 9 1 chunk +18 lines, -0 lines 0 comments Download
M Source/bindings/tests/idls/TestObject.idl View 1 2 chunks +4 lines, -10 lines 0 comments Download
A Source/bindings/tests/results/TestDictionary.h View 1 2 3 4 5 6 7 8 9 1 chunk +82 lines, -0 lines 0 comments Download
A Source/bindings/tests/results/TestDictionary.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +78 lines, -0 lines 0 comments Download
A Source/bindings/tests/results/V8TestDictionary.h View 1 2 3 4 5 6 1 chunk +31 lines, -0 lines 0 comments Download
A Source/bindings/tests/results/V8TestDictionary.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +92 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/V8TestObject.cpp View 1 2 3 4 5 6 3 chunks +67 lines, -0 lines 0 comments Download
M Source/core/core.gyp View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/core.gypi View 1 2 3 4 5 6 2 chunks +6 lines, -0 lines 0 comments Download
A Source/core/dom/SomeDictionary.idl View 1 2 3 4 5 6 7 8 9 1 chunk +13 lines, -0 lines 0 comments Download
A Source/core/dom/SomeDictionaryUser.h View 1 2 3 4 5 6 7 8 9 1 chunk +41 lines, -0 lines 0 comments Download
A Source/core/dom/SomeDictionaryUser.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +46 lines, -0 lines 0 comments Download
A Source/core/dom/SomeDictionaryUser.idl View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download
M Source/core/testing/Internals.h View 1 2 3 4 5 6 3 chunks +4 lines, -0 lines 0 comments Download
M Source/core/testing/Internals.cpp View 1 2 3 4 5 6 1 chunk +7 lines, -0 lines 0 comments Download
M Source/core/testing/Internals.idl View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
bashi
Haraken-san, Could you glance over this CL? This is a proof-of-concept patch for dictionary support. ...
6 years, 5 months ago (2014-07-18 09:58:53 UTC) #1
Nils Barth (inactive)
Bunch of Python nits, but overall looks structurally good! Key question to be careful of: ...
6 years, 5 months ago (2014-07-18 21:52:35 UTC) #2
haraken
Sorry about the review delay. Overall the approach looks good! https://codereview.chromium.org/386963003/diff/100001/Source/bindings/core/v8/DictionaryHelperForCore.cpp File Source/bindings/core/v8/DictionaryHelperForCore.cpp (right): https://codereview.chromium.org/386963003/diff/100001/Source/bindings/core/v8/DictionaryHelperForCore.cpp#newcode393 ...
6 years, 5 months ago (2014-07-21 16:11:59 UTC) #3
bashi
Thank you for detailed review, Nils and Haraken-san! > Key question to be careful of: ...
6 years, 5 months ago (2014-07-22 02:33:59 UTC) #4
haraken
> IIUC, if we change a dictionary IDL, we will try to re-generate all bindings ...
6 years, 5 months ago (2014-07-22 04:30:11 UTC) #5
bashi
> I'm just curious but why do we need to try to re-generate all bindings ...
6 years, 5 months ago (2014-07-22 05:57:35 UTC) #6
haraken
https://codereview.chromium.org/386963003/diff/100001/Source/bindings/tests/results/TestDictionary.h File Source/bindings/tests/results/TestDictionary.h (right): https://codereview.chromium.org/386963003/diff/100001/Source/bindings/tests/results/TestDictionary.h#newcode45 Source/bindings/tests/results/TestDictionary.h:45: bool m_hasBooleanMember; On 2014/07/22 05:57:35, bashi1 wrote: > On ...
6 years, 5 months ago (2014-07-22 07:23:19 UTC) #7
haraken
Either way I think this CL is mostly ready except for whether we can use ...
6 years, 5 months ago (2014-07-22 07:27:12 UTC) #8
bashi
FYI: Patch set 9 uses Nullable<T> for primitives. I noticed that modifying an IDL dictionary ...
6 years, 5 months ago (2014-07-23 03:50:06 UTC) #9
Nils Barth (inactive)
On 2014/07/23 03:50:06, bashi1 wrote: > FYI: Patch set 9 uses Nullable<T> for primitives. > ...
6 years, 5 months ago (2014-07-23 13:39:41 UTC) #10
Nils Barth (inactive)
On 2014/07/23 13:39:41, Nils Barth wrote: > On 2014/07/23 03:50:06, bashi1 wrote: > > FYI: ...
6 years, 5 months ago (2014-07-23 14:18:27 UTC) #11
bashi
On 2014/07/23 14:18:27, Nils Barth wrote: > On 2014/07/23 13:39:41, Nils Barth wrote: > > ...
6 years, 5 months ago (2014-07-24 23:58:52 UTC) #12
Nils Barth (inactive)
6 years, 5 months ago (2014-07-25 14:07:15 UTC) #13
On 2014/07/24 23:58:52, bashi1 wrote:
> Thank you so much for detailed proposals! They are really helpful.
> I like #1 and will try to do that.

No problem!

> One thing I'm getting stuck with the proposal
> is how I can specify sub directories for 'outputs' files.
> For bindings, We generate V8* files into the same directory (e.g.
> gen/blink/bindings/core/v8), so 'outputs' for binding rule can be written
like:
> 
>  '<(bindings_core_v8_output_dir)/V8<(RULE_INPUT_ROOT).cpp'
>  '<(bindings_core_v8_output_dir)/V8<(RULE_INPUT_ROOT).h'
> 
> On the other hand, we want to generate dictionary impls into their
corresponding
> directories. For example:
> - modules/webmidi/FooDictionary.idl ->
> gen/blink/modules/webmidi/FooDictionary.{cpp,h}
> - modules/serviceworkers/BarDictionary.idl ->
> gen/blink/modules/serviceworkers/BarDictionary.{cpp,h}
> 
> I need to figure out how I can specify sub directories in the rule.
> Investigating.

Easiest (and clearest!) way to do that is to have a GYP file in the directory in
question!
The idea is that the build files for each directory should be responsible for
what's generated in that directory.

E.g.,
modules/webmidi/generated.gyp:
'modules_webmidi_output_dir' = <(blink_output_dir)>/modules/webmidi

'dictionary_impl':
  (dictionary-generation-script)

This can be done with v. little duplication, by using a "template" for the GYP.

The other alternative is to just dump all dictionary impl files into the
component-specific output dir,
like gen/blink/core and gen/blink/modules.
...but that's admittedly a bit messy.

Powered by Google App Engine
This is Rietveld 408576698