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

Make RTCDataChannels Transferable #317

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion webrtc.html
Original file line number Diff line number Diff line change
Expand Up @@ -4420,7 +4420,7 @@ <h3>RTCDataChannelEvent</h3>
<section>
<h3>Garbage Collection</h3>

<p>A <code><a>RTCDataChannel</a></code> object MUST not be garbage
<p>An <code><a>RTCDataChannel</a></code> object MUST not be garbage
collected if its</p>

<ul>
Expand Down Expand Up @@ -4450,6 +4450,19 @@ <h3>Garbage Collection</h3>
</li>
</ul>
</section>

<section>
<h3>RTCDataChannel and Workers</h3>
<p>An <code><a>RTCDataChannel</a></code> object MUST be
<code><a href="https://html.spec.whatwg.org/multipage/infrastructure.html#transferable-objects">
Transferable</a></code> to <code>Workers</code> [[!WEBWORKERS]]. When it's
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this require changes to WebIDL? (at least modifying the [Exposed] tag)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Exposed] doesn't need to change here. We can expose RTCDataChannel in workers with no effort.

If the intent is to limit this to a worker (of what sort?!?), then we either have a mistake on the part of @jesup or maybe a misunderstanding about what transferable means.

My understanding is that a transferable object can be passed through postMessage to other origins as well as workers. We should simply identify that RTCDataChannel as [Transferable] and note the consequences of that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The specification is confusing on this point:
http://www.w3.org/TR/html51/infrastructure.html#transferable-objects
"Some objects support being copied and closed in one operation. This is called transferring the object, and is used in particular to transfer ownership of unsharable or expensive resources across worker boundaries."

@annevk can you weigh in here?

transfered, any future events will occur on the transfered object in
the Worker. Note that this means that the Worker should install any
EventHandlers immediately on reception of the DataChannel to avoid
missing any events.
</p>
</section>

</section>

<section>
Expand Down