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

Buffered amount slot #1794

Merged
merged 3 commits into from
Mar 15, 2018
Merged
Changes from 2 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
42 changes: 25 additions & 17 deletions webrtc.html
Original file line number Diff line number Diff line change
Expand Up @@ -8288,6 +8288,10 @@ <h2>Methods</h2>
<p>Let <var>channel</var> have a <dfn>[[\ReadyState]]</dfn> internal slot
initialized to <code>"connecting"</code>.</p>
</li>
<li>
<p>Let <var>channel</var> have a <dfn>[[\BufferedAmount]]</dfn>
internal slot initialized to <code>0</code>.</p>
</li>
<li>
<p>Let <var>channel</var> have a <dfn>[[\MaxRetransmits]]</dfn> internal slot
initialized to <var>option</var>'s <code>maxRetransmits</code>
Expand Down Expand Up @@ -8892,7 +8896,9 @@ <h2>Attributes</h2>
<dd>
<p>The <dfn id=
"dom-datachannel-bufferedamount"><code>bufferedAmount</code></dfn>
attribute MUST return the number of bytes of application data
attribute MUST, on getting, return the value of the
<a>[[\BufferedAmount]]</a> slot. The attribute exposes the number
of bytes of application data
(UTF-8 text and binary data) that have been queued using
<code><a data-link-for="RTCDataChannel">send()</a></code> but that, as
of the last time the event loop started executing a task, had not
Expand All @@ -8901,11 +8907,16 @@ <h2>Attributes</h2>
whether the user agent is able to transmit text asynchronously
with script execution.) This does not include framing overhead
incurred by the protocol, or buffering done by the operating
system or network hardware. This attribute's value will only
system or network hardware. The value of the
<a>[[\BufferedAmount]]</a> slot will only
increase with each call to the <code><a data-link-for=
"RTCDataChannel">send()</a></code> method as long as the <a>
[[\ReadyState]]</a> slot is <code>open</code>. However, the
attribute does not reset to zero once the channel closes.</p>
[[\ReadyState]]</a> slot is <code>open</code>; however, the
slot does not reset to zero once the channel closes. When the
<a>underlying data transport</a> sends data from its queue, the
user agent MUST queue a task that reduces
<a>[[\BufferedAmount]]</a> with the number of bytes that was
sent.</p>
Copy link
Member Author

Choose a reason for hiding this comment

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

With this text I guess we leave it up to implementations to decide how often to update the slot.

</dd>
<dt><code>bufferedAmountLowThreshold</code> of type <span class=
"idlAttrType"><a>unsigned long</a></span></dt>
Expand Down Expand Up @@ -9119,33 +9130,30 @@ <h2>Dictionary <dfn>RTCDataChannelInit</dfn> Members</h2>
<li>
<p><code>string</code> object:</p>
<p>Let <var>data</var> be a byte buffer that represents the
result of encoding the method's argument as UTF-8 and increase the
<code><a data-link-for="RTCDataChannel">bufferedAmount</a></code>
attribute with the length of <var>data</var>.</p>
result of encoding the methods argument as UTF-8 and increase the
value of the <a>[[\BufferedAmount]]</a> slot with the length of
<var>data</var>.</p>
</li>
<li>
<p><code>Blob</code> object:</p>
<p>Let <var>data</var> be the raw data represented by the
<code>Blob</code> object and increase the <code><a data-link-for=
"RTCDataChannel">bufferedAmount</a></code> attribute by the size
of data, in bytes.</p>
<code>Blob</code> object and increase the value of the
<a>[[\BufferedAmount]]</a> slot with the size of data, in bytes.</p>
</li>
<li>
<p><code>ArrayBuffer</code> object:</p>
<p>Let <var>data</var> be the data stored in the buffer described
by the <code>ArrayBuffer</code> object and increase the
<code><a data-link-for="RTCDataChannel">bufferedAmount</a></code>
attribute by the length of the <code>ArrayBuffer</code> in
bytes.</p>
by the <code>ArrayBuffer</code> object and increase the value of
the <a>[[\BufferedAmount]]</a> slot with the the length of the
<code>ArrayBuffer</code> in bytes.</p>
</li>
<li>
<p><code>ArrayBufferView</code> object:</p>
<p>Let <var>data</var> be the data stored in the section of the
buffer described by the <code>ArrayBuffer</code> object that the
<code>ArrayBufferView</code> object references and increase the
<code><a data-link-for="RTCDataChannel">bufferedAmount</a></code>
attribute by the length of the <code>ArrayBufferView</code> in
bytes.</p>
value of the <a>[[\BufferedAmount]]</a> slot with the the length
of the <code>ArrayBufferView</code> in bytes.</p>
</li>
</ul>
</li>
Expand Down