|
|
bindings: Expand typedefs before generating union files.
Prior to this commit, the IDL compiler was failing to resolve typedefs in
unions before generating new union code. In practice, this meant an IDL
construct such as:
typedef boolean Foo;
void func((Foo or long) arg);
Generated FooOrLong.cpp and FooOrLong.h, and "Foo" was considered an IDL
interface instead of a simple bool. Since Foo.cpp and Foo.h do not exist,
and neither does the Foo class, this caused build failures.
We now resolve the typedefs earlier, and in the example above we would now
generate BooleanOrLong.cpp and BooleanOrLong.h, which works as expected.
Fixing this requires a few separate, intertwined changes:
* IdlUnionType.resolve_typedefs() was broken: the |typedefs| argument it
receives is a dictionary whose keys are typedef names, not
IdlTypeBase-derived objects, so |typedefs.get()| was always failing and
returning the original, unresolved member objects.
* CodeGeneratorUnionType actually needs to call resolve_typedefs(). It was
the only generator class not doing so. The mechanism needs to be different
from the other classes though, as IdlUnionType is not a type defined in
idl_definitions.py as is the case for the types handled by the other
generators. Instead of using TypedefResolver, we simply call the relevant
parts of it manually.
* The code manually adding union header includes to interfaces and partial
interfaces has been dropped: there isn't enough information to resolve the
typedefs at that point, which meant interface .cpp files would include
FooOrLong.h, while interface .h files include BooleanOrLong.h. The test
expectations IDL files show a reduction in unneeded includes, and the
build seems to work fine.
BUG= 701411
R=bashi@chromium.org,haraken@chromium.org,yukishiino@chromium.org
Review-Url: https://codereview.chromium.org/2749253002
Cr-Commit-Position: refs/heads/master@{#457377}
Committed: https://chromium.googlesource.com/chromium/src/+/200763220d087ef3ccf735855398ec193db29658
Total comments: 2
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+783 lines, -39 lines) |
Patch |
 |
M |
third_party/WebKit/Source/bindings/scripts/code_generator_v8.py
|
View
|
|
1 chunk |
+8 lines, -0 lines |
2 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/scripts/compute_interfaces_info_individual.py
|
View
|
|
1 chunk |
+0 lines, -4 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/scripts/compute_interfaces_info_overall.py
|
View
|
|
1 chunk |
+0 lines, -5 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/scripts/idl_types.py
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/scripts/idl_types_test.py
|
View
|
|
1 chunk |
+36 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/idls/core/TestDictionary.idl
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/idls/core/TestTypedefs.idl
|
View
|
|
3 chunks |
+4 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/idls/modules/TestInterfacePartial3.idl
|
View
|
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
 |
A |
third_party/WebKit/Source/bindings/tests/results/core/BooleanOrTestCallbackInterface.h
|
View
|
|
1 chunk |
+96 lines, -0 lines |
0 comments
|
Download
|
 |
A |
third_party/WebKit/Source/bindings/tests/results/core/BooleanOrTestCallbackInterface.cpp
|
View
|
|
1 chunk |
+109 lines, -0 lines |
0 comments
|
Download
|
 |
A |
third_party/WebKit/Source/bindings/tests/results/core/FloatOrBoolean.h
|
View
|
|
1 chunk |
+94 lines, -0 lines |
0 comments
|
Download
|
 |
A |
third_party/WebKit/Source/bindings/tests/results/core/FloatOrBoolean.cpp
|
View
|
|
1 chunk |
+112 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/LongOrTestDictionary.cpp
|
View
|
|
1 chunk |
+0 lines, -2 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/NodeOrLongSequenceOrEventOrXMLHttpRequestOrStringOrStringByteStringOrNodeListRecord.cpp
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.h
|
View
|
|
3 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.cpp
|
View
|
|
3 chunks |
+10 lines, -2 lines |
0 comments
|
Download
|
 |
A |
third_party/WebKit/Source/bindings/tests/results/core/UnsignedLongLongOrBooleanOrTestCallbackInterface.h
|
View
|
|
1 chunk |
+103 lines, -0 lines |
0 comments
|
Download
|
 |
A |
third_party/WebKit/Source/bindings/tests/results/core/UnsignedLongLongOrBooleanOrTestCallbackInterface.cpp
|
View
|
|
1 chunk |
+139 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp
|
View
|
|
3 chunks |
+20 lines, -2 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
|
View
|
|
2 chunks |
+0 lines, -10 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.h
|
View
|
|
2 chunks |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp
|
View
|
|
5 chunks |
+23 lines, -7 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/XMLHttpRequestOrString.cpp
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp
|
View
|
|
1 chunk |
+0 lines, -2 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.h
|
View
|
|
2 chunks |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp
|
View
|
|
4 chunks |
+14 lines, -0 lines |
0 comments
|
Download
|
Dependent Patchsets:
Total messages: 16 (8 generated)
|