[SameObject] FrozenArray<T> are passed by value, not reference |
|||
Issue descriptionThe WebIDL spec (https://heycam.github.io/webidl/#idl-frozen-array) says: "Since FrozenArray<T> values are references, they are unlike sequence types, which are lists of values that are passed by value." They are references, so it should be possible to return them by reference, not value. But when attempting to do so they seem to implicitly be copied. Example .idl: [SameObject] readonly attribute FrozenArray<MediaStream> streams; Implemented as: const HeapVector<Member<MediaStream>>& streams() const { return streams_; } Fails this testharness line: assert_equals(trackEvent.streams, trackEvent.streams, '[SameObject]');
,
Jan 18
(4 days ago)
Hey foolip do you know if [SameObject] FrozenArray is supposed to work or not?
,
Jan 18
(4 days ago)
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1a345304d40380b5fcafe47f4ea5986158e3d046 commit 1a345304d40380b5fcafe47f4ea5986158e3d046 Author: Henrik Boström <hbos@chromium.org> Date: Fri Jan 18 16:27:16 2019 Clarify RTCTrackEvent-constructor.html failure reason. This code attempts to update the RTCTrackEvent to pass streams by reference rather than value, but our bindings seems to copy them anyway. Bug: 923349 Change-Id: Iacad1514af3b5a121a927c29bb1ada4ef8e21593 Reviewed-on: https://chromium-review.googlesource.com/c/1421898 Reviewed-by: Guido Urdaneta <guidou@chromium.org> Commit-Queue: Henrik Boström <hbos@chromium.org> Cr-Commit-Position: refs/heads/master@{#624153} [modify] https://crrev.com/1a345304d40380b5fcafe47f4ea5986158e3d046/third_party/blink/renderer/modules/peerconnection/rtc_track_event.cc [modify] https://crrev.com/1a345304d40380b5fcafe47f4ea5986158e3d046/third_party/blink/renderer/modules/peerconnection/rtc_track_event.h [modify] https://crrev.com/1a345304d40380b5fcafe47f4ea5986158e3d046/third_party/blink/web_tests/external/wpt/webrtc/RTCTrackEvent-constructor-expected.txt [modify] https://crrev.com/1a345304d40380b5fcafe47f4ea5986158e3d046/third_party/blink/web_tests/external/wpt/webrtc/RTCTrackEvent-constructor.html
,
Today
(4 hours ago)
|
|||
►
Sign in to add a comment |
|||
Comment 1 by hbos@chromium.org
, Jan 18 (4 days ago)