|
IDL: Generate union type containers
Commit b8e05fd added a half baked code generator for union type
containers. This CL implements the code generator and uses them for
union return values.
If (A or B) is given, the name of the corresponding container
type will be "AOrB".
Generated union type containers will have following methods:
- isNull(), true when no specific type.
- isT(), true when the container holds T.
- getAsT(), retrieve the value as T. Need to check isT()
before calling this.
- setT(), set a value to the container. Allowed only once.
When a method/getter returns an union type, the binding layer
allocates an instance of the container class on stack, then
passes it to impl side as the last argument. The impl method
can set a specific value via setT() methods.
We already have build steps for IDL dictionary impl class creation, so
we can use the step for union type containers creation as well. The
code generator takes individual interfaces info, which contains
collected union types, then generates container classes from the
information.
This CL doesn't change the web-faced behavior.
BUG= 240176
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=184684
Total comments: 26
Total comments: 36
Total comments: 3
Total comments: 22
Total comments: 8
Total comments: 4
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+1366 lines, -332 lines) |
Patch |
 |
M |
Source/bindings/core/BUILD.gn
|
View
|
1
2
3
4
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/bindings/core/generated.gyp
|
View
|
1
2
3
4
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/bindings/core/v8/BUILD.gn
|
View
|
1
2
3
4
|
2 chunks |
+9 lines, -4 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/core/v8/V8BindingMacros.h
|
View
|
1
2
3
4
|
1 chunk |
+5 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/core/v8/generated.gni
|
View
|
|
1 chunk |
+5 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/core/v8/generated.gyp
|
View
|
1
2
3
4
|
5 chunks |
+14 lines, -4 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/core/v8/generated.gypi
|
View
|
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/modules/BUILD.gn
|
View
|
1
2
3
4
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/bindings/modules/generated.gyp
|
View
|
1
2
3
4
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/bindings/modules/v8/BUILD.gn
|
View
|
1
2
3
4
|
2 chunks |
+9 lines, -4 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/modules/v8/generated.gni
|
View
|
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/modules/v8/generated.gyp
|
View
|
1
2
3
4
|
4 chunks |
+14 lines, -5 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/modules/v8/generated.gypi
|
View
|
|
1 chunk |
+5 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/scripts/code_generator_v8.py
|
View
|
1
2
3
4
|
5 chunks |
+17 lines, -11 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/scripts/compute_interfaces_info_individual.py
|
View
|
1
2
3
4
|
5 chunks |
+14 lines, -4 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/scripts/compute_interfaces_info_overall.py
|
View
|
|
2 chunks |
+5 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/scripts/idl_compiler.py
|
View
|
1
2
3
4
|
4 chunks |
+25 lines, -4 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/scripts/interfaces_info_individual.gypi
|
View
|
1
2
3
4
|
3 chunks |
+7 lines, -3 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/scripts/scripts.gni
|
View
|
1
2
3
4
|
5 chunks |
+24 lines, -8 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/scripts/v8_interface.py
|
View
|
1
2
|
3 chunks |
+6 lines, -10 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/scripts/v8_methods.py
|
View
|
1
2
|
6 chunks |
+9 lines, -46 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/scripts/v8_types.py
|
View
|
1
2
3
4
5
|
9 chunks |
+15 lines, -33 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/scripts/v8_union.py
|
View
|
1
2
3
4
5
|
1 chunk |
+78 lines, -3 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/templates/interface.cpp
|
View
|
1
2
3
4
5
|
3 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/templates/methods.cpp
|
View
|
1
2
3
4
|
3 chunks |
+1 line, -28 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/templates/union.h
|
View
|
1
2
|
1 chunk |
+44 lines, -1 line |
3 comments
|
Download
|
 |
M |
Source/bindings/templates/union.cpp
|
View
|
1
2
3
4
5
|
1 chunk |
+128 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/idls/core/TestObject.idl
|
View
|
1
2
3
4
5
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/core/UnionTypesCore.h
|
View
|
1
2
3
4
5
|
1 chunk |
+274 lines, -7 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/core/UnionTypesCore.cpp
|
View
|
1
2
3
4
5
|
1 chunk |
+514 lines, -1 line |
1 comment
|
Download
|
 |
M |
Source/bindings/tests/results/core/V8TestObject.cpp
|
View
|
1
2
3
4
5
|
5 chunks |
+30 lines, -45 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/core/V8TestSpecialOperations.cpp
|
View
|
1
|
3 chunks |
+8 lines, -25 lines |
0 comments
|
Download
|
 |
M |
Source/bindings/tests/results/core/V8TestTypedefs.cpp
|
View
|
1
|
3 chunks |
+7 lines, -24 lines |
0 comments
|
Download
|
 |
M |
Source/core/BUILD.gn
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
Source/core/animation/AnimationNodeTiming.h
|
View
|
|
3 chunks |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
M |
Source/core/animation/AnimationNodeTiming.cpp
|
View
|
|
2 chunks |
+5 lines, -3 lines |
0 comments
|
Download
|
 |
M |
Source/core/animation/AnimationTest.cpp
|
View
|
|
4 chunks |
+21 lines, -25 lines |
0 comments
|
Download
|
 |
M |
Source/core/core.gyp
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
Source/core/dom/Document.h
|
View
|
1
2
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/dom/Document.cpp
|
View
|
1
2
|
3 chunks |
+4 lines, -3 lines |
0 comments
|
Download
|
 |
M |
Source/core/dom/ParentNode.h
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
Source/core/html/HTMLAllCollection.h
|
View
|
|
2 chunks |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/html/HTMLAllCollection.cpp
|
View
|
|
3 chunks |
+4 lines, -3 lines |
0 comments
|
Download
|
 |
M |
Source/core/html/HTMLFormControlsCollection.h
|
View
|
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/html/HTMLFormControlsCollection.cpp
|
View
|
|
3 chunks |
+4 lines, -3 lines |
0 comments
|
Download
|
 |
M |
Source/core/html/HTMLFormElement.h
|
View
|
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/html/HTMLFormElement.cpp
|
View
|
|
3 chunks |
+4 lines, -3 lines |
0 comments
|
Download
|
 |
M |
Source/core/html/HTMLOptionsCollection.h
|
View
|
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
Source/core/html/HTMLOptionsCollection.cpp
|
View
|
|
3 chunks |
+4 lines, -3 lines |
0 comments
|
Download
|
 |
M |
Source/modules/BUILD.gn
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
Source/modules/modules.gyp
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
Tools/Scripts/webkitpy/bindings/main.py
|
View
|
1
2
3
4
|
3 chunks |
+5 lines, -2 lines |
0 comments
|
Download
|
Total messages: 26 (6 generated)
|