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

Issue 409373002: IDL: Binding code generation for dictionaries (Closed)

Created:
6 years, 5 months ago by bashi
Modified:
6 years, 5 months ago
CC:
blink-reviews, blink-reviews-bindings_chromium.org, arv+blink, abarth-chromium
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

IDL: Binding code generation for dictionaries This CL adds V8 binding code generation for IDL dictionaries. - Each dictionary will have its own IDL file because we generate binding code from dedicated template(dictionary_v8.{cpp,h}). - Generated binding will contain toV8() and toNative() functions. They are similar to interfaces' toV8() and toNative(), but there are a little differences. toV8() never creates a wrapper object. It always returns a new V8 object. Similarly, toNative() always creates a new DOM object. This behavior should confirm that dictionaries are passed by value. - IDL dictionaries are required to be GarbageCollected because we don't want to add further Oilpan transition pain. - This CL removes TestDictDerived. We are currently not supporting inheritance. - Modified IdlDictionary and IdlDictionaryMember to code generation work. - Added "is_dictionary" flag to interfaces_info so that the code generator can handle IDL dictionary correctly. - Added "is_dictionary" property to IdlType. This is needed for binding code generation. - Added v8_dictionary.py. This creates template context for dictionaries. Generated binding code won't be able to compile at this point. We need DOM implementation. In follow-up CLs, we are planning to auto-generate DOM implementation. BUG=321462 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=178894

Patch Set 1 #

Total comments: 22

Patch Set 2 : #

Total comments: 2

Patch Set 3 : #

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+397 lines, -46 lines) Patch
M Source/bindings/scripts/code_generator_v8.py View 1 4 chunks +57 lines, -20 lines 0 comments Download
M Source/bindings/scripts/compute_interfaces_info_individual.py View 2 chunks +3 lines, -2 lines 0 comments Download
M Source/bindings/scripts/idl_definitions.py View 2 chunks +9 lines, -3 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 5 chunks +14 lines, -0 lines 0 comments Download
M Source/bindings/scripts/interface_dependency_resolver.py View 1 chunk +3 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 1 chunk +5 lines, -0 lines 0 comments Download
A Source/bindings/scripts/v8_dictionary.py View 1 2 1 chunk +89 lines, -0 lines 0 comments Download
M Source/bindings/scripts/v8_types.py View 1 chunk +2 lines, -0 lines 0 comments Download
A Source/bindings/templates/dictionary_v8.h View 1 2 3 1 chunk +31 lines, -0 lines 0 comments Download
A Source/bindings/templates/dictionary_v8.cpp View 1 1 chunk +48 lines, -0 lines 0 comments Download
M Source/bindings/templates/templates.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
A Source/bindings/tests/idls/TestDictionary.idl View 1 1 chunk +14 lines, -0 lines 0 comments Download
M Source/bindings/tests/idls/TestObject.idl View 1 chunk +0 lines, -10 lines 0 comments Download
A Source/bindings/tests/results/V8TestDictionary.h View 1 2 3 1 chunk +31 lines, -0 lines 0 comments Download
A Source/bindings/tests/results/V8TestDictionary.cpp View 1 2 1 chunk +75 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
bashi
Haraken-san, Sakamoto-san, PTAL? This becomes unexpectedly large CL. I may be able to make this ...
6 years, 5 months ago (2014-07-23 10:04:04 UTC) #1
haraken
LGTM https://codereview.chromium.org/409373002/diff/1/Source/bindings/scripts/v8_dictionary.py File Source/bindings/scripts/v8_dictionary.py (right): https://codereview.chromium.org/409373002/diff/1/Source/bindings/scripts/v8_dictionary.py#newcode15 Source/bindings/scripts/v8_dictionary.py:15: DICTIONARY_H_INCLUDES_V8 = frozenset([ DICTIONARY_H_INCLUDES_V8 => DICTIONARY_H_INCLUDES (for consistency ...
6 years, 5 months ago (2014-07-23 15:49:01 UTC) #2
jsbell
Do you have a design doc or rough sketch of what the API of the ...
6 years, 5 months ago (2014-07-23 16:44:28 UTC) #3
bashi
@haraken, thank you for the review! Could you take another look? There is a minor ...
6 years, 5 months ago (2014-07-25 01:59:03 UTC) #4
haraken
Still LGTM. It looks good to land this and iterate! https://codereview.chromium.org/409373002/diff/1/Source/bindings/templates/dictionary_v8.h File Source/bindings/templates/dictionary_v8.h (right): https://codereview.chromium.org/409373002/diff/1/Source/bindings/templates/dictionary_v8.h#newcode21 ...
6 years, 5 months ago (2014-07-25 02:09:47 UTC) #5
bashi
https://codereview.chromium.org/409373002/diff/1/Source/bindings/templates/dictionary_v8.h File Source/bindings/templates/dictionary_v8.h (right): https://codereview.chromium.org/409373002/diff/1/Source/bindings/templates/dictionary_v8.h#newcode21 Source/bindings/templates/dictionary_v8.h:21: v8::Handle<v8::Value> toV8({{cpp_class}}*, v8::Handle<v8::Object> creationContext, v8::Isolate*); On 2014/07/25 02:09:46, haraken ...
6 years, 5 months ago (2014-07-25 02:18:06 UTC) #6
bashi
The CQ bit was checked by bashi@chromium.org
6 years, 5 months ago (2014-07-25 02:18:10 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bashi@chromium.org/409373002/60001
6 years, 5 months ago (2014-07-25 02:19:12 UTC) #8
commit-bot: I haz the power
Change committed as 178894
6 years, 5 months ago (2014-07-25 03:22:01 UTC) #9
jsbell
On 2014/07/25 01:59:03, bashi1 wrote: > @jsbell, thanks for your interest. > > Could you ...
6 years, 5 months ago (2014-07-25 17:20:35 UTC) #10
bashi
6 years, 5 months ago (2014-07-26 12:49:50 UTC) #11
Message was sent while issue was closed.
On 2014/07/25 17:20:35, jsbell wrote:
> On 2014/07/25 01:59:03, bashi1 wrote:
> > @jsbell, thanks for your interest.
> > 
> > Could you refer TestDictionary.{cpp,h} in the WIP patch[1]?
> 
> Thanks for the link (starred, and I'll try and review) and summary!
>  
> > Do you have cases in which you
> > need to distinguish a member is 'not specified' or 'null'? I'd like to
gather
> > possible customer's feedback as much as possible, so please let me know your
> > concerns.
> 
> It looks like the specs I'm involved in are all updated with defaults, apart
> from Service Worker (which is pretty rough). So I don't think I have specific
> needs at the moment, but I'll keep an eye out; it caught my interest for some
> reason I don't remember...

Thanks for the input. IMHO, we can defer providing a way to check whether a
member is specified until we really need it. I'd appreciate if you could keep an
eye on this:)

Powered by Google App Engine
This is Rietveld 408576698