Chromium Code Reviews
Descriptionbindings: Correctly expand all class/header dependencies in unions.
Prior to this CL, an IDL construct like this:
void func((boolean or sequence<Element>) arg);
would generate two union files, BooleanOrElementSequence.cpp and
BooleanOrElementSequence.h. BooleanOrElementSequence.h contains declarations
such as:
const HeapVector<Member<Element>>& getAsElementSequence() const;
HeapVector<Member<Element>> m_elementSequence;
However, it does not forward-declare Element, nor does it include
Element.h (or V8Element.h). Only BooleanOrElementSequence.cpp includes
V8Element.h, leading to build failures.
This affected any types inside unions that require forward declarations
and additional headers to be included which were inside a container type,
such as a record or a sequence. For instance, the constructs below were all
problematic:
* (boolean or sequence<Element>)
* (float or sequence<(boolean or long)>)
* (double or record<ByteString, Element>)
Solve this by expanding v8_union._update_includes_and_forward_decls() and
making it more similar to code_generator_v8's depending_union_type() and
TypedefResolver:
* If we're parsing a container type (ie. a record or a sequence), we call
the function recursively to make sure all headers/forward declarations are
taken care of.
* If we're parsing a union type, the union was inside a container type (as
otherwise it would have been broken up by us looping through flattened
union members), in which case we forward-declare the union and include its
header in the outer union's .cpp file.
BUG=701410
R=bashi@chromium.org,haraken@chromium.org,yukishiino@chromium.org
Review-Url: https://codereview.chromium.org/2750003003
Cr-Commit-Position: refs/heads/master@{#457381}
Committed: https://chromium.googlesource.com/chromium/src/+/8552274ebe052e07472a852e37f6cbbe73bbecda
Patch Set 1 #Depends on Patchset: Dependent Patchsets: Messages
Total messages: 16 (9 generated)
|