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

Issue 713683003: IDL: Support optional union type arguments with default values (Closed)

Created:
6 years, 1 month ago by Jens Widell
Modified:
6 years, 1 month ago
Reviewers:
haraken, bashi
CC:
blink-reviews, blink-reviews-bindings_chromium.org, arv+blink
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

IDL: Support optional union type arguments with default values Since union container types have setters rather than assignment operators, restructure the default value handling to generate a C++ expression that sets the value instead of the value as a C++ literal expression. And as a special case, since union containers are null initially, if the default value is null, generate an empty expression then. This also fixes a minor bug in the union handling: enum types were not supported. They should be treated as string types, including conflicting with any other string type in the union. BUG=240176 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=185046

Patch Set 1 #

Patch Set 2 : add unit tests #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+136 lines, -21 lines) Patch
M LayoutTests/fast/dom/idl-union-type-unittest.html View 1 1 chunk +15 lines, -0 lines 0 comments Download
M LayoutTests/fast/dom/idl-union-type-unittest-expected.txt View 1 1 chunk +13 lines, -0 lines 0 comments Download
M Source/bindings/scripts/idl_types.py View 1 chunk +22 lines, -0 lines 0 comments Download
M Source/bindings/scripts/v8_methods.py View 2 chunks +37 lines, -9 lines 0 comments Download
M Source/bindings/scripts/v8_union.py View 1 chunk +3 lines, -9 lines 0 comments Download
M Source/bindings/templates/methods.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/bindings/tests/idls/core/TestObject.idl View 1 chunk +3 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestObject.cpp View 2 chunks +35 lines, -0 lines 0 comments Download
M Source/core/testing/UnionTypesTest.cpp View 1 1 chunk +2 lines, -1 line 0 comments Download
M Source/core/testing/UnionTypesTest.idl View 1 1 chunk +4 lines, -0 lines 2 comments Download

Messages

Total messages: 15 (4 generated)
Jens Widell
PTAL This may be considered slightly overkill. I don't know if there is any union ...
6 years, 1 month ago (2014-11-10 09:37:00 UTC) #2
haraken
Looks good. Can we add unit tests for this? I want to have a test ...
6 years, 1 month ago (2014-11-10 11:20:04 UTC) #3
Jens Widell
On 2014/11/10 11:20:04, haraken wrote: > Can we add unit tests for this? I want ...
6 years, 1 month ago (2014-11-10 12:51:11 UTC) #4
haraken
Thanks, LGTM. https://codereview.chromium.org/713683003/diff/20001/Source/core/testing/UnionTypesTest.idl File Source/core/testing/UnionTypesTest.idl (right): https://codereview.chromium.org/713683003/diff/20001/Source/core/testing/UnionTypesTest.idl#newcode14 Source/core/testing/UnionTypesTest.idl:14: [ImplementedAs=doubleOrStringArg] DOMString doubleOrStringDefaultNullArg(optional (double or DOMString)? arg ...
6 years, 1 month ago (2014-11-10 12:55:42 UTC) #5
Jens Widell
https://codereview.chromium.org/713683003/diff/20001/Source/core/testing/UnionTypesTest.idl File Source/core/testing/UnionTypesTest.idl (right): https://codereview.chromium.org/713683003/diff/20001/Source/core/testing/UnionTypesTest.idl#newcode14 Source/core/testing/UnionTypesTest.idl:14: [ImplementedAs=doubleOrStringArg] DOMString doubleOrStringDefaultNullArg(optional (double or DOMString)? arg = null); ...
6 years, 1 month ago (2014-11-10 12:59:10 UTC) #6
haraken
On 2014/11/10 12:59:10, Jens Widell wrote: > https://codereview.chromium.org/713683003/diff/20001/Source/core/testing/UnionTypesTest.idl > File Source/core/testing/UnionTypesTest.idl (right): > > https://codereview.chromium.org/713683003/diff/20001/Source/core/testing/UnionTypesTest.idl#newcode14 ...
6 years, 1 month ago (2014-11-10 12:59:42 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/713683003/20001
6 years, 1 month ago (2014-11-10 13:36:01 UTC) #9
commit-bot: I haz the power
Try jobs failed on following builders: win_blink_rel on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/win_blink_rel/builds/35595)
6 years, 1 month ago (2014-11-10 15:31:14 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/713683003/20001
6 years, 1 month ago (2014-11-10 15:32:28 UTC) #13
commit-bot: I haz the power
Committed patchset #2 (id:20001) as 185046
6 years, 1 month ago (2014-11-10 17:37:08 UTC) #14
bashi
6 years, 1 month ago (2014-11-10 23:21:39 UTC) #15
Message was sent while issue was closed.
LGTM

Powered by Google App Engine
This is Rietveld 408576698