[webrtc-extensions] Need to specify behavior of detached RTCDataChannel objects. (#115)

jan-ivar has just created a new issue for https://github.com/w3c/webrtc-extensions:

== Need to specify behavior of detached RTCDataChannel objects. ==
After a transfer there are two platform objects: 1) the new one in the worker, and 2) the abandoned (_"detached"_) original. JS may attempt to use the original for as long as it has a reference to it.

_"Transferable objects have a [[[Detached]]](https://html.spec.whatwg.org/multipage/structured-data.html#detached) internal slot"_, which is set to `true` once transferred.

It seems up to individual specs to ensure these originals play dead with prose on _every single method_ [e.g. from VideoFrame](https://w3c.github.io/webcodecs/#dom-audioencoder-encode):
* _"1. If the value of data’s [[[Detached]]](https://html.spec.whatwg.org/multipage/structured-data.html#detached) internal slot is true, throw a [TypeError](https://webidl.spec.whatwg.org/#exceptiondef-typeerror)."_

I don't see anything like this for RTCDataChannel which means that, as currently specified, e.g. [send](https://w3c.github.io/webrtc-pc/#dom-rtcdatachannel-send) still works on these originals. We need to prevent this.

This spec also makes no mention of [[Detached]] which seems wrong given e.g. [VideoFrame's transfer steps](https://w3c.github.io/webcodecs/#audiodata-transfer-serialization):
* _"1. If value’s [[[Detached]]](https://html.spec.whatwg.org/multipage/structured-data.html#detached) is true, throw a [DataCloneError](https://webidl.spec.whatwg.org/#datacloneerror) [DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)."_


Please view or discuss this issue at https://github.com/w3c/webrtc-extensions/issues/115 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 26 September 2022 21:36:03 UTC