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

Issue 841973002: IDL: Support iterable<>, maplike<> and setlike<> syntax (Closed)

Created:
5 years, 11 months ago by Jens Widell
Modified:
5 years, 11 months ago
CC:
blink-reviews, blink-reviews-bindings_chromium.org, arv+blink, Inactive
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

IDL: Support iterable<>, maplike<> and setlike<> syntax This adds support for the basic syntax (in idl_definitions.py) but no handling of the additional parsed information beyond what the [Iterable] extended attribute already does. Extended attributes are currently not supported on the iterable<>, maplike<> or setlike<> definitions. In existing interfaces, replace [Iterable] with what the specification has, or in the case of MIDIInputMap and MIDIOutputMap, what seems to be the intention. In the Iterator interface, [Iterable] is still used, since it's somewhat unclear what it ought to be replaced with. This results in no changes in generated code. BUG=432683 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=188135

Patch Set 1 #

Total comments: 10

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+161 lines, -16 lines) Patch
M Source/bindings/scripts/idl_definitions.py View 1 8 chunks +69 lines, -8 lines 0 comments Download
M Source/bindings/scripts/v8_interface.py View 2 chunks +7 lines, -2 lines 0 comments Download
M Source/bindings/tests/idls/core/TestInterface2.idl View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/idls/core/TestInterface3.idl View 1 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/idls/core/TestObject.idl View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/idls/modules/TestInterface5.idl View 2 chunks +2 lines, -1 line 0 comments Download
M Source/bindings/tests/results/core/V8TestInterface2.cpp View 3 chunks +24 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterface3.cpp View 1 3 chunks +24 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestObject.cpp View 3 chunks +23 lines, -0 lines 0 comments Download
M Source/core/testing/Internals.idl View 2 chunks +2 lines, -1 line 0 comments Download
M Source/modules/fetch/Headers.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/fetch/Headers.idl View 2 chunks +1 line, -1 line 0 comments Download
M Source/modules/webmidi/MIDIInputMap.idl View 2 chunks +1 line, -1 line 0 comments Download
M Source/modules/webmidi/MIDIOutputMap.idl View 2 chunks +1 line, -1 line 0 comments Download

Messages

Total messages: 17 (4 generated)
Jens Widell
haraken@, yhirano@: PTAL jsbell@: FYI
5 years, 11 months ago (2015-01-08 11:44:38 UTC) #2
haraken
bashi-san: Would you take a first look on this?
5 years, 11 months ago (2015-01-08 15:52:11 UTC) #4
jsbell
Thanks for tackling this! https://codereview.chromium.org/841973002/diff/1/Source/bindings/scripts/v8_interface.py File Source/bindings/scripts/v8_interface.py (right): https://codereview.chromium.org/841973002/diff/1/Source/bindings/scripts/v8_interface.py#newcode139 Source/bindings/scripts/v8_interface.py:139: iterator_operation.extended_attributes['RaisesException'] = None Will it ...
5 years, 11 months ago (2015-01-08 17:02:40 UTC) #5
Jens Widell
https://codereview.chromium.org/841973002/diff/1/Source/bindings/scripts/v8_interface.py File Source/bindings/scripts/v8_interface.py (right): https://codereview.chromium.org/841973002/diff/1/Source/bindings/scripts/v8_interface.py#newcode139 Source/bindings/scripts/v8_interface.py:139: iterator_operation.extended_attributes['RaisesException'] = None On 2015/01/08 17:02:40, jsbell wrote: > ...
5 years, 11 months ago (2015-01-08 17:12:04 UTC) #6
jsbell
https://codereview.chromium.org/841973002/diff/1/Source/bindings/scripts/v8_interface.py File Source/bindings/scripts/v8_interface.py (right): https://codereview.chromium.org/841973002/diff/1/Source/bindings/scripts/v8_interface.py#newcode139 Source/bindings/scripts/v8_interface.py:139: iterator_operation.extended_attributes['RaisesException'] = None On 2015/01/08 17:12:04, Jens Widell wrote: ...
5 years, 11 months ago (2015-01-08 18:24:50 UTC) #7
bashi
LGTM, but I'd like to see yhirano@'s approval. toyoshim@ - FYI https://codereview.chromium.org/841973002/diff/1/Source/bindings/tests/idls/core/TestInterface.idl File Source/bindings/tests/idls/core/TestInterface.idl (left): ...
5 years, 11 months ago (2015-01-08 23:46:15 UTC) #9
haraken
LGTM
5 years, 11 months ago (2015-01-09 02:01:00 UTC) #10
yhirano
lgtm https://codereview.chromium.org/841973002/diff/1/Source/bindings/scripts/idl_definitions.py File Source/bindings/scripts/idl_definitions.py (right): https://codereview.chromium.org/841973002/diff/1/Source/bindings/scripts/idl_definitions.py#newcode671 Source/bindings/scripts/idl_definitions.py:671: self.is_read_only = node.GetProperty('READONLY') or False bool(node.GetProperty('READONLY')) https://codereview.chromium.org/841973002/diff/1/Source/bindings/scripts/idl_definitions.py#newcode684 Source/bindings/scripts/idl_definitions.py:684: ...
5 years, 11 months ago (2015-01-09 02:30:01 UTC) #11
yhirano
And, thank you for working on this!
5 years, 11 months ago (2015-01-09 02:31:06 UTC) #12
Jens Widell
Thanks for reviews, all! PS#2 addresses comments, and adds FIXME comments about lacking extended attribute ...
5 years, 11 months ago (2015-01-09 07:15:04 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/841973002/20001
5 years, 11 months ago (2015-01-09 10:11:40 UTC) #15
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://src.chromium.org/viewvc/blink?view=rev&revision=188135
5 years, 11 months ago (2015-01-09 10:15:31 UTC) #16
Jens Widell
5 years, 11 months ago (2015-01-13 10:26:26 UTC) #17
Message was sent while issue was closed.
https://codereview.chromium.org/841973002/diff/1/Source/bindings/scripts/v8_i...
File Source/bindings/scripts/v8_interface.py (right):

https://codereview.chromium.org/841973002/diff/1/Source/bindings/scripts/v8_i...
Source/bindings/scripts/v8_interface.py:139:
iterator_operation.extended_attributes['RaisesException'] = None
On 2015/01/08 18:24:49, jsbell wrote:
> On 2015/01/08 17:12:04, Jens Widell wrote:
> > A potentially trickier problem to solve would be to support applying
extended
> > attributes to only one of the implied operations. For instance supporting
> > [ImplementedAs=...] to override the individual C++ method names.
> 
> Noted. 
> 
> FWIW, applying the same attribs to all of the implied operations is fine for
the
> scenario I'm thinking about - experimentally adding iterable<> to existing
> interfaces like FormData.

Having thought some more about this, one IMO rather agreeable way to support
extended attributes (and perhaps other modifications) on individual implied
methods would be to allow the IDL file to explicitly define some or all of the
implied methods (checking only that they are correct in terms of arguments and
return type) and if so let the explicitly defined methods win.

WebIDL doesn't allow that, but that's not really something we need to follow in
our internal IDL files if we don't want to, as long as the observable behavior
is the intended.

IOW, you could for instance have

  interface FormData {
    [RuntimeEnabled=...] Iterator values(); // not web compatible
    iterable<...>;
  };

We wouldn't need to implement this unless an actual use-case emerges, of course.

Powered by Google App Engine
This is Rietveld 408576698