New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 671755 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 670712



Sign in to add a comment

Binding does not work for union of typedefs

Project Member Reported by zakerinasab@chromium.org, Dec 6 2016

Issue description

Adding 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.
 

Comment 1 by bashi@chromium.org, Dec 9 2016

Owner: bashi@chromium.org
Status: 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;
    ^

Project Member

Comment 2 by bugdroid1@chromium.org, 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

Comment 3 by bashi@chromium.org, Dec 11 2016

Status: Fixed (was: Assigned)

Sign in to add a comment