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

Issue 2750003003: bindings: Correctly expand all class/header dependencies in unions. (Closed)

Created:
3 years, 9 months ago by Raphael Kubo da Costa (rakuco)
Modified:
3 years, 9 months ago
Reviewers:
haraken, bashi, Yuki
CC:
chromium-reviews, blink-reviews, blink-reviews-bindings_chromium.org, Peter Beverloo
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

bindings: 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+948 lines, -20 lines) Patch
M third_party/WebKit/Source/bindings/scripts/code_generator_v8.py View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/scripts/v8_union.py View 4 chunks +17 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/idls/core/TestObject.idl View 1 chunk +4 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/bindings/tests/results/core/BooleanOrElementSequence.h View 1 chunk +96 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/bindings/tests/results/core/BooleanOrElementSequence.cpp View 1 chunk +116 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/ByteStringSequenceSequenceOrByteStringByteStringRecord.h View 1 chunk +0 lines, -2 lines 0 comments Download
A third_party/WebKit/Source/bindings/tests/results/core/DoubleOrLongOrBooleanSequence.h View 1 chunk +96 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/bindings/tests/results/core/DoubleOrLongOrBooleanSequence.cpp View 1 chunk +117 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/DoubleOrStringOrDoubleOrStringSequence.h View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/DoubleOrStringOrDoubleOrStringSequence.cpp View 1 chunk +1 line, -0 lines 0 comments Download
A third_party/WebKit/Source/bindings/tests/results/core/ElementSequenceOrByteStringDoubleOrStringRecord.h View 1 chunk +97 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/bindings/tests/results/core/ElementSequenceOrByteStringDoubleOrStringRecord.cpp View 1 chunk +118 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/bindings/tests/results/core/LongOrBoolean.h View 1 chunk +94 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/bindings/tests/results/core/LongOrBoolean.cpp View 1 chunk +112 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/NodeOrLongSequenceOrEventOrXMLHttpRequestOrStringOrStringByteStringOrNodeListRecord.h View 1 chunk +1 line, -7 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/NodeOrLongSequenceOrEventOrXMLHttpRequestOrStringOrStringByteStringOrNodeListRecord.cpp View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.h View 2 chunks +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp View 3 chunks +69 lines, -0 lines 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 16 (9 generated)
Raphael Kubo da Costa (rakuco)
PTAL.
3 years, 9 months ago (2017-03-15 18:46:01 UTC) #2
haraken
LGTM although bashi@ might want to take a look. Your CL description is always awesome ...
3 years, 9 months ago (2017-03-15 20:05:42 UTC) #5
bashi
lgtm. On 2017/03/15 20:05:42, haraken wrote: > LGTM although bashi@ might want to take a ...
3 years, 9 months ago (2017-03-15 23:39:58 UTC) #9
Raphael Kubo da Costa (rakuco)
Thanks, I try to make the commit messages very descriptive for my own sake, so ...
3 years, 9 months ago (2017-03-16 08:59:23 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2750003003/1
3 years, 9 months ago (2017-03-16 09:00:04 UTC) #12
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://chromium.googlesource.com/chromium/src/+/8552274ebe052e07472a852e37f6cbbe73bbecda
3 years, 9 months ago (2017-03-16 09:09:39 UTC) #15
Yuki
3 years, 9 months ago (2017-03-16 13:25:36 UTC) #16
Message was sent while issue was closed.
LGTM.

Powered by Google App Engine
This is Rietveld 408576698