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

Issue 420763002: IDL: DOM impl class code generation for IDL dictionaries (Closed)

Created:
6 years, 5 months ago by bashi
Modified:
6 years, 4 months ago
Reviewers:
haraken, jsbell
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: DOM impl class code generation for IDL dictionaries After this CL, CodeGeneratorV8 generates not only V8 bindings, but also DOM implementation classes for IDL dictionaries. - For an IDL file which defines a dictionary, the code generator generates bindings code (V8Foo.{cpp,h}) and DOM impl code (Foo.{cpp,h}). - Added Jinja templates for DOM impl generation. The context for these templates is created by v8_dictionary.dictionary_impl_context(). - v8_types.cpp_types() takes a new argument called |used_as_return_type|. This flags is used by member_impl_context(). Also, |used_in_cpp_sequence| argument is renamed to |used_as_member|. IDL dictionaries are still not be able to use in core/modules. We need to generate impl classes in the right place. (e.g. core/dom/Foo.idl -> gen/blink/core/dom/Foo.{cpp,h}) Also, following types are not supported yet as dictionary members: - union types. - enumeration types. - composite types (arrays, sequences and dictionaries) of which element type is an interface. BUG=321462 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=179190

Patch Set 1 #

Total comments: 3

Patch Set 2 : #

Total comments: 29

Patch Set 3 : #

Total comments: 9

Patch Set 4 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+370 lines, -30 lines) Patch
M Source/bindings/scripts/code_generator_v8.py View 4 chunks +41 lines, -5 lines 0 comments Download
M Source/bindings/scripts/idl_compiler.py View 2 chunks +6 lines, -11 lines 0 comments Download
M Source/bindings/scripts/v8_attributes.py View 1 2 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/scripts/v8_dictionary.py View 1 2 3 2 chunks +50 lines, -3 lines 0 comments Download
M Source/bindings/scripts/v8_methods.py View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/scripts/v8_types.py View 1 2 3 6 chunks +43 lines, -8 lines 0 comments Download
A Source/bindings/templates/dictionary_impl.h View 1 2 3 1 chunk +43 lines, -0 lines 1 comment Download
A Source/bindings/templates/dictionary_impl.cpp View 1 2 1 chunk +28 lines, -0 lines 0 comments Download
M Source/bindings/templates/dictionary_v8.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/templates/templates.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/idls/TestDictionary.idl View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
A Source/bindings/tests/results/TestDictionary.h View 1 2 3 1 chunk +91 lines, -0 lines 0 comments Download
A Source/bindings/tests/results/TestDictionary.cpp View 1 2 1 chunk +25 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/V8TestDictionary.cpp View 1 2 4 chunks +32 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
bashi
Haraken-san, PTAL? https://codereview.chromium.org/420763002/diff/1/Source/bindings/scripts/v8_dictionary.py File Source/bindings/scripts/v8_dictionary.py (right): https://codereview.chromium.org/420763002/diff/1/Source/bindings/scripts/v8_dictionary.py#newcode110 Source/bindings/scripts/v8_dictionary.py:110: def collect_includes(idl_type): Takes idl_type as argument as ...
6 years, 5 months ago (2014-07-25 10:05:41 UTC) #1
jsbell
What's the status of enumerations as member types in dictionaries? (I didn't see any mention ...
6 years, 5 months ago (2014-07-25 23:11:41 UTC) #2
bashi
On 2014/07/25 23:11:41, jsbell wrote: > What's the status of enumerations as member types in ...
6 years, 5 months ago (2014-07-26 12:57:36 UTC) #3
haraken
Mostly looks good. Let's support enumerations in a follow-up CL. https://codereview.chromium.org/420763002/diff/20001/Source/bindings/scripts/v8_dictionary.py File Source/bindings/scripts/v8_dictionary.py (right): https://codereview.chromium.org/420763002/diff/20001/Source/bindings/scripts/v8_dictionary.py#newcode82 ...
6 years, 5 months ago (2014-07-27 07:46:36 UTC) #4
bashi
I see. I'll add enumeration support in follow-up CLs. https://codereview.chromium.org/420763002/diff/20001/Source/bindings/scripts/v8_dictionary.py File Source/bindings/scripts/v8_dictionary.py (right): https://codereview.chromium.org/420763002/diff/20001/Source/bindings/scripts/v8_dictionary.py#newcode82 Source/bindings/scripts/v8_dictionary.py:82: ...
6 years, 4 months ago (2014-07-29 03:52:52 UTC) #5
haraken
LGTM https://codereview.chromium.org/420763002/diff/20001/Source/bindings/scripts/v8_dictionary.py File Source/bindings/scripts/v8_dictionary.py (right): https://codereview.chromium.org/420763002/diff/20001/Source/bindings/scripts/v8_dictionary.py#newcode148 Source/bindings/scripts/v8_dictionary.py:148: return '!m_%s.isNull()' % member.name On 2014/07/29 03:52:51, bashi1 ...
6 years, 4 months ago (2014-07-29 11:09:19 UTC) #6
bashi
Thank you for review! I'll upload a new patch set and land it tomorrow. https://codereview.chromium.org/420763002/diff/20001/Source/bindings/scripts/v8_types.py ...
6 years, 4 months ago (2014-07-29 11:51:21 UTC) #7
haraken
https://codereview.chromium.org/420763002/diff/40001/Source/bindings/tests/results/TestDictionary.h File Source/bindings/tests/results/TestDictionary.h (right): https://codereview.chromium.org/420763002/diff/40001/Source/bindings/tests/results/TestDictionary.h#newcode73 Source/bindings/tests/results/TestDictionary.h:73: Nullable<int> m_longMember; On 2014/07/29 11:51:21, bashi1 wrote: > On ...
6 years, 4 months ago (2014-07-29 12:25:49 UTC) #8
bashi
https://codereview.chromium.org/420763002/diff/40001/Source/bindings/scripts/v8_dictionary.py File Source/bindings/scripts/v8_dictionary.py (right): https://codereview.chromium.org/420763002/diff/40001/Source/bindings/scripts/v8_dictionary.py#newcode110 Source/bindings/scripts/v8_dictionary.py:110: return 'const %s&' % cpp_rvalue_type On 2014/07/29 11:51:21, bashi1 ...
6 years, 4 months ago (2014-07-29 23:59:49 UTC) #9
haraken
https://codereview.chromium.org/420763002/diff/40001/Source/bindings/scripts/v8_dictionary.py File Source/bindings/scripts/v8_dictionary.py (right): https://codereview.chromium.org/420763002/diff/40001/Source/bindings/scripts/v8_dictionary.py#newcode110 Source/bindings/scripts/v8_dictionary.py:110: return 'const %s&' % cpp_rvalue_type On 2014/07/29 23:59:49, bashi1 ...
6 years, 4 months ago (2014-07-30 00:00:56 UTC) #10
bashi
The CQ bit was checked by bashi@chromium.org
6 years, 4 months ago (2014-07-30 00:02:18 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bashi@chromium.org/420763002/60001
6 years, 4 months ago (2014-07-30 00:02:28 UTC) #12
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_blink_rel on tryserver.blink ...
6 years, 4 months ago (2014-07-30 01:02:20 UTC) #13
commit-bot: I haz the power
6 years, 4 months ago (2014-07-30 02:45:38 UTC) #14
Message was sent while issue was closed.
Change committed as 179190

Powered by Google App Engine
This is Rietveld 408576698