-
Notifications
You must be signed in to change notification settings - Fork 351
Make response body streams readable byte streams #1246
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
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5337,16 +5337,15 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps: | |||||
|
||||||
<li><p>Let <var>highWaterMark</var> be a non-negative, non-NaN number, chosen by the user agent. | ||||||
|
||||||
<li><p>Let <var>sizeAlgorithm</var> be an algorithm that accepts a <a>chunk</a> object and returns | ||||||
a non-negative, non-NaN, non-infinite number, chosen by the user agent. | ||||||
|
||||||
<li><p>Let <var>stream</var> be a <a>new</a> {{ReadableStream}}. | ||||||
|
||||||
<li><p><a for=ReadableStream>Set up</a> <var>stream</var> with | ||||||
<a for="ReadableStream/set up"><var>pullAlgorithm</var></a> set to <var>pullAlgorithm</var>, | ||||||
<a for="ReadableStream/set up"><var>cancelAlgorithm</var></a> set to <var>cancelAlgorithm</var>, | ||||||
<a for="ReadableStream/set up"><var>highWaterMark</var></a> set to <var>highWaterMark</var>, and | ||||||
<a for="ReadableStream/set up"><var>sizeAlgorithm</var></a> set to <var>sizeAlgorithm</var>. | ||||||
<li><p><a for=ReadableStream>Set up with byte reading support</a> <var>stream</var> with | ||||||
<a for="ReadableStream/set up with byte reading support"><var>pullAlgorithm</var></a> set to | ||||||
<var>pullAlgorithm</var>, | ||||||
<a for="ReadableStream/set up with byte reading support"><var>cancelAlgorithm</var></a> set to | ||||||
<var>cancelAlgorithm</var>, and | ||||||
<a for="ReadableStream/set up with byte reading support"><var>highWaterMark</var></a> set to | ||||||
<var>highWaterMark</var>. | ||||||
|
||||||
<li> | ||||||
<p>Run these steps, but <a>abort when</a> the ongoing fetch is <a for=fetch>terminated</a>: | ||||||
|
@@ -5398,6 +5397,10 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps: | |||||
<p>While true: | ||||||
|
||||||
<ol> | ||||||
<li><p>If <var>stream</var>'s <a for=ReadableStream>current BYOB request view</a> is | ||||||
non-null, then user agents should use its <a for=BufferSource>byte length</a> to inform the | ||||||
transmission process about how many bytes are being requested for this stream. | ||||||
|
||||||
<li> | ||||||
<p>If one or more bytes have been transmitted from <var>response</var>'s message body, then: | ||||||
|
||||||
|
@@ -5423,8 +5426,19 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps: | |||||
<li><p>If <var>bytes</var> is failure, then <a lt=terminated for=fetch>terminate</a> the | ||||||
ongoing fetch. | ||||||
|
||||||
<li><p><a for=ReadableStream>Enqueue</a> a {{Uint8Array}} wrapping an {{ArrayBuffer}} | ||||||
containing <var>bytes</var> into <var>stream</var>. | ||||||
<li><p>Let <var>view</var> be null. | ||||||
|
||||||
<li><p>If <var>stream</var>'s <a for=ReadableStream>current BYOB request view</a> is | ||||||
non-null, and <var>bytes</var>'s <a for="byte sequence">length</a> is less than | ||||||
<var>stream</var>'s <a for=ReadableStream>current BYOB request view</a>'s | ||||||
<a for=BufferSource>byte length</a>, then set <var>view</var> to <var>stream</var>'s | ||||||
<a for=ReadableStream>current BYOB request view</a>, and <a for=ArrayBufferView>write</a> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
<var>bytes</var> into <var>view</var>. | ||||||
|
||||||
<li><p>Otherwise, set <var>view</var> to the result of <a for=ArrayBufferView>creating</a> | ||||||
a {{Uint8Array}} from <var>bytes</var>. | ||||||
|
||||||
<li><p><a for=ReadableStream>Enqueue</a> <var>view</var> into <var>stream</var>. | ||||||
|
||||||
<li><p>If <var>stream</var> is <a for=ReadableStream>errored</a>, then | ||||||
<a lt=terminated for=fetch>terminate</a> the ongoing fetch. | ||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.