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

Issue 470063003: IDL: Use IdlArrayOrSequenceType for array/sequence IDL types (Closed)

Created:
6 years, 4 months ago by Jens Widell
Modified:
6 years, 4 months ago
CC:
blink-reviews, blink-reviews-bindings_chromium.org, arv+blink, abarth-chromium
Base URL:
https://chromium.googlesource.com/chromium/blink.git@idl-extend-IdlTypeBase
Project:
blink
Visibility:
Public.

Description

IDL: Use IdlArrayOrSequenceType for array/sequence IDL types Representing array and sequence types this way, rather than via auxiliary flags on the member type, means exotic types like array-of-arrays, array-of-sequences, arrays-of-nullables and similar can be supported. More importantly, this also means that an array or sequence type can't be mistaken for its member type if you forget to check the "is array" and "is sequence" flags, and thus lets us remove a bunch of "is this an array or sequence type" checks from code that has nothing to do with supporting arrays or sequences. This patch doesn't change code generation. Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=180298

Patch Set 1 : #

Total comments: 25

Patch Set 2 : address comments #

Patch Set 3 : and => or #

Patch Set 4 : clean-up v8_type usage #

Total comments: 3

Patch Set 5 : set is_sequence=True for sequence types #

Total comments: 3

Patch Set 6 : clean-up is_array/is_sequence #

Patch Set 7 : address nits #

Patch Set 8 : rebased #

Patch Set 9 : rebased #

Patch Set 10 : simplify cpp_type_has_null_value() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+134 lines, -118 lines) Patch
M Source/bindings/scripts/idl_definitions.py View 1 2 3 4 5 6 7 4 chunks +12 lines, -18 lines 0 comments Download
M Source/bindings/scripts/idl_types.py View 1 2 3 4 5 6 15 chunks +99 lines, -81 lines 0 comments Download
M Source/bindings/scripts/v8_attributes.py View 1 2 3 3 chunks +2 lines, -3 lines 0 comments Download
M Source/bindings/scripts/v8_dictionary.py View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M Source/bindings/scripts/v8_methods.py View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M Source/bindings/scripts/v8_types.py View 1 2 3 4 5 6 7 8 9 10 chunks +18 lines, -12 lines 0 comments Download
M Source/bindings/templates/attributes.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 15 (0 generated)
Jens Widell
PTAL https://codereview.chromium.org/470063003/diff/60001/Source/bindings/scripts/v8_attributes.py File Source/bindings/scripts/v8_attributes.py (right): https://codereview.chromium.org/470063003/diff/60001/Source/bindings/scripts/v8_attributes.py#newcode499 Source/bindings/scripts/v8_attributes.py:499: return attribute.idl_type.name.endswith('Constructor') Changed since base_type is sometimes None ...
6 years, 4 months ago (2014-08-14 13:56:51 UTC) #1
Nils Barth (inactive)
LGTM with nits; thanks for this cleanup!! https://codereview.chromium.org/470063003/diff/60001/Source/bindings/scripts/idl_types.py File Source/bindings/scripts/idl_types.py (right): https://codereview.chromium.org/470063003/diff/60001/Source/bindings/scripts/idl_types.py#newcode179 Source/bindings/scripts/idl_types.py:179: return self.inner_name ...
6 years, 4 months ago (2014-08-14 14:24:45 UTC) #2
haraken
LGTM https://codereview.chromium.org/470063003/diff/60001/Source/bindings/scripts/idl_types.py File Source/bindings/scripts/idl_types.py (right): https://codereview.chromium.org/470063003/diff/60001/Source/bindings/scripts/idl_types.py#newcode362 Source/bindings/scripts/idl_types.py:362: assert is_array != is_sequence Also shall we assert ...
6 years, 4 months ago (2014-08-14 14:48:59 UTC) #3
Nils Barth (inactive)
https://codereview.chromium.org/470063003/diff/60001/Source/bindings/scripts/idl_types.py File Source/bindings/scripts/idl_types.py (right): https://codereview.chromium.org/470063003/diff/60001/Source/bindings/scripts/idl_types.py#newcode362 Source/bindings/scripts/idl_types.py:362: assert is_array != is_sequence On 2014/08/14 14:48:58, haraken wrote: ...
6 years, 4 months ago (2014-08-14 14:54:56 UTC) #4
Jens Widell
Thanks for quick review! https://codereview.chromium.org/470063003/diff/60001/Source/bindings/scripts/idl_types.py File Source/bindings/scripts/idl_types.py (right): https://codereview.chromium.org/470063003/diff/60001/Source/bindings/scripts/idl_types.py#newcode179 Source/bindings/scripts/idl_types.py:179: return self.inner_name + "OrNull" On ...
6 years, 4 months ago (2014-08-14 15:02:55 UTC) #5
Jens Widell
bashi@: Can you comment on the currently unused 'v8_type' item set by member_context()? Will it ...
6 years, 4 months ago (2014-08-14 15:22:03 UTC) #6
Jens Widell
On 2014/08/14 15:22:03, Jens Widell wrote: > bashi@: Can you comment on the currently unused ...
6 years, 4 months ago (2014-08-14 15:40:58 UTC) #7
haraken
LGTM https://codereview.chromium.org/470063003/diff/120001/Source/bindings/scripts/idl_types.py File Source/bindings/scripts/idl_types.py (right): https://codereview.chromium.org/470063003/diff/120001/Source/bindings/scripts/idl_types.py#newcode391 Source/bindings/scripts/idl_types.py:391: self.is_array = True This should be: self.is_sequence = ...
6 years, 4 months ago (2014-08-14 15:51:35 UTC) #8
Jens Widell
https://codereview.chromium.org/470063003/diff/120001/Source/bindings/scripts/idl_types.py File Source/bindings/scripts/idl_types.py (right): https://codereview.chromium.org/470063003/diff/120001/Source/bindings/scripts/idl_types.py#newcode391 Source/bindings/scripts/idl_types.py:391: self.is_array = True On 2014/08/14 15:51:34, haraken wrote: > ...
6 years, 4 months ago (2014-08-14 16:03:18 UTC) #9
Nils Barth (inactive)
* Could you try removing is_array and is_sequence? * Fine to fix resolve_typedefs() => typedefs_resolved() ...
6 years, 4 months ago (2014-08-14 16:18:56 UTC) #10
Jens Widell
PS#6 gets rid of is_{array,sequence} (and {array,sequence}_element_type, that were unused.) PS#7 addresses nits. PS#10 simplifies ...
6 years, 4 months ago (2014-08-14 18:16:43 UTC) #11
Nils Barth (inactive)
https://codereview.chromium.org/470063003/diff/60001/Source/bindings/scripts/idl_types.py File Source/bindings/scripts/idl_types.py (right): https://codereview.chromium.org/470063003/diff/60001/Source/bindings/scripts/idl_types.py#newcode314 Source/bindings/scripts/idl_types.py:314: def resolve_typedefs(self, typedefs): On 2014/08/14 18:16:43, Jens Widell wrote: ...
6 years, 4 months ago (2014-08-14 19:26:05 UTC) #12
Jens Widell
The CQ bit was checked by jl@opera.com
6 years, 4 months ago (2014-08-14 20:29:45 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jl@opera.com/470063003/240001
6 years, 4 months ago (2014-08-14 20:30:57 UTC) #14
commit-bot: I haz the power
6 years, 4 months ago (2014-08-14 20:38:06 UTC) #15
Message was sent while issue was closed.
Committed patchset #10 (240001) as 180298

Powered by Google App Engine
This is Rietveld 408576698