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

Issue 24257003: IDL compiler: Types (Closed)

Created:
7 years, 3 months ago by Nils Barth (inactive)
Modified:
7 years, 2 months ago
Reviewers:
haraken
CC:
blink-reviews, kojih, jsbell+bindings_chromium.org, abarth-chromium, marja+watch_chromium.org, adamk+blink_chromium.org, haraken, Nate Chapin, do-not-use, kouhei (in TOK)
Visibility:
Public.

Description

IDL compiler: Types This is a basic CL for the compiler, doing various type handling and conversion. It's rather long (600 lines), but primarily data tables, and the logic is very flat. BUG=239771 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=158239

Patch Set 1 #

Patch Set 2 : Fix callback interfaces #

Total comments: 110

Patch Set 3 : Fix callback interface note #

Patch Set 4 : Revised, add tests #

Patch Set 5 : Revised #

Total comments: 36

Patch Set 6 : Revised, final #

Patch Set 7 : Spit and finish #

Patch Set 8 : Fix copyright + license #

Unified diffs Side-by-side diffs Delta from patch set Stats (+711 lines, -139 lines) Patch
M Source/bindings/scripts/unstable/v8_attributes.py View 1 2 3 4 5 6 1 chunk +2 lines, -3 lines 0 comments Download
M Source/bindings/scripts/unstable/v8_callback_interface.py View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M Source/bindings/scripts/unstable/v8_types.py View 1 2 3 4 5 6 3 chunks +351 lines, -83 lines 0 comments Download
A + Source/bindings/tests/idls/TestObjectPython.idl View 1 2 3 4 5 6 7 1 chunk +13 lines, -23 lines 0 comments Download
A + Source/bindings/tests/results/V8TestObjectPython.h View 1 2 3 1 chunk +29 lines, -29 lines 0 comments Download
A Source/bindings/tests/results/V8TestObjectPython.cpp View 1 2 3 1 chunk +314 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
Nils Barth (inactive)
Here's the type handling. (With tweaks so existing code handles it.) It's long but flat, ...
7 years, 3 months ago (2013-09-19 09:32:44 UTC) #1
haraken
50% reviewed. Let me take a look later. https://codereview.chromium.org/24257003/diff/3001/Source/bindings/scripts/unstable/v8_types.py File Source/bindings/scripts/unstable/v8_types.py (right): https://codereview.chromium.org/24257003/diff/3001/Source/bindings/scripts/unstable/v8_types.py#newcode73 Source/bindings/scripts/unstable/v8_types.py:73: # ...
7 years, 3 months ago (2013-09-19 10:51:41 UTC) #2
haraken
100% reviewed. It's hard to review this CL because there are a lot of code ...
7 years, 3 months ago (2013-09-19 12:04:12 UTC) #3
Nils Barth (inactive)
Thanks for detailed review! See revised CL, with comments. For next CL, I'll implement just ...
7 years, 3 months ago (2013-09-20 03:43:18 UTC) #4
Nils Barth (inactive)
A thought about reading the Perl CG: in principle, reviewers should not have to read ...
7 years, 3 months ago (2013-09-20 03:48:12 UTC) #5
haraken
Second round of comments. Let me take another close look at the latest CL later. ...
7 years, 3 months ago (2013-09-20 04:47:28 UTC) #6
Nils Barth (inactive)
On 2013/09/20 04:47:28, haraken wrote: > Second round of comments. Let me take another close ...
7 years, 3 months ago (2013-09-20 05:21:28 UTC) #7
Nils Barth (inactive)
(Quick revisions, per comments.) https://codereview.chromium.org/24257003/diff/3001/Source/bindings/scripts/unstable/v8_types.py File Source/bindings/scripts/unstable/v8_types.py (right): https://codereview.chromium.org/24257003/diff/3001/Source/bindings/scripts/unstable/v8_types.py#newcode385 Source/bindings/scripts/unstable/v8_types.py:385: V8_VALUE_TO_CPP_VALUE_AND_INCLUDES = { On 2013/09/20 ...
7 years, 3 months ago (2013-09-20 05:47:15 UTC) #8
haraken
Thank you very much for the iterative updates! This CL looks much nicer. LGTM with ...
7 years, 3 months ago (2013-09-20 15:21:35 UTC) #9
Nils Barth (inactive)
Thanks for comments; various naming/nit replies, and 2 substantive questions (we can address in future ...
7 years, 3 months ago (2013-09-24 02:34:00 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/nbarth@chromium.org/24257003/28001
7 years, 3 months ago (2013-09-24 03:07:31 UTC) #11
commit-bot: I haz the power
Change committed as 158239
7 years, 3 months ago (2013-09-24 05:19:36 UTC) #12
haraken
https://codereview.chromium.org/24257003/diff/18001/Source/bindings/scripts/unstable/v8_types.py File Source/bindings/scripts/unstable/v8_types.py (right): https://codereview.chromium.org/24257003/diff/18001/Source/bindings/scripts/unstable/v8_types.py#newcode131 Source/bindings/scripts/unstable/v8_types.py:131: idl_type in ['any', 'DOMString']) > This is ref_ptr_type, not ...
7 years, 3 months ago (2013-09-24 05:36:57 UTC) #13
Nils Barth (inactive)
7 years, 2 months ago (2013-09-24 23:52:03 UTC) #14
Message was sent while issue was closed.
Thanks for clarifications; will bear in mind for future CLs!

https://codereview.chromium.org/24257003/diff/18001/Source/bindings/scripts/u...
File Source/bindings/scripts/unstable/v8_types.py (right):

https://codereview.chromium.org/24257003/diff/18001/Source/bindings/scripts/u...
Source/bindings/scripts/unstable/v8_types.py:131: idl_type in ['any',
'DOMString'])
On 2013/09/24 05:36:57, haraken wrote:
> However, basically, I think there are three types:
> 
> - Primitive types speced in Web IDL (int, any, DOMString, ...)

"Primitive type" is a technical term, and only includes certain Web IDL types:
http://www.w3.org/TR/WebIDL/#dfn-primitive-type
"The following types are known as primitive types: boolean, the integer types,
float, unresticted float, double and unrestricted double."

Note that 'int' is not a Web IDL type (you need to specify 'short' or 'long'),
and 'any' and 'DOMString' are Web IDL types but are not primitive.


> - Wrapper types (Node, XMLHttpRequest, ...)
> - Special casing (SerializedScriptValue, Promise, EventListener, ...)
> 
> In this categorization, I think IsRefPtr = IsWrapperType + some cases in the
> special casing.

Thanks for clarifying!

In Web IDL spec terms, what we implement as "wrapper types" sound like general
"interface types" (i.e., type corresponding to an interface, not something
built-in like DOMString).

https://codereview.chromium.org/24257003/diff/18001/Source/bindings/scripts/u...
Source/bindings/scripts/unstable/v8_types.py:212: # FIXME: Rename NullString to
EmptyString (here and in .idl files), per spec
On 2013/09/24 05:36:57, haraken wrote:
> > I'm confused; do we want to fix something (if so, what?), or are we just
> > documenting non-spec behavior that we don't plan to change?
> > 
> > (We currently don't implement spec, which requires EmptyString and Null, and
> > instead implement our own NullString.)
> 
> Sorry for not being clear. This shouldn't be a FIXME but should be a comment.
> We're using NullString on purpose for performance.

Got it, thanks!
I've documented at:
https://sites.google.com/a/chromium.org/dev/blink/webidl/blink-idl-extended-a...
...and will add a comment in the code when we implement.

Powered by Google App Engine
This is Rietveld 408576698