New issue
Advanced search Search tips

Issue 923349 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

[SameObject] FrozenArray<T> are passed by value, not reference

Project Member Reported by hbos@chromium.org, Jan 18 (4 days ago)

Issue description

The 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]');


 

Comment 2 by hbos@chromium.org, Jan 18 (4 days ago)

Cc: foolip@chromium.org
Hey foolip do you know if [SameObject] FrozenArray is supposed to work or not?
Project Member

Comment 3 by bugdroid1@chromium.org, 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

Comment 4 by peria@chromium.org, Today (4 hours ago)

Labels: Hotlist-Bindings-IDLCompiler
Owner: peria@chromium.org
Status: Assigned (was: Untriaged)

Sign in to add a comment