Skip to content

Commit

Permalink
Merge pull request #2902 from jan-ivar/datachannels
Browse files Browse the repository at this point in the history
Prevent GC of non-closed RTCDataChannels
  • Loading branch information
alvestrand authored Nov 2, 2023
2 parents 682049e + 0c99003 commit 813e08c
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
9 changes: 9 additions & 0 deletions amendments.json
Original file line number Diff line number Diff line change
Expand Up @@ -520,5 +520,14 @@
"status": "candidate",
"id": 36
}
],
"closing-procedure": [
{
"description": "Prevent GC of non-closed RTCDataChannels",
"pr": 2902,
"type": "correction",
"status": "candidate",
"id": 38
}
]
}
38 changes: 37 additions & 1 deletion webrtc.html
Original file line number Diff line number Diff line change
Expand Up @@ -1312,6 +1312,13 @@ <h4>
</p>
</li>
<li>
<p>
Let <var>connection</var> have a
<dfn data-dfn-for="RTCPeerConnection">[[\DataChannels]]</dfn> internal slot, initialized to
an empty [=ordered set=].
</p>
</li>
<li>
<p>
Let <var>connection</var> have an <dfn data-dfn-for="RTCPeerConnection">[[\Operations]]</dfn>
internal slot, representing an [= operations chain =],
Expand Down Expand Up @@ -13326,6 +13333,12 @@ <h2>
negotiation-needed flag =] for <var>connection</var>.
</p>
</li>
<li>
<p>
[=list/Append=] <var>channel</var> to
<var>connection</var>.{{RTCPeerConnection/[[DataChannels]]}}.
</p>
</li>
<li>
<p>
Return <var>channel</var> and continue the following
Expand Down Expand Up @@ -13894,6 +13907,12 @@ <h4>
<code>false</code>.
</p>
</li>
<li>
<p>
[=list/Append=] <var>channel</var> to
<var>connection</var>.{{RTCPeerConnection/[[DataChannels]]}}.
</p>
</li>
<li data-tests="RTCPeerConnection-ondatachannel.html">
<p>
Set <var>channel</var>.{{RTCDataChannel/[[ReadyState]]}} to
Expand Down Expand Up @@ -13922,7 +13941,7 @@ <h4>
</li>
</ol>
</section>
<section>
<section id="closing-procedure">
<h4>
Closing procedure
</h4>
Expand All @@ -13940,6 +13959,17 @@ <h4>
[= underlying data transport =] was closed.
</p>
</li>
<li class="no-test-needed">
<p>
Let <var>connection</var> be the {{RTCPeerConnection}} object
associated with <var>channel</var>.
</p>
</li>
<li>
<p>
[=list/Remove=] <var>channel</var> from <var>connection</var>.{{RTCPeerConnection/[[DataChannels]]}}.
</p>
</li>
<li>
<p>
Unless the procedure was initiated by
Expand Down Expand Up @@ -14011,6 +14041,12 @@ <h4>
{{RTCDataChannelState/"closed"}}.
</p>
</li>
<li>
<p>
[=list/Remove=] <var>channel</var> from <var>connection</var>.{{RTCPeerConnection/[[DataChannels]]}}
if it is still there.
</p>
</li>
<li>
<p>
If the [= underlying data transport | transport =] was closed
Expand Down

0 comments on commit 813e08c

Please sign in to comment.