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

Issue 2709983004: WIP bindings: Add support for the record<K,V> WebIDL type. (Closed)

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

Description

WIP 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. The current implementation represents records in C++ as Vector<std::pair<k,v>>, which are converted from V8 objects via custom toImpl<RecordName>() functions. To convert the C++ Vectors back to V8 objects, we piggyback on an already existing ToV8() overload for Vector<std::pair<>>. BUG=685754

Patch Set 1 #

Patch Set 2 : Patch v2 #

Patch Set 3 : Patch v2 with correct bindings expectations #

Patch Set 4 : Mostly-static toImplRecord() #

Patch Set 5 : Rebased patch using NativeValueTraits for IDL types #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+1543 lines, -36 lines) Patch
A third_party/WebKit/LayoutTests/bindings/record-type.html View 1 2 3 4 1 chunk +134 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/bindings.gni View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/BUILD.gn View 1 2 3 4 2 chunks +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/Dictionary.cpp View 1 2 3 4 1 chunk +0 lines, -10 lines 0 comments Download
A third_party/WebKit/Source/bindings/core/v8/IDLTypes.h View 1 2 3 4 1 chunk +392 lines, -0 lines 3 comments Download
M third_party/WebKit/Source/bindings/core/v8/NativeValueTraits.h View 1 2 3 4 1 chunk +0 lines, -4 lines 1 comment Download
M third_party/WebKit/Source/bindings/core/v8/ToV8.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/V8Binding.h View 1 2 3 4 2 chunks +121 lines, -2 lines 2 comments Download
M third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp View 1 2 3 4 1 chunk +24 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/V8StringResource.h View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/scripts/v8_callback_function.py View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/scripts/v8_interface.py View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/scripts/v8_types.py View 1 2 3 4 10 chunks +63 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/scripts/v8_union.py View 1 2 3 4 5 chunks +14 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/templates/callback_function.cpp.tmpl View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/templates/callback_function.h.tmpl View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/templates/dictionary_v8.h.tmpl View 1 2 3 4 1 chunk +2 lines, -1 line 3 comments Download
M third_party/WebKit/Source/bindings/templates/union_container.cpp.tmpl View 9 chunks +19 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/bindings/templates/union_container.h.tmpl View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/idls/core/TestDictionary.idl View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/idls/core/TestTypedefs.idl View 2 chunks +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/AnyCallbackFunctionOptionalAnyArg.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/AnyCallbackFunctionOptionalAnyArg.cpp View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/ArrayBufferOrArrayBufferViewOrDictionary.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/BooleanOrStringOrUnrestrictedDouble.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/bindings/tests/results/core/ByteStringSequenceSequenceOrByteStringByteStringRecord.h View 1 2 3 4 1 chunk +96 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/bindings/tests/results/core/ByteStringSequenceSequenceOrByteStringByteStringRecord.cpp View 1 2 3 4 1 chunk +107 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/DoubleOrString.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/LongCallbackFunction.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/LongCallbackFunction.cpp View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/LongOrTestDictionary.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/NodeOrNodeList.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/StringOrArrayBufferOrArrayBufferView.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/StringOrDouble.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/StringOrStringSequence.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/StringSequenceCallbackFunctionLongSequenceArg.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/StringSequenceCallbackFunctionLongSequenceArg.cpp View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.h View 3 chunks +12 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.cpp View 1 2 3 4 3 chunks +23 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/TestEnumOrDouble.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/TestInterface2OrUint8Array.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceGarbageCollectedOrString.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceOrLong.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceOrTestInterfaceEmpty.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp View 1 2 3 4 5 chunks +39 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionaryDerived.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInit.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestPermissiveDictionary.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.h View 2 chunks +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp View 1 2 3 4 5 chunks +83 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunction.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunction.cpp View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunctionInterfaceArg.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunctionInterfaceArg.cpp View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunctionTypedef.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunctionTypedef.cpp View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/modules/BooleanOrString.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/modules/VoidCallbackFunctionModules.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/modules/VoidCallbackFunctionModules.cpp View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/BUILD.gn View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/core_idl_files.gni View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/testing/Internals.h View 1 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/testing/Internals.cpp View 1 2 3 4 2 chunks +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/testing/Internals.idl View 1 1 chunk +1 line, -0 lines 0 comments Download
A third_party/WebKit/Source/core/testing/RecordTest.h View 1 2 3 4 1 chunk +70 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/testing/RecordTest.cpp View 1 2 3 4 1 chunk +70 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/testing/RecordTest.idl View 1 2 3 4 1 chunk +26 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.cpp View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 21 (1 generated)
Raphael Kubo da Costa (rakuco)
PTAL at this WIP patch. It's not finished, but I'd like to discuss the architecture ...
3 years, 10 months ago (2017-02-22 18:08:38 UTC) #2
haraken
(I'll defer this review to yukishiino@ or bashi@.) Partial answers inline: On 2017/02/22 18:08:38, Raphael ...
3 years, 10 months ago (2017-02-22 23:37:53 UTC) #3
bashi
Thanks for the CL! On 2017/02/22 23:37:53, haraken wrote: > (I'll defer this review to ...
3 years, 10 months ago (2017-02-23 00:43:00 UTC) #4
Raphael Kubo da Costa (rakuco)
On 2017/02/23 00:43:00, bashi wrote: > > > As for the architecture: the patch looks ...
3 years, 10 months ago (2017-02-23 08:13:53 UTC) #5
Raphael Kubo da Costa (rakuco)
I've uploaded a new version of the patch with a layout test for the new ...
3 years, 10 months ago (2017-02-23 18:06:10 UTC) #6
bashi
On 2017/02/23 18:06:10, Raphael Kubo da Costa (rakuco) wrote: > I've uploaded a new version ...
3 years, 10 months ago (2017-02-24 00:17:30 UTC) #7
Raphael Kubo da Costa (rakuco)
On 2017/02/24 00:17:30, bashi wrote: > Have you tried using NativeValueTraits<T>::nativeValue()? UUIC you need to ...
3 years, 10 months ago (2017-02-24 08:05:52 UTC) #8
bashi
On 2017/02/24 08:05:52, Raphael Kubo da Costa (rakuco) wrote: > On 2017/02/24 00:17:30, bashi wrote: ...
3 years, 10 months ago (2017-02-24 08:38:14 UTC) #9
Raphael Kubo da Costa (rakuco)
I've uploaded a new patch set that implements a mostly static toImplRecord(). The required template ...
3 years, 9 months ago (2017-02-24 17:12:16 UTC) #10
bashi
On 2017/02/24 17:12:16, Raphael Kubo da Costa (rakuco) wrote: > I've uploaded a new patch ...
3 years, 9 months ago (2017-02-27 09:13:15 UTC) #11
Raphael Kubo da Costa (rakuco)
On 2017/02/27 09:13:15, bashi wrote: > Thank you for being patient and keep updating the ...
3 years, 9 months ago (2017-02-27 09:26:33 UTC) #12
Raphael Kubo da Costa (rakuco)
On 2017/02/27 09:26:33, Raphael Kubo da Costa (rakuco) wrote: > I agree, I think the ...
3 years, 9 months ago (2017-02-27 18:33:37 UTC) #13
bashi
On 2017/02/27 18:33:37, Raphael Kubo da Costa (rakuco) wrote: > On 2017/02/27 09:26:33, Raphael Kubo ...
3 years, 9 months ago (2017-02-27 23:20:13 UTC) #14
Raphael Kubo da Costa (rakuco)
I've uploaded a new version of the patch incorporating the comments Yuki made in https://codereview.chromium.org/2725673002/. ...
3 years, 9 months ago (2017-03-01 18:52:52 UTC) #15
bashi
On 2017/03/01 18:52:52, Raphael Kubo da Costa (rakuco) wrote: > I've uploaded a new version ...
3 years, 9 months ago (2017-03-01 23:59:55 UTC) #16
bashi
If yukishiino@ is happy with this approach, could you split this CL into small ones? ...
3 years, 9 months ago (2017-03-02 00:04:38 UTC) #17
Yuki
Overall, looks great. https://codereview.chromium.org/2709983004/diff/80001/third_party/WebKit/Source/bindings/core/v8/IDLTypes.h File third_party/WebKit/Source/bindings/core/v8/IDLTypes.h (right): https://codereview.chromium.org/2709983004/diff/80001/third_party/WebKit/Source/bindings/core/v8/IDLTypes.h#newcode19 third_party/WebKit/Source/bindings/core/v8/IDLTypes.h:19: namespace idl { Do we have ...
3 years, 9 months ago (2017-03-02 07:47:28 UTC) #18
Raphael Kubo da Costa (rakuco)
https://codereview.chromium.org/2709983004/diff/80001/third_party/WebKit/Source/bindings/core/v8/IDLTypes.h File third_party/WebKit/Source/bindings/core/v8/IDLTypes.h (right): https://codereview.chromium.org/2709983004/diff/80001/third_party/WebKit/Source/bindings/core/v8/IDLTypes.h#newcode19 third_party/WebKit/Source/bindings/core/v8/IDLTypes.h:19: namespace idl { On 2017/03/02 07:47:28, Yuki(slow_til_mar08) wrote: > ...
3 years, 9 months ago (2017-03-02 08:16:24 UTC) #19
Yuki
https://codereview.chromium.org/2709983004/diff/80001/third_party/WebKit/Source/bindings/core/v8/IDLTypes.h File third_party/WebKit/Source/bindings/core/v8/IDLTypes.h (right): https://codereview.chromium.org/2709983004/diff/80001/third_party/WebKit/Source/bindings/core/v8/IDLTypes.h#newcode19 third_party/WebKit/Source/bindings/core/v8/IDLTypes.h:19: namespace idl { On 2017/03/02 08:16:24, Raphael Kubo da ...
3 years, 9 months ago (2017-03-02 13:00:25 UTC) #20
Raphael Kubo da Costa (rakuco)
3 years, 9 months ago (2017-03-09 15:34:06 UTC) #21
Closing this one; the bits and pieces are being landed separately, the last of
which is https://codereview.chromium.org/2732093003/

Powered by Google App Engine
This is Rietveld 408576698