Auto-generated WebIDL bindings are unable to express certain overloaded functions |
||||||||||
Issue descriptionRTCPeerConnection.idl has: // Legacy API [CallWith=ScriptState, LegacyInterfaceTypeChecking] Promise<void> getStats(RTCStatsCallback successCallback, optional MediaStreamTrack? selector); But when overloading this to also support: // Spec-compliant API // https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-getstats [CallWith=ScriptState] Promise<RTCStatsReport> getStats(optional MediaStreamTrack? selector = null); We end up with TypeErrors upon supplying valid arguments, the wrong version being called or compile errors for generated functions that are unused. I've tried various different combinations, and ended up having to implement custom bindings code for this in RTCPeerConnection.cpp: https://chromium-review.googlesource.com/c/chromium/src/+/978128
,
Apr 4 2018
This use case is WebRTC but the bug is in V8 bindings. What component to use when there is a bug in the V8Foo.[h/cpp] files auto-generated from Foo.idl files?
,
Apr 4 2018
(This could hit anybody overloading functions in .idl, not specific to WebRTC)
,
Apr 4 2018
I put this as low priority because it is a rare type of overload and I found a workaround, but the bug should be triaged by V8 magicians.
,
Apr 4 2018
Then use javascript component, as it's related to V8 code and not it's build infrastructure.
,
Apr 4 2018
,
Apr 4 2018
,
Apr 12 2018
Yang, any pointers?
,
Apr 12 2018
Kentaro, I think this belongs into your domain?
,
Apr 12 2018
Yes, this is a Bindings' issue. IDL definition looks valid, so let me check how the behavior got wrong.
,
May 3 2018
,
May 7 2018
I doubt that we should treat many issues Blockedon: the bindings generator's refactoring plan. Can we use a hotlist or something else?
,
May 14 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/df79808dd2a54aae8307371933e7d04b05777cfa commit df79808dd2a54aae8307371933e7d04b05777cfa Author: Hitoshi Yoshida <peria@chromium.org> Date: Mon May 14 15:15:35 2018 bindings: Update overload resolution algorithm in bindings Before this CL, overload resolution algorithm was based on old version, and had some Blink specific customizes. This CL updates it to be almost compatible with current spec, except for types that Blink does not support. Bug: 828401 Change-Id: Ia2ee07a08f45390f39258268608fd71fdd06da89 Reviewed-on: https://chromium-review.googlesource.com/1013798 Commit-Queue: Hitoshi Yoshida <peria@chromium.org> Reviewed-by: Yuki Shiino <yukishiino@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Cr-Commit-Position: refs/heads/master@{#558311} [modify] https://crrev.com/df79808dd2a54aae8307371933e7d04b05777cfa/third_party/blink/renderer/bindings/scripts/v8_interface.py [modify] https://crrev.com/df79808dd2a54aae8307371933e7d04b05777cfa/third_party/blink/renderer/bindings/templates/interface.cpp.tmpl [modify] https://crrev.com/df79808dd2a54aae8307371933e7d04b05777cfa/third_party/blink/renderer/bindings/templates/methods.cpp.tmpl [modify] https://crrev.com/df79808dd2a54aae8307371933e7d04b05777cfa/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface.cc [modify] https://crrev.com/df79808dd2a54aae8307371933e7d04b05777cfa/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_constructor_2.cc [modify] https://crrev.com/df79808dd2a54aae8307371933e7d04b05777cfa/third_party/blink/renderer/bindings/tests/results/core/v8_test_interface_origin_trial_enabled.cc [modify] https://crrev.com/df79808dd2a54aae8307371933e7d04b05777cfa/third_party/blink/renderer/bindings/tests/results/core/v8_test_object.cc [modify] https://crrev.com/df79808dd2a54aae8307371933e7d04b05777cfa/third_party/blink/renderer/bindings/tests/results/modules/v8_test_interface_partial.cc
,
May 15 2018
,
May 15 2018
Cool, thanks. Next time there's getStats() work or refactoring to be done I'll try this out.
,
May 25 2018
|
||||||||||
►
Sign in to add a comment |
||||||||||
Comment 1 by machenb...@chromium.org
, Apr 4 2018