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

Issue 385603002: IDL: Support using nullable on any method return type (Closed)

Created:
6 years, 5 months ago by Jens Widell
Modified:
6 years, 5 months ago
Reviewers:
haraken, Gaja
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: Support using nullable on any method return type Previously, nullable string and wrapper types was supported, since those types have a native/natural null representation in C++. Other types, like primitives (long, boolean) or complex types like sequence<>, could not be nullable. With this CL, nullable return types other than string or wrapper types are handled using Nullable<T>, like so: Nullable<T> result = impl->method(...); if (result.isNull()) v8SetReturnValueNull(info); else v8SetReturnValue...(info, ... result.get() ...); This CL does not change code generation since currently no method return such a nullable type. BUG=390780 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=177887

Patch Set 1 #

Total comments: 13

Patch Set 2 : add comment in is_nullable_simple() #

Total comments: 4

Patch Set 3 : use_result_local => use_local_result #

Unified diffs Side-by-side diffs Delta from patch set Stats (+115 lines, -15 lines) Patch
M Source/bindings/scripts/idl_definitions.py View 1 chunk +2 lines, -1 line 0 comments Download
M Source/bindings/scripts/v8_attributes.py View 2 chunks +1 line, -6 lines 0 comments Download
M Source/bindings/scripts/v8_methods.py View 1 2 5 chunks +22 lines, -6 lines 0 comments Download
M Source/bindings/scripts/v8_types.py View 1 1 chunk +14 lines, -0 lines 0 comments Download
M Source/bindings/templates/methods.cpp View 1 2 2 chunks +8 lines, -2 lines 0 comments Download
M Source/bindings/tests/idls/TestObject.idl View 1 chunk +4 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/V8TestObject.cpp View 2 chunks +64 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
Jens Widell
PTAL A counter-proposal to [TreatReturnedEmptyArrayAs]; thrown together largely to understand what I was actually proposing. ...
6 years, 5 months ago (2014-07-10 14:31:13 UTC) #1
haraken
The approach looks good. https://codereview.chromium.org/385603002/diff/1/Source/bindings/scripts/v8_methods.py File Source/bindings/scripts/v8_methods.py (right): https://codereview.chromium.org/385603002/diff/1/Source/bindings/scripts/v8_methods.py#newcode123 Source/bindings/scripts/v8_methods.py:123: is_nullable = idl_type.is_nullable and not ...
6 years, 5 months ago (2014-07-10 14:43:57 UTC) #2
Jens Widell
https://codereview.chromium.org/385603002/diff/1/Source/bindings/scripts/v8_methods.py File Source/bindings/scripts/v8_methods.py (right): https://codereview.chromium.org/385603002/diff/1/Source/bindings/scripts/v8_methods.py#newcode123 Source/bindings/scripts/v8_methods.py:123: is_nullable = idl_type.is_nullable and not idl_type.is_nullable_simple On 2014/07/10 14:43:57, ...
6 years, 5 months ago (2014-07-10 14:56:44 UTC) #3
Jens Widell
https://codereview.chromium.org/385603002/diff/1/Source/bindings/scripts/v8_methods.py File Source/bindings/scripts/v8_methods.py (right): https://codereview.chromium.org/385603002/diff/1/Source/bindings/scripts/v8_methods.py#newcode123 Source/bindings/scripts/v8_methods.py:123: is_nullable = idl_type.is_nullable and not idl_type.is_nullable_simple On 2014/07/10 14:56:44, ...
6 years, 5 months ago (2014-07-10 14:57:57 UTC) #4
Jens Widell
Naming of things... https://codereview.chromium.org/385603002/diff/1/Source/bindings/scripts/v8_methods.py File Source/bindings/scripts/v8_methods.py (right): https://codereview.chromium.org/385603002/diff/1/Source/bindings/scripts/v8_methods.py#newcode123 Source/bindings/scripts/v8_methods.py:123: is_nullable = idl_type.is_nullable and not idl_type.is_nullable_simple ...
6 years, 5 months ago (2014-07-10 15:03:44 UTC) #5
haraken
https://codereview.chromium.org/385603002/diff/1/Source/bindings/scripts/v8_methods.py File Source/bindings/scripts/v8_methods.py (right): https://codereview.chromium.org/385603002/diff/1/Source/bindings/scripts/v8_methods.py#newcode123 Source/bindings/scripts/v8_methods.py:123: is_nullable = idl_type.is_nullable and not idl_type.is_nullable_simple On 2014/07/10 15:03:43, ...
6 years, 5 months ago (2014-07-10 15:11:44 UTC) #6
Jens Widell
https://codereview.chromium.org/385603002/diff/1/Source/bindings/scripts/v8_methods.py File Source/bindings/scripts/v8_methods.py (right): https://codereview.chromium.org/385603002/diff/1/Source/bindings/scripts/v8_methods.py#newcode123 Source/bindings/scripts/v8_methods.py:123: is_nullable = idl_type.is_nullable and not idl_type.is_nullable_simple On 2014/07/10 15:11:44, ...
6 years, 5 months ago (2014-07-10 15:16:37 UTC) #7
haraken
LGTM > > > How about is_implicit_nullable (for "simple") and is_explicit_nullable for > the > ...
6 years, 5 months ago (2014-07-10 15:21:37 UTC) #8
Jens Widell
https://codereview.chromium.org/385603002/diff/1/Source/bindings/templates/methods.cpp File Source/bindings/templates/methods.cpp (right): https://codereview.chromium.org/385603002/diff/1/Source/bindings/templates/methods.cpp#newcode255 Source/bindings/templates/methods.cpp:255: {% elif method.is_use_result_local and not method.union_arguments %} On 2014/07/10 ...
6 years, 5 months ago (2014-07-10 15:28:54 UTC) #9
Jens Widell
The CQ bit was checked by jl@opera.com
6 years, 5 months ago (2014-07-10 15:29:08 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jl@opera.com/385603002/40001
6 years, 5 months ago (2014-07-10 15:29:37 UTC) #11
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_blink_dbg on tryserver.blink ...
6 years, 5 months ago (2014-07-10 16:42:20 UTC) #12
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-10 17:49:50 UTC) #13
commit-bot: I haz the power
Try jobs failed on following builders: linux_blink_dbg on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/linux_blink_dbg/builds/15829)
6 years, 5 months ago (2014-07-10 17:49:51 UTC) #14
haraken
The CQ bit was checked by haraken@chromium.org
6 years, 5 months ago (2014-07-10 23:23:19 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jl@opera.com/385603002/40001
6 years, 5 months ago (2014-07-10 23:24:29 UTC) #16
commit-bot: I haz the power
6 years, 5 months ago (2014-07-10 23:25:01 UTC) #17
Message was sent while issue was closed.
Change committed as 177887

Powered by Google App Engine
This is Rietveld 408576698