Skip to content

Commit

Permalink
Merge pull request #1094 from w3c/closed-check-in-queued-tasks
Browse files Browse the repository at this point in the history
Check RTCPeerConnection isClosed slot before running queued tasks
  • Loading branch information
alvestrand committed Mar 23, 2017
2 parents 654f482 + f894152 commit af078a4
Showing 1 changed file with 47 additions and 13 deletions.
60 changes: 47 additions & 13 deletions webrtc.html
Original file line number Diff line number Diff line change
Expand Up @@ -1281,10 +1281,22 @@ <h4>Operation</h4>
<code>stable</code>, <a>update the negotiation-needed
flag</a>. If <var>connection</var>'s
[[<a>needNegotiation</a>]] slot was <code>true</code> both
before and after this update, queue a task to check
<var>connection</var>'s [[<a>needNegotiation</a>]] slot and,
if still <code>true</code>, fire a simple event named
<a>negotiationneeded</a> at <var>connection</var>.</p>
before and after this update, queue a task that runs the
following steps:</p>
<ol>
<li>
<p>If <var>connection</var>'s [[<a>isClosed</a>]] slot
is <code>true</code>, abort these steps.</p>
</li>
<li>
<p>If <var>connection</var>'s [[<a>needNegotiation</a>]]
slot is <code>false</code>, abort these steps.</p>
</li>
<li>
<p>Fire a simple event named <a>negotiationneeded</a>
at <var>connection</var>.</p>
</li>
</ol>
</li>
<li>
<p>Resolve <var>p</var> with <var>undefined</var>.</p>
Expand Down Expand Up @@ -3652,11 +3664,21 @@ <h4>Updating the Negotiation-Needed flag</h4>
<code>true</code>.</p>
</li>
<li>
<p>Queue a task to check <var>connection</var>'s
[[<a>needNegotiation</a>]] slot and, if still <code>true</code>,
fire a simple event named <a>negotiationneeded</a> at
<var>connection</var>.</p>

<p>Queue a task that runs the following steps:</p>
<ol>
<li>
<p>If <var>connection</var>'s [[<a>isClosed</a>]] slot
is <code>true</code>, abort these steps.</p>
</li>
<li>
<p>If <var>connection</var>'s [[<a>needNegotiation</a>]]
slot is <code>false</code>, abort these steps.</p>
</li>
<li>
<p>Fire a simple event named <a>negotiationneeded</a>
at <var>connection</var>.</p>
</li>
</ol>
<p class="note">This queueing prevents <a>negotiationneeded</a> from
firing prematurely, in the common situation where multiple
modifications to <var>connection</var> are being made at once.</p>
Expand Down Expand Up @@ -5675,10 +5697,22 @@ <h2>Methods</h2>
track, without negotiating.</p>
</li>
<li>
<p>Queue a task that sets <var>sender</var>'s
<code><a data-for="RTCRtpSender">track</a></code>
attribute to <var>withTrack</var>, and resolves
<var>p</var> with <code>undefined</code>.</p>
<p>Queue a task that runs the following steps:</p>
<ol>
<li>
<p>If <var>connection</var>'s [[<a>isClosed</a>]]
slot is <code>true</code>, abort these steps.</p>
</li>
<li>
<p>Set <var>sender</var>'s <code><a data-for=
"RTCRtpSender">track</a></code> attribute to
<var>withTrack</var>.</p>
</li>
<li>
<p>Resolve <var>p</var> with
<code>undefined</code>.</p>
</li>
</ol>
</li>
</ol>
</li>
Expand Down

0 comments on commit af078a4

Please sign in to comment.