Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
saschanaz opened this issue Dec 6, 2023 · 7 comments · Fixed by #219
Closed

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

saschanaz opened this issue Dec 6, 2023 · 7 comments · Fixed by #219

Comments

@saschanaz
Copy link
Member

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.
  1. Initialize this.[[writable]] to a new WritableStream.
  1. Set this.[[writable]].[[owner]] to this.

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

@dontcallmedom
Copy link
Member

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

@youennf
Copy link
Collaborator

youennf commented Dec 6, 2023

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

@youennf
Copy link
Collaborator

youennf commented Dec 6, 2023

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

@saschanaz
Copy link
Member Author

[[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
Copy link
Contributor

alvestrand commented Dec 7, 2023

Note that this restriction has been questioned in #200 and removal has been proposed in #201.

@saschanaz
Copy link
Member Author

saschanaz commented Dec 7, 2023

Thanks, but I don't think the restriction uses stream's [[owner]] at all per #217 (comment). (And thus this shouldn't be blocked by #201.)

@youennf
Copy link
Collaborator

youennf commented Dec 7, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants