Binding does not work for union of typedefs |
||
Issue descriptionAdding a union of two typedefs to an IDL file results in name conflict. Steps to reproduce: - In third_party/WebKit/source/core/html/ImageData.idl, add: typedef (Uint8ClampedArray or Float32Array) ImageDataArray; - In third_party/WebKit/source/core/html/ImageData.h, add: #include "bindings/core/v8/Uint8ClampedArrayOrFloat32Array.h" typedef Uint8ClampedArrayOrFloat32Array ImageDataArrayUnion; - Build the code.
,
Dec 10 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/26309371fb6eff53769c2fb4bcbe11331b264b82 commit 26309371fb6eff53769c2fb4bcbe11331b264b82 Author: bashi <bashi@chromium.org> Date: Sat Dec 10 01:57:17 2016 bindings: Stop using forward declarations for typed array in union containers Typed arrays in blink (e.g. DOMFloat32Array) are typedef of DOMTypedArray<T, U> so using forward declarations causes conflicts. Stop using forward declarations for typed arrays in union containers. Instead, include headers directly. BUG= 671755 Review-Url: https://codereview.chromium.org/2559323004 Cr-Commit-Position: refs/heads/master@{#437717} [modify] https://crrev.com/26309371fb6eff53769c2fb4bcbe11331b264b82/third_party/WebKit/Source/bindings/scripts/v8_union.py [modify] https://crrev.com/26309371fb6eff53769c2fb4bcbe11331b264b82/third_party/WebKit/Source/bindings/tests/results/core/TestInterface2OrUint8Array.cpp [modify] https://crrev.com/26309371fb6eff53769c2fb4bcbe11331b264b82/third_party/WebKit/Source/bindings/tests/results/core/TestInterface2OrUint8Array.h
,
Dec 11 2016
|
||
►
Sign in to add a comment |
||
Comment 1 by bashi@chromium.org
, Dec 9 2016Status: Assigned (was: Untriaged)
Pasting a build error log. An easy way to fix this is to stop using forward declarations for typed arrays. In file included from ../../third_party/WebKit/Source/core/html/ImageData.h:41: gen/blink/bindings/core/v8/Uint8ClampedArrayOrFloat32Array.h:20:7: error: definition of type 'DOMFloat32Array' conflicts with typedef of the same name class DOMFloat32Array; ^ ../../third_party/WebKit/Source/core/dom/DOMTypedArray.h:112:60: note: 'DOMFloat32Array' declared here typedef DOMTypedArray<WTF::Float32Array, v8::Float32Array> DOMFloat32Array; ^ In file included from ../../third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp:18: In file included from ../../third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.h:37: In file included from ../../third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h:10: In file included from ../../third_party/WebKit/Source/core/html/ImageData.h:41: gen/blink/bindings/core/v8/Uint8ClampedArrayOrFloat32Array.h:21:7: error: definition of type 'DOMUint8ClampedArray' conflicts with typedef of the same name class DOMUint8ClampedArray; ^ ../../third_party/WebKit/Source/core/dom/DOMTypedArray.h:109:5: note: 'DOMUint8ClampedArray' declared here DOMUint8ClampedArray; ^