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

Issue 690428 link

Starred by 11 users

Issue metadata

Status: Fixed
Owner:
OoO until Feb 4th
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug

Blocked on:
issue 710035

Blocking:
issue 715122
issue 713200



Sign in to add a comment

bindings: Iterables should be coercible to sequences

Project Member Reported by raphael....@intel.com, Feb 9 2017

Issue description

https://heycam.github.io/webidl/#create-sequence-from-iterable says it should be possible to get an iterable object and create a sequence<> out of it.

This is required to properly implement at least https://fetch.spec.whatwg.org/#typedefdef-headersinit, as it should be possible to pass a Headers object to HeadersInit via the iterable->sequence conversion.
 

Comment 1 by peria@chromium.org, Mar 2 2017

Status: Available (was: Untriaged)
Cc: bashi@chromium.org
 Issue 393866  has been merged into this issue.
Owner: raphael....@intel.com
Status: Started (was: Available)
I've merged  issue 393866  into this issue because they are both basically describing the same problem, but this issue reflects the current state of the WebIDL spec (the sequence changes mentioned in 393866 indeed made it into the spec).
Project Member

Comment 4 by bugdroid1@chromium.org, Apr 7 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/125a3532433159edc1041c7f031d733df0c7682d

commit 125a3532433159edc1041c7f031d733df0c7682d
Author: raphael.kubo.da.costa <raphael.kubo.da.costa@intel.com>
Date: Fri Apr 07 16:36:54 2017

bindings: Throw a type error if converting an interface or callback function fails.

The previous implementation of nativeValue() for IDL interfaces and callback
functions simply called implTypeWithCheck() (or create() for callback
functions) and returned its value. This meant it was not possible for
callers to easily distinguish a nullptr returned here (meaning the
conversion failed) from nullptr being returned by a nativeValue() call for
another type (which can just be a nullptr).

BUG= 690428 
R=bashi@chromium.org,haraken@chromium.org,yukishiino@chromium.org

Review-Url: https://codereview.chromium.org/2802223002
Cr-Commit-Position: refs/heads/master@{#462890}

[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsImplTest.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/scripts/v8_callback_function.py
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/templates/callback_function.cpp.tmpl
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/AnyCallbackFunctionOptionalAnyArg.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/LongCallbackFunction.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/StringSequenceCallbackFunctionLongSequenceArg.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBuffer.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBufferView.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8DataView.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8SVGTestInterface.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestConstants.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestException.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEmpty.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceSecureContext.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/V8Uint8ClampedArray.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunction.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunctionInterfaceArg.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunctionTypedef.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp
[modify] https://crrev.com/125a3532433159edc1041c7f031d733df0c7682d/third_party/WebKit/Source/bindings/tests/results/modules/VoidCallbackFunctionModules.cpp

Project Member

Comment 5 by bugdroid1@chromium.org, Apr 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d4c8b05b9769e86790dc740fa920631227a31003

commit d4c8b05b9769e86790dc740fa920631227a31003
Author: raphael.kubo.da.costa <raphael.kubo.da.costa@intel.com>
Date: Mon Apr 10 11:20:03 2017

bindings: Preprocess IDL types in native_value_traits_type_name().

When determining which type to use in native_value_traits_type_name(), make
sure preprocess_idl_type() is called first, otherwise types such as enums or
`any' are not converted to their final C++ types, leading to build failures.

BUG= 690428 
R=bashi@chromium.org,haraken@chromium.org,yukishiino@chromium.org

Review-Url: https://codereview.chromium.org/2805813004
Cr-Commit-Position: refs/heads/master@{#463218}

[modify] https://crrev.com/d4c8b05b9769e86790dc740fa920631227a31003/third_party/WebKit/Source/bindings/scripts/v8_types.py
[modify] https://crrev.com/d4c8b05b9769e86790dc740fa920631227a31003/third_party/WebKit/Source/bindings/tests/idls/core/TestDictionary.idl
[modify] https://crrev.com/d4c8b05b9769e86790dc740fa920631227a31003/third_party/WebKit/Source/bindings/tests/idls/modules/TestInterfacePartial3.idl
[modify] https://crrev.com/d4c8b05b9769e86790dc740fa920631227a31003/third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.cpp
[modify] https://crrev.com/d4c8b05b9769e86790dc740fa920631227a31003/third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.h
[modify] https://crrev.com/d4c8b05b9769e86790dc740fa920631227a31003/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp
[modify] https://crrev.com/d4c8b05b9769e86790dc740fa920631227a31003/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp
[modify] https://crrev.com/d4c8b05b9769e86790dc740fa920631227a31003/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.h

Project Member

Comment 6 by bugdroid1@chromium.org, Apr 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0338b35867900b81de5e6960eec0572f152974b7

commit 0338b35867900b81de5e6960eec0572f152974b7
Author: raphael.kubo.da.costa <raphael.kubo.da.costa@intel.com>
Date: Mon Apr 10 15:29:02 2017

bindings: Call member.includes_for_type() for container types too.

Follow-up to commit 8552274ebe ("bindings: Correctly expand all class/header
dependencies in unions"), which caused member.includes_for_type() not to be
called when a nested union member is processed.

We now call it in all cases, even for container types such as records,
sequences and unions, otherwise we risk skipping includes that come from the
type (e.g. IDLRecord) itself. This does not happen at the moment, but may in
the future, such as when we start converting sequences via IDLSequence and
NativeValueTraits::NativeValue().

BUG= 690428 
R=bashi@chromium.org,haraken@chromium.org,yukishiino@chromium.org

Review-Url: https://codereview.chromium.org/2806343002
Cr-Commit-Position: refs/heads/master@{#463268}

[modify] https://crrev.com/0338b35867900b81de5e6960eec0572f152974b7/third_party/WebKit/Source/bindings/scripts/v8_union.py
[modify] https://crrev.com/0338b35867900b81de5e6960eec0572f152974b7/third_party/WebKit/Source/bindings/tests/results/core/NodeOrLongSequenceOrEventOrXMLHttpRequestOrStringOrStringByteStringOrNodeListRecord.cpp

Blockedon: 710035
Just filed a bug for size regression that showed up on our monitoring from this. I'd appreciate if you'd try and look at it before landing any more commits for this.
Project Member

Comment 9 by bugdroid1@chromium.org, Apr 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/81c4e4ab9d81757ce3dcb49185be46c880f3f22a

commit 81c4e4ab9d81757ce3dcb49185be46c880f3f22a
Author: raphael.kubo.da.costa <raphael.kubo.da.costa@intel.com>
Date: Tue Apr 11 20:36:43 2017

bindings: Use ExceptionMessages when an interface/callback conversion fails.

https://codereview.chromium.org/2802223002 ("bindings: Throw a type error if
converting an interface or callback function fails") introduced a 32kb size
regression on release Android builds (is_official_build=true), as the new
error strings being thrown as type errors could not be shared and all made
it into the .rodata section.

Start using ExceptionMessages::FailedToConstruct() in the error messages.
Not only do we use the existing error infrastructure, but it allows us to
separate the part that always changes (the callback or interface name) from
the actual details (the "Unable to convert value" bit).

With commit 07c092298a6243fc2c829e517cf2b19f4caea26c ("Fetch: Make Headers'
constructor match the current spec IDL") as a baseline, the following data
can be observed with //tools/binary_size/map2size.py and console.py:

* Reverting the changes from https://codereview.chromium.org/2802223002
  versus this commit:

  Section Sizes (Total=-168 bytes):
    .bss: 0 bytes (not included in totals)
    .data: 0 bytes (-0.0%)
    .data.rel.ro: 0 bytes (-0.0%)
    .data.rel.ro.local: 0 bytes (-0.0%)
    .rodata: 256 bytes (-152.4%)
    .text: -424 bytes (252.4%)
  0 symbols added (+), 27 changed (~), 3 removed (-), 313837 unchanged (not shown)

  Showing 30 symbols with total size: -160 bytes
  .text=-416 bytes .rodata=256 bytes  other=0 bytes    total=-160 bytes
  Number of object files: 28

* Commit b1bbca356abfa6f8fdec3cd5815f18b164491a45 versus this commit:

  Section Sizes (Total=-33,704 bytes):
    .bss: 0 bytes (not included in totals)
    .data: 0 bytes (-0.0%)
    .data.rel.ro: 0 bytes (-0.0%)
    .data.rel.ro.local: 0 bytes (-0.0%)
    .rodata: -33,280 bytes (98.7%)
    .text: -424 bytes (1.3%)
  0 symbols added (+), 27 changed (~), 3 removed (-), 313837 unchanged (not shown)

  Showing 30 symbols with total size: -33696 bytes
  .text=-416 bytes .rodata=-32.5kb    other=0 bytes    total=-32.9kb
  Number of object files: 28

BUG= 690428 ,710035
R=agrieve@chromium.org,bashi@chromium.org,haraken@chromium.org,jbroman@chromium.org,yukishiino@chromium.org

Review-Url: https://codereview.chromium.org/2809003004
Cr-Commit-Position: refs/heads/master@{#463753}

[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/core/v8/ExceptionMessages.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/core/v8/ExceptionMessages.h
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsImplTest.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/templates/callback_function.cpp.tmpl
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/AnyCallbackFunctionOptionalAnyArg.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/LongCallbackFunction.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/StringSequenceCallbackFunctionLongSequenceArg.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBuffer.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBufferView.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8DataView.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8SVGTestInterface.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestConstants.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestException.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEmpty.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceSecureContext.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/V8Uint8ClampedArray.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunction.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunctionInterfaceArg.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunctionTypedef.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp
[modify] https://crrev.com/81c4e4ab9d81757ce3dcb49185be46c880f3f22a/third_party/WebKit/Source/bindings/tests/results/modules/VoidCallbackFunctionModules.cpp

Cc: szager@chromium.org raphael....@intel.com rbasuvula@chromium.org domenic@chromium.org
 Issue 690005  has been merged into this issue.
I wrote up https://github.com/w3c/web-platform-tests/issues/5566 to track getting a proper test for this into web-platform-tests. It includes an early draft test at http://jsbin.com/nemazayubu/edit?html,console,output which is targeted at catching a potential bad "fast path" optimization. (But, I am not yet 100% sure that my test is valid, since I can't find any browser that passes it yet.)
That's much appreciated! I'm not sure if you've seen the discussion about this in comments 6 and 7 of https://codereview.chromium.org/2810843002/, so that's definitely helpful in deciding what to do. I'll get back to this after Monday's national holiday.
For the record: https://codereview.chromium.org/2821493002 was landed and is related to this bug, I just used the wrong number in the CL description...
Blocking: 713200
Project Member

Comment 15 by bugdroid1@chromium.org, Apr 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f

commit 941cc09b668fbbe90f3e8fd65e8773e1d38bd66f
Author: raphael.kubo.da.costa <raphael.kubo.da.costa@intel.com>
Date: Wed Apr 19 17:21:03 2017

bindings: Make the sequence conversion code more compliant with WebIDL.

The existing bindings still referenced WebIDL array types that were removed
from the spec in 2015, and converting JS types to IDL sequences with an
algorithm that expected either a JS array (in which case it just iterated
over each element) or an object that adhered to an outdated protocol where a
"length" property was expected.

The current WebIDL sequence conversion steps are simpler and described in
https://heycam.github.io/webidl/#es-sequence. In short, JS objects are
converted to sequences via @@iterator and the regular iteration protocol of
calling next() and checking the returned object.

This works with arrays as well as any object that implements a valid
Symbol.iterator property. It opens the way for custom iterators, the lack of
which was causing some layout tests to fail. In other words, any iterable JS
object can now be converted into a sequence<>.

The downside is that the Blink-V8 communication required for calling
@@iterator, invoking next() and checking objects on every iteration step is
costlier than what we had before, so the "fast case" has been preserved for
JS arrays (even though it is not 100% clear if this is a valid shortcut to
take, it at least does not introduce any regression compared to the previous
code).

This is part 1: several functions in V8Binding.h that implement the old
conversion algorithm (e.g. ToMemberNativeArray(), ToImplArray(),
ToV8Sequence() and ToImplSequence()) have not been removed yet, and their
callers in the code base have not yet been changed. This will come at a
later point in the future.

BUG= 690428 
R=bashi@chromium.org,haraken@chromium.org,yukishiino@chromium.org

Review-Url: https://codereview.chromium.org/2826673004
Cr-Commit-Position: refs/heads/master@{#465649}

[add] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/LayoutTests/bindings/sequence-type.html
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/LayoutTests/crypto/subtle/aes-cbc/generateKey-failures-expected.txt
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/LayoutTests/crypto/subtle/unwrapKey-badParameters-expected.txt
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/LayoutTests/external/wpt/FileAPI/blob/Blob-constructor-expected.txt
[delete] https://crrev.com/1137b41f7fc845c2e7c6555c1d6dee6f75fa8236/third_party/WebKit/LayoutTests/external/wpt/fetch/api/headers/headers-record-expected.txt
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-expected.txt
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/LayoutTests/fast/canvas/canvas-lineDash-input-sequence.html
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/LayoutTests/fast/dom/idl-union-type-unittest-expected.txt
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/LayoutTests/fast/events/constructors/message-event-constructor-expected.txt
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/LayoutTests/fast/events/constructors/message-event-constructor.html
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/LayoutTests/fast/events/message-event-max-ports-expected.txt
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/LayoutTests/fast/events/message-event-max-ports.html
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/LayoutTests/fast/files/blob-constructor-expected.txt
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/LayoutTests/fast/files/blob-constructor.html
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/LayoutTests/fast/files/file-constructor-expected.txt
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/LayoutTests/fast/files/file-constructor.html
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamConstructor-expected.txt
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-expected.txt
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/LayoutTests/platform/linux/external/wpt/FileAPI/blob/Blob-constructor-expected.txt
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/LayoutTests/platform/win/external/wpt/FileAPI/blob/Blob-constructor-expected.txt
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/LayoutTests/storage/websql/execute-sql-args-expected.txt
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/LayoutTests/storage/websql/execute-sql-args.js
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/files/blob-constructor-expected.txt
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/webaudio/dom-exceptions-expected.txt
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/LayoutTests/webaudio/dom-exceptions-expected.txt
[add] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/PerformanceTests/Bindings/sequence-conversion-custom-iterator.html
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsImpl.h
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsImplTest.cpp
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/bindings/core/v8/ScriptValue.h
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/bindings/scripts/v8_methods.py
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/bindings/scripts/v8_types.py
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/bindings/templates/union_container.cpp.tmpl
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/bindings/tests/results/core/BooleanOrElementSequence.cpp
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/bindings/tests/results/core/ByteStringSequenceSequenceOrByteStringByteStringRecord.cpp
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/bindings/tests/results/core/DoubleOrLongOrBooleanSequence.cpp
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/bindings/tests/results/core/DoubleOrStringOrDoubleOrStringSequence.cpp
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/bindings/tests/results/core/ElementSequenceOrByteStringDoubleOrStringRecord.cpp
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/bindings/tests/results/core/LongSequenceOrEvent.cpp
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/bindings/tests/results/core/NodeOrLongSequenceOrEventOrXMLHttpRequestOrStringOrStringByteStringOrNodeListRecord.cpp
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/bindings/tests/results/core/StringOrStringSequence.cpp
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/bindings/tests/results/core/StringSequenceCallbackFunctionLongSequenceArg.cpp
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/core/BUILD.gn
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/core/core_idl_files.gni
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/core/testing/Internals.cpp
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/core/testing/Internals.h
[modify] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/core/testing/Internals.idl
[add] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/core/testing/SequenceTest.cpp
[add] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/core/testing/SequenceTest.h
[add] https://crrev.com/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f/third_party/WebKit/Source/core/testing/SequenceTest.idl

Labels: M-60
Project Member

Comment 17 by bugdroid1@chromium.org, Apr 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2c772b93310fcf295f3de133e67095c7fe49a910

commit 2c772b93310fcf295f3de133e67095c7fe49a910
Author: raphael.kubo.da.costa <raphael.kubo.da.costa@intel.com>
Date: Fri Apr 21 12:32:46 2017

bindings: Port bindings/core/v8 away from ToImplArray APIs.

Convert callers of ToImplArray, ToImplSequence and ToMemberNativeArray to
NativeValueTraits<IDLSequence<T>>::NativeValue().

This is another step towards removing most of the functions above and
centralizing conversions from JS types to WebIDL sequences in a single
location.

BUG= 690428 
R=bashi@chromium.org,haraken@chromium.org,yukishiino@chromium.org

Review-Url: https://codereview.chromium.org/2831943002
Cr-Commit-Position: refs/heads/master@{#466317}

[delete] https://crrev.com/8aacc8f8d02e5b19f491b34f744085dd2c521167/third_party/WebKit/LayoutTests/external/wpt/webmessaging/with-ports/027-expected.txt
[modify] https://crrev.com/2c772b93310fcf295f3de133e67095c7fe49a910/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-args-expected.txt
[modify] https://crrev.com/2c772b93310fcf295f3de133e67095c7fe49a910/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-args.html
[modify] https://crrev.com/2c772b93310fcf295f3de133e67095c7fe49a910/third_party/WebKit/LayoutTests/fast/events/init-message-event-expected.txt
[modify] https://crrev.com/2c772b93310fcf295f3de133e67095c7fe49a910/third_party/WebKit/LayoutTests/fast/events/init-message-event.html
[modify] https://crrev.com/2c772b93310fcf295f3de133e67095c7fe49a910/third_party/WebKit/LayoutTests/fast/events/message-port-multi-expected.txt
[modify] https://crrev.com/2c772b93310fcf295f3de133e67095c7fe49a910/third_party/WebKit/LayoutTests/fast/events/resources/message-port-multi.js
[modify] https://crrev.com/2c772b93310fcf295f3de133e67095c7fe49a910/third_party/WebKit/LayoutTests/fast/workers/worker-context-multi-port-expected.txt
[modify] https://crrev.com/2c772b93310fcf295f3de133e67095c7fe49a910/third_party/WebKit/LayoutTests/fast/workers/worker-multi-port-expected.txt
[modify] https://crrev.com/2c772b93310fcf295f3de133e67095c7fe49a910/third_party/WebKit/LayoutTests/fast/workers/worker-onerror-09-expected.txt
[modify] https://crrev.com/2c772b93310fcf295f3de133e67095c7fe49a910/third_party/WebKit/LayoutTests/fast/workers/worker-onerror-09.html
[modify] https://crrev.com/2c772b93310fcf295f3de133e67095c7fe49a910/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/workers/worker-onerror-09-expected.txt
[modify] https://crrev.com/2c772b93310fcf295f3de133e67095c7fe49a910/third_party/WebKit/Source/bindings/core/v8/DictionaryHelperForCore.cpp
[modify] https://crrev.com/2c772b93310fcf295f3de133e67095c7fe49a910/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinitionBuilder.cpp
[modify] https://crrev.com/2c772b93310fcf295f3de133e67095c7fe49a910/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseTest.cpp
[modify] https://crrev.com/2c772b93310fcf295f3de133e67095c7fe49a910/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp
[modify] https://crrev.com/2c772b93310fcf295f3de133e67095c7fe49a910/third_party/WebKit/Source/bindings/core/v8/custom/V8MessageEventCustom.cpp

Project Member

Comment 18 by bugdroid1@chromium.org, Apr 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6a454cf34b139d4b7768e0fcc7fbb035506e14c3

commit 6a454cf34b139d4b7768e0fcc7fbb035506e14c3
Author: raphael.kubo.da.costa <raphael.kubo.da.costa@intel.com>
Date: Mon Apr 24 13:44:46 2017

bindings: Port away from ToImplArray/ToMemberNativeArray.

Now that the bindings themselves have been converted, move callers in core/
and modules/ to NativeValueTraits::NativeValue(), which implements the
current WebIDL JS->sequence conversion steps that the To*Array() functions
do not.

BUG= 690428 
R=bashi@chromium.org,haraken@chromium.org,yukishiino@chromium.org

Review-Url: https://codereview.chromium.org/2833983004
Cr-Commit-Position: refs/heads/master@{#466624}

[modify] https://crrev.com/6a454cf34b139d4b7768e0fcc7fbb035506e14c3/third_party/WebKit/LayoutTests/csspaint/parse-input-arguments-expected.txt
[modify] https://crrev.com/6a454cf34b139d4b7768e0fcc7fbb035506e14c3/third_party/WebKit/LayoutTests/csspaint/registerPaint-expected.txt
[modify] https://crrev.com/6a454cf34b139d4b7768e0fcc7fbb035506e14c3/third_party/WebKit/Source/core/frame/DOMTimerTest.cpp
[modify] https://crrev.com/6a454cf34b139d4b7768e0fcc7fbb035506e14c3/third_party/WebKit/Source/modules/cachestorage/Cache.cpp
[modify] https://crrev.com/6a454cf34b139d4b7768e0fcc7fbb035506e14c3/third_party/WebKit/Source/modules/cachestorage/CacheTest.cpp
[modify] https://crrev.com/6a454cf34b139d4b7768e0fcc7fbb035506e14c3/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp

Project Member

Comment 19 by bugdroid1@chromium.org, Apr 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/345e0fb9fe291f6d32d47365f5767099ccf87d30

commit 345e0fb9fe291f6d32d47365f5767099ccf87d30
Author: raphael.kubo.da.costa <raphael.kubo.da.costa@intel.com>
Date: Tue Apr 25 10:32:08 2017

bindings: Remove unused To*Array() and ToV8Sequence() functions.

With all callers converted to
NativeValueTraits<IDLSequence<T>>::NativeValue(), which implements the most
recent WebIDL JS->Sequence conversion steps (including custom iterators), we
can remove several unused functions and deprecated NativeValueTraits
specializations.

Of all the To*Array() functions left, only ToImplArray(Vector<ScriptValue>)
was not removed, as it still serves a purpose and will just be renamed in
the future. V8BindingTest was accordingly adjust to only test that one
function.

BUG= 690428 , 713200 
R=bashi@chromium.org,haraken@chromium.org,yukishiino@chromium.org

Review-Url: https://codereview.chromium.org/2840563002
Cr-Commit-Position: refs/heads/master@{#466940}

[modify] https://crrev.com/345e0fb9fe291f6d32d47365f5767099ccf87d30/third_party/WebKit/Source/bindings/core/v8/ExceptionMessages.cpp
[modify] https://crrev.com/345e0fb9fe291f6d32d47365f5767099ccf87d30/third_party/WebKit/Source/bindings/core/v8/ExceptionMessages.h
[modify] https://crrev.com/345e0fb9fe291f6d32d47365f5767099ccf87d30/third_party/WebKit/Source/bindings/core/v8/V8BindingForCore.h
[modify] https://crrev.com/345e0fb9fe291f6d32d47365f5767099ccf87d30/third_party/WebKit/Source/bindings/core/v8/V8BindingTest.cpp

Blocking: 715122
wrt comment #11: I've filed bug 715122 to track it.
Status: Fixed (was: Started)
I think we can close this one. Any JS object with an @@iterator symbol can now be converted to a WebIDL sequence, with further optimizations tracked in bug 715122.

Sign in to add a comment