w3c / webrtc-encoded-transform

WebRTC Encoded Transform
https://w3c.github.io/webrtc-encoded-transform/
Other
123 stars 27 forks source link

WHATWG Streams have no `[[owner]]` but the spec sets it #217

Closed saschanaz closed 10 months ago

saschanaz commented 10 months ago

Step 5 and 8 of https://www.w3.org/TR/webrtc-encoded-transform/#stream-creation sets [[owner]]:

  1. Initialize this.[[readable]] to a new ReadableStream.

  2. Set this.[[readable]].[[owner]] to this.

  3. Initialize this.[[writable]] to a new WritableStream.

  4. Set this.[[writable]].[[owner]] to this.

But there's no [[owner]] in https://streams.spec.whatwg.org/. What was the purpose of this?

dontcallmedom commented 10 months ago

a bit of archeology: the Streams spec used to have [[ownerReadableStream]] and [[ownerWritableStream]] internal slots, which were removed in https://github.com/whatwg/streams/pull/1060 but probably were still in the mind of the editors when this notation was introduced in the spec 3 years ago

youennf commented 10 months ago

[[owner]] is used to enforce the constraint that the writable is given frames that were vended by the corresponding readable.

youennf commented 10 months ago

We could probably change this if needed be on using the streams sources instead.

saschanaz commented 10 months ago

[[owner]] is used to enforce the constraint that the writable is given frames that were vended by the corresponding readable.

Per my understanding, this spec only compares frame.[[owner]] in https://www.w3.org/TR/webrtc-encoded-transform/#abstract-opdef-writeencodeddata but not really the stream's [[owner]]. The latter is unused right now, so perhaps we can just remove it?

alvestrand commented 10 months ago

Note that this restriction has been questioned in https://github.com/w3c/webrtc-encoded-transform/issues/200 and removal has been proposed in https://github.com/w3c/webrtc-encoded-transform/pull/201.

saschanaz commented 10 months ago

Thanks, but I don't think the restriction uses stream's [[owner]] at all per https://github.com/w3c/webrtc-encoded-transform/issues/217#issuecomment-1843739440. (And thus this shouldn't be blocked by #201.)

youennf commented 10 months ago

Yes, you are right, this does not seem to be used anymore given read/write encoded data are taking the rtcObject as parameter. We should remove it.