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

Issue 685754 link

Starred by 3 users

Issue metadata

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

Blocking:
issue 680531



Sign in to add a comment

Support WebIDL record<k,v> type

Project Member Reported by jsb...@chromium.org, Jan 26 2017

Issue description

Abstract type: https://heycam.github.io/webidl/#idl-record
ECMAScript binding: https://heycam.github.io/webidl/#es-record

This is a newish feature in WebIDL, so far used in Fetch (https://fetch.spec.whatwg.org/#headers-class) and URL (https://url.spec.whatwg.org/#interface-urlsearchparams). Earlier proposals for the same thing included "open ended dictionary".

 
https://github.com/heycam/webidl/pull/180 and https://github.com/whatwg/fetch/issues/164 provide some additional context and explain why the feature ended up not being called "open-ended dictionary".

One thing that seems to be mentioned very briefly is that iterable interfaces can be coerced into records, which is the reason the HeadersInit typedef (https://fetch.spec.whatwg.org/#typedefdef-headersinit) does not explicitly include Headers itself there.

Comment 2 by jsb...@chromium.org, Jan 27 2017

Yeah, I'm not sure where in WebIDL the logic exists so that iterable interfaces are treated like sequences rather than records. It's probably in there somewhere....
I think you're right, iterables are converted to sequences, not records. References: https://github.com/heycam/webidl/commit/a3086987a22efd849937037f05e0ecd25e1cc5ef, https://heycam.github.io/webidl/#create-sequence-from-iterable and https://heycam.github.io/webidl/#es-union (the Headers case is likely step 11.1 there).
Cc: tyoshino@chromium.org hirosh...@chromium.org yhirano@chromium.org
I've attached bz's draft test for the Headers use of record<>.
headers-record.html
11.8 KB View Download
Cc: horo@chromium.org
Owner: raphael....@intel.com
Status: Started (was: Available)
I'm taking a stab at this. It's a bit annoying that some of the record-related parts of the spec are still undergoing some changes, but I'll see how far I can get.
I finally have some working code that passes all of Boris' tests (which have since been added to web-platform-tests).

I had to add some local hacks to get things to pass though, as our union bindings code currently does not check for @@iterator to determine if it's passed a sequence and that basically breaks all tests.

My code still needs some cleanup, but think I can start sending some CLs.
Project Member

Comment 8 by bugdroid1@chromium.org, Feb 22 2017

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

commit 4bec0d7dc53aa20a83fbd1b4e6bf097b5ff4dded
Author: raphael.kubo.da.costa <raphael.kubo.da.costa@intel.com>
Date: Wed Feb 22 10:12:44 2017

idl_parser: Add support for the record<K, V> WebIDL type.

This CL is the first step towards fully supporting it in the bindings code.
It merely makes the IDL parser aware of the new type (namely, the
"RecordType" symbol) by updating the grammar to match the current WebIDL
version.

The devil is in the details though: the IDL parser was also unaware of the
"StringType" symbol that comprises ByteStrings, DOMStrings and
USVStrings (the only allowed key types for records), so most of the patch is
just updating existing tests to consider those 3 string types StringTypes,
not PrimitiveTypes.

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

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

[modify] https://crrev.com/4bec0d7dc53aa20a83fbd1b4e6bf097b5ff4dded/third_party/WebKit/Source/bindings/scripts/idl_definitions.py
[modify] https://crrev.com/4bec0d7dc53aa20a83fbd1b4e6bf097b5ff4dded/tools/idl_parser/idl_lexer.py
[modify] https://crrev.com/4bec0d7dc53aa20a83fbd1b4e6bf097b5ff4dded/tools/idl_parser/idl_parser.py
[modify] https://crrev.com/4bec0d7dc53aa20a83fbd1b4e6bf097b5ff4dded/tools/idl_parser/idl_ppapi_lexer.py
[modify] https://crrev.com/4bec0d7dc53aa20a83fbd1b4e6bf097b5ff4dded/tools/idl_parser/idl_ppapi_parser.py
[modify] https://crrev.com/4bec0d7dc53aa20a83fbd1b4e6bf097b5ff4dded/tools/idl_parser/test_lexer/keywords.in
[modify] https://crrev.com/4bec0d7dc53aa20a83fbd1b4e6bf097b5ff4dded/tools/idl_parser/test_parser/dictionary_web.idl
[modify] https://crrev.com/4bec0d7dc53aa20a83fbd1b4e6bf097b5ff4dded/tools/idl_parser/test_parser/exception_web.idl
[modify] https://crrev.com/4bec0d7dc53aa20a83fbd1b4e6bf097b5ff4dded/tools/idl_parser/test_parser/interface_web.idl
[modify] https://crrev.com/4bec0d7dc53aa20a83fbd1b4e6bf097b5ff4dded/tools/idl_parser/test_parser/typedef_web.idl

Project Member

Comment 9 by bugdroid1@chromium.org, Feb 27 2017

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

commit 02ba668f1ae4306618c08ef19ed5d85ed4d481d2
Author: raphael.kubo.da.costa <raphael.kubo.da.costa@intel.com>
Date: Mon Feb 27 13:18:58 2017

bindings: Add idl_types.IdlRecordType.

Part 2 of adding support for record<K,V> WebIDL types to the bindings
generator.

This CL lands the uncontroversial bits that the idl_* side (as opposed to
the v8_* side) of the scripts will need:
- A new IdlRecordType type that wraps a record<K,V> and holds information
  about its key and value types.
- Code to parse Record nodes and convert them into IdlRecordTypes when
  parsing IDL files.

In practice, this is still a no-op, as we do not do anything with this new
IDL type just yet.

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

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

[modify] https://crrev.com/02ba668f1ae4306618c08ef19ed5d85ed4d481d2/third_party/WebKit/Source/bindings/scripts/idl_definitions.py
[modify] https://crrev.com/02ba668f1ae4306618c08ef19ed5d85ed4d481d2/third_party/WebKit/Source/bindings/scripts/idl_types.py
[modify] https://crrev.com/02ba668f1ae4306618c08ef19ed5d85ed4d481d2/third_party/WebKit/Source/bindings/scripts/idl_types_test.py

Blocking: 680531
If anyone's interested, I've been discussing this with bashi@, haraken@ and yukishiino@. https://codereview.chromium.org/2709983004/ contains a WIP version of everything that's needed to support records -- I think I covered lots of use cases in the layout test I added.

The biggest blocker is that the code in that CL generates per-record bindings files in order to convert the V8 keys and values into the right C++ objects (since we don't have a uniform way to convert strings, integers, dictionaries, unions, interfaces, DOMWindows etc etc). That isn't very good, so I've been focusing on trying to provide a more uniform interface for the V8->C++ conversion (see https://codereview.chromium.org/2725673002/ for a WIP patch in that direction).
Project Member

Comment 12 by bugdroid1@chromium.org, Mar 2 2017

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

commit c463181850479e23e89ebd766fbe1fa2990d9d51
Author: raphael.kubo.da.costa <raphael.kubo.da.costa@intel.com>
Date: Thu Mar 02 10:23:26 2017

bindings: Add ToV8() overload for HeapVector<std::pair<String, T>>.

record<K,V> WebIDL support part 3.

The upcoming record<K,V> WebIDL type will be represented by a
HeapVector<std::pair<String, T>> when T is either a Member<U>.

Add a ToV8() overload that is identical to the existing one for
Vector<std::pair<String, T>> so all kinds of records can be serialized back
to V8.

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

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

[modify] https://crrev.com/c463181850479e23e89ebd766fbe1fa2990d9d51/third_party/WebKit/Source/bindings/core/v8/ToV8.h
[modify] https://crrev.com/c463181850479e23e89ebd766fbe1fa2990d9d51/third_party/WebKit/Source/bindings/core/v8/ToV8Test.cpp

Project Member

Comment 13 by bugdroid1@chromium.org, Mar 6 2017

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

commit 1f9c453ba2dfb9dbf175486f64ceb55da41717f8
Author: raphael.kubo.da.costa <raphael.kubo.da.costa@intel.com>
Date: Mon Mar 06 09:30:19 2017

bindings: Use fixed-size integer types in the generated code.

Not only does this make the generated code more aligned with the style
guide, but it also helps the ongoing work to add more NativeValueTraits
specializations for IDL types in order to support the record<K,V> type.

BUG= 432749 , 685754 
R=bashi@chromium.org,haraken@chromium.org,yukishiino@chromium.org

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

[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/scripts/v8_types.py
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/LongCallbackFunction.cpp
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/LongCallbackFunction.h
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/LongOrTestDictionary.cpp
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/LongOrTestDictionary.h
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/StringSequenceCallbackFunctionLongSequenceArg.cpp
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/StringSequenceCallbackFunctionLongSequenceArg.h
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.cpp
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.h
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/TestDictionaryDerivedImplementedAs.cpp
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/TestDictionaryDerivedImplementedAs.h
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceOrLong.cpp
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceOrLong.h
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/V8TestException.cpp
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.cpp
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.cpp
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.cpp
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/modules/quota/StorageQuotaCallback.h
[modify] https://crrev.com/1f9c453ba2dfb9dbf175486f64ceb55da41717f8/third_party/WebKit/Source/modules/quota/StorageUsageCallback.h

Project Member

Comment 14 by bugdroid1@chromium.org, Mar 7 2017

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

commit 504550f038ae920fbc2bee9797f298189262e4fc
Author: raphael.kubo.da.costa <raphael.kubo.da.costa@intel.com>
Date: Tue Mar 07 09:27:01 2017

bindings: Add C++ versions of WebIDL types and generalize NativeValueTraits.

This being introduced primarily in order to support the record<K,V> WebIDL
type, as it needs to be able to convert arbitrary JS objects into their C++
counterparts without all the information available to the IDL code generator
at build-time.

The changes are two-fold:

1. IDLTypes.h contains C++ classes corresponding to the basic WebIDL
   types. At the moment they are limited to booleans, numbers, strings,
   promises and sequences. All classes inherit from IDLBase, and provide
   information about their corresponding C++ types (e.g. an IDLOctet
   corresponds to an uint8_t).

2. NativeValueTraits was expanded to cope with both the existing template
   specializations which essentially have the type one expects nativeValue()
   to return (e.g. AtomicString, double etc) as well as the new variations
   introduced for the IDL types above: when NativeValueTraits is specialized
   for an IDLBase-based type, all type information is derived from it.

The idea behind 1) and 2) is that NativeValueTraits<T>::nativeValue() should
be a standard interface for converting any JS value to C++ by interpreting
the JS value as a T.

Wherever possible, v8_types.py now generates invocations to
NativeValueTraits<T>::nativeValue() instead of direct calls to type-specific
conversion functions. It was not done when the conversion functions
themselves take arguments that do not match nativeValue()'s signature. For
example, converting to a Promise or an IDL interface does not require an
ExceptionState, so using nativeValue() would introduce unnecessary overhead
by requiring an ExceptionState to be created and passed.

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

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

[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/bindings.gni
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/core/v8/Dictionary.h
[add] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/core/v8/IDLTypes.h
[add] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/core/v8/IDLTypesBase.h
[add] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/core/v8/IDLTypesTest.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/core/v8/NativeValueTraits.h
[add] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsImpl.h
[add] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsTest.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/scripts/v8_callback_function.py
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/scripts/v8_dictionary.py
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/scripts/v8_interface.py
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/scripts/v8_types.py
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/scripts/v8_union.py
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/templates/callback_function.cpp.tmpl
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/templates/callback_function.h.tmpl
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/templates/dictionary_v8.h.tmpl
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/templates/interface.h.tmpl
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/templates/union_container.h.tmpl
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/AnyCallbackFunctionOptionalAnyArg.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/AnyCallbackFunctionOptionalAnyArg.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/ArrayBufferOrArrayBufferViewOrDictionary.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/ArrayBufferOrArrayBufferViewOrDictionary.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/BooleanOrStringOrUnrestrictedDouble.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/BooleanOrStringOrUnrestrictedDouble.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/DoubleOrString.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/DoubleOrString.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/LongCallbackFunction.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/LongCallbackFunction.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/LongOrTestDictionary.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/LongOrTestDictionary.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/NodeOrNodeList.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/StringOrArrayBufferOrArrayBufferView.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/StringOrArrayBufferOrArrayBufferView.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/StringOrDouble.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/StringOrDouble.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/StringOrStringSequence.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/StringOrStringSequence.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/StringSequenceCallbackFunctionLongSequenceArg.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/StringSequenceCallbackFunctionLongSequenceArg.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/TestEnumOrDouble.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/TestEnumOrDouble.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/TestInterface2OrUint8Array.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceGarbageCollectedOrString.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceGarbageCollectedOrString.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceOrLong.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceOrLong.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceOrTestInterfaceEmpty.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBuffer.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBuffer.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBufferView.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBufferView.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8DataView.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8DataView.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8SVGTestInterface.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8SVGTestInterface.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackInterface.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestConstants.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestConstants.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionaryDerived.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestException.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestException.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEmpty.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEmpty.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInit.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceSecureContext.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceSecureContext.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestPermissiveDictionary.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestPermissiveDictionary.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8Uint8ClampedArray.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/V8Uint8ClampedArray.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunction.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunction.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunctionInterfaceArg.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunctionInterfaceArg.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunctionTypedef.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunctionTypedef.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/modules/BooleanOrString.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/modules/BooleanOrString.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface2Partial.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface2Partial.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/modules/VoidCallbackFunctionModules.cpp
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/bindings/tests/results/modules/VoidCallbackFunctionModules.h
[modify] https://crrev.com/504550f038ae920fbc2bee9797f298189262e4fc/third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.cpp

Project Member

Comment 15 by bugdroid1@chromium.org, Mar 9 2017

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

commit 5254358bc67bb4f7ef54cc68a69387d5aabd719e
Author: raphael.kubo.da.costa <raphael.kubo.da.costa@intel.com>
Date: Thu Mar 09 15:26:17 2017

bindings: Adjust usage of CORE_EXPORT in IDLTypes and NativeValueTraits

Follow-up to https://codereview.chromium.org/2730183003:
* The types in IDLTypes.h are traits types with no member functions, so
  using CORE_EXPORT does not have any effect and we can drop it.
* Export the entire NativeValueTraits specializations in
  NativeValueTraitsImpl.h instead of only their nativeValue() member
  functions.
  In addition to avoiding some repetition in the code, doing so also solves
  some linkage issues on Windows with debug component builds, where targets
  such as 'webkit_unit_tests' or 'blink_media_unittests' would fail to
  reference the aforementioned specializations and lead to errors like this:

    FAILED: media_blink_unittests.exe media_blink_unittests.exe.pdb
    E:/b/depot_tools/python276_bin/python.exe ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x64 False link.exe /nologo /OUT:./media_blink_unittests.exe /PDB:./media_blink_unittests.exe.pdb @./media_blink_unittests.exe.rsp
    V8RecordTest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class WTF::Vector<struct std::pair<class WTF::String,int>,0,class WTF::PartitionAllocator> __cdecl blink::NativeValueTraits<struct blink::IDLRecord<struct blink::IDLString,struct blink::IDLLong> >::nativeValue(class v8::Isolate *,class v8::Local<class v8::Value>,class blink::ExceptionState &)" (__imp_?nativeValue@?$NativeValueTraits@U?$IDLRecord@UIDLString@blink@@UIDLLong@2@@blink@@@blink@@SA?AV?$Vector@U?$pair@VString@WTF@@H@std@@$0A@VPartitionAllocator@WTF@@@WTF@@PEAVIsolate@v8@@V?$Local@VValue@v8@@@6@AEAVExceptionState@2@@Z) referenced in function "void __cdecl blink::RecordTestV8Internal::setStringLongRecordMethod(class v8::FunctionCallbackInfo<class v8::Value> const &)" (?setStringLongRecordMethod@RecordTestV8Internal@blink@@YAXAEBV?$FunctionCallbackInfo@VValue@v8@@@v8@@@Z)

  The exception to the rule here is IDLSequence: since it needs template
  parameters of its own, it is not a full specialization of
  NativeValueTraitsBase, and at least win_clang complains when it is
  exported:

    E:\b\c\b\win_clang\src\third_party\WebKit\Source\bindings\core\v8\NativeValueTraitsImpl.h(289,8):  error: 'dllimport' attribute ignored [-Werror,-Wignored-attributes]
    struct CORE_EXPORT NativeValueTraits<IDLSequence<T>>

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

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

[modify] https://crrev.com/5254358bc67bb4f7ef54cc68a69387d5aabd719e/third_party/WebKit/Source/bindings/core/v8/IDLTypes.h
[modify] https://crrev.com/5254358bc67bb4f7ef54cc68a69387d5aabd719e/third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsImpl.h

Project Member

Comment 16 by bugdroid1@chromium.org, Mar 10 2017

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

commit 90659e8a6bbc7e40ea3145c19af3138f484beb52
Author: raphael.kubo.da.costa <raphael.kubo.da.costa@intel.com>
Date: Fri Mar 10 13:09:27 2017

bindings: Add support for the record<K,V> WebIDL type.

Records (https://heycam.github.io/webidl/#idl-record) are ordered
associative arrays mapping instances of K to instances of V, where K must be
a ByteString, a DOMString or an USVString.

In C++, we represent records as Vector<std::pair<k,v>> (or HeapVector),
which are converted from V8 objects via

    NativeValueTraits<IDLRecord<K, V>>::nativeValue()

To convert the C++ Vectors back to V8 objects, we piggyback on already
existing ToV8() overloads for Vector<std::pair<>> and HeapVector.

The majority of the required work to support this new IDL type has already
landed and concerned making it possible to convert JS values to arbitrary
C++ types without knowing much about them (there is a single JS->C++
conversion function that needs to work for pretty much any JS data type).

This CL mainly makes the Python bindings code aware of this new type and
allows it to generate the appropriate JS->C++ and C++->V8 calls, and adds
the IDLRecord NativeValueTraits template specialization mentioned above. All
the rest is new tests and updates to existing expectations.

It is also important to note that the JS->C++ conversion code relies on a
NativeValueTraits specialization existing for the record value types, and
they are always used regardless of whether they are the fastest way to
convert data or not -- for example, it always creates and uses an
ExceptionState even if the actual conversion functions do not use it (as is
the case for toDOMWindow() or ScriptValue()).

Finally, while here rename IDLSequence::MaybeWrappedCppType to IDLSequence::MaybeMemberCppType to avoid confusion (and do the same for IDLRecord), as "wrapper" in a bindings context tends to refer to the V8 wrapper for DOM objects, which is not the case here.

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

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

[add] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/LayoutTests/bindings/record-type.html
[modify] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/bindings/bindings.gni
[modify] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/bindings/core/v8/BUILD.gn
[modify] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/bindings/core/v8/IDLTypes.h
[modify] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/bindings/core/v8/IDLTypesTest.cpp
[modify] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsImpl.h
[add] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsImplTest.cpp
[modify] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/bindings/core/v8/ToV8.h
[modify] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/bindings/scripts/v8_interface.py
[modify] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/bindings/scripts/v8_types.py
[modify] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/bindings/scripts/v8_union.py
[modify] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/bindings/templates/union_container.cpp.tmpl
[modify] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/bindings/tests/idls/core/TestDictionary.idl
[modify] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/bindings/tests/idls/core/TestTypedefs.idl
[add] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/bindings/tests/results/core/ByteStringSequenceSequenceOrByteStringByteStringRecord.cpp
[add] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/bindings/tests/results/core/ByteStringSequenceSequenceOrByteStringByteStringRecord.h
[modify] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.cpp
[modify] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.h
[modify] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp
[modify] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp
[modify] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.h
[modify] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/core/BUILD.gn
[modify] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/core/core_idl_files.gni
[modify] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/core/testing/Internals.cpp
[modify] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/core/testing/Internals.h
[modify] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/core/testing/Internals.idl
[add] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/core/testing/RecordTest.cpp
[add] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/core/testing/RecordTest.h
[add] https://crrev.com/90659e8a6bbc7e40ea3145c19af3138f484beb52/third_party/WebKit/Source/core/testing/RecordTest.idl

Project Member

Comment 17 by bugdroid1@chromium.org, Mar 10 2017

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

commit 0cc6a606ab68c783fe908f848f267b255da570ef
Author: raphael.kubo.da.costa <raphael.kubo.da.costa@intel.com>
Date: Fri Mar 10 15:09:22 2017

bindings: Remove "inline" from NativeValueTraitsImpl methods

These methods are all being declared and defined in the same place, so the
inline keyword is redundant.

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

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

[modify] https://crrev.com/0cc6a606ab68c783fe908f848f267b255da570ef/third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsImpl.h

Status: Fixed (was: Started)
I guess we can finally close this one :)

record<K,V> support is there for most types. If things are not working as expected, I'd be glad to look at new bug reports. Big thanks to haraken, bashi and yukishiino for the help so far!
Project Member

Comment 19 by bugdroid1@chromium.org, Mar 16 2017

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

commit 73201f61646ab7e1c2aca0a5bd5994aa82958e42
Author: raphael.kubo.da.costa <raphael.kubo.da.costa@intel.com>
Date: Thu Mar 16 12:15:31 2017

bindings: Add the proper includes for unions inside records

While https://codereview.chromium.org/2749253002 took care of adding all
required includes and forward-declarations for unions inside records inside
other unions, it did not solve it for unions inside records which were _not_
inside other unions: in this case, v8_union is not used at all, so we need
to patch code_generator_v8.depending_union_type() instead.

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

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

[modify] https://crrev.com/73201f61646ab7e1c2aca0a5bd5994aa82958e42/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py
[modify] https://crrev.com/73201f61646ab7e1c2aca0a5bd5994aa82958e42/third_party/WebKit/Source/bindings/tests/idls/core/TestDictionary.idl
[modify] https://crrev.com/73201f61646ab7e1c2aca0a5bd5994aa82958e42/third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.cpp
[modify] https://crrev.com/73201f61646ab7e1c2aca0a5bd5994aa82958e42/third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.h
[modify] https://crrev.com/73201f61646ab7e1c2aca0a5bd5994aa82958e42/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp

Project Member

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

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

commit d54885458b5fbe0ea6a3d9997457cef8e12243dd
Author: raphael.kubo.da.costa <raphael.kubo.da.costa@intel.com>
Date: Tue Apr 18 12:19:09 2017

bindings: Add performance test for JS->WebIDL sequence conversions.

At the moment, we only test it with arrays, as we are still working on the
code to convert arbitrary objects with an @@iterator property into
sequences.

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

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

[add] https://crrev.com/d54885458b5fbe0ea6a3d9997457cef8e12243dd/third_party/WebKit/PerformanceTests/Bindings/sequence-conversion-array.html

Oops, comment #20 should've been sent to  issue 690428 ...

Sign in to add a comment