Fetch: Support BYOB reading for Response.body #40281
Closed
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.
ReadableByteStream is a variant of ReadableStream specialized for
bytes[1]. Given the performance benefits, this CL adds BYOB support
for Fetch by making Response.body a byte stream to allow for reading
with a bring-your-own-buffer(BYOB) reader.
The corresponding spec PR for this was landed at whatwg/fetch#1593.
Tests for reading from Blob with a BYOB reader were factored out, as
support for that will be implemented in follow-up CLs.
[1] https://streams.spec.whatwg.org/#readable-byte-stream
Low-Coverage-Reason: Behavior changes are covered by WPTs (i.e. response-consume-stream.any.js).
Bug: 1243329
Change-Id: I381b9f2272a7f1202fa748ae5c039ca0a998de00
Reviewed-on: https://chromium-review.googlesource.com/4573009
WPT-Export-Revision: 94b522f8145c49394398cf9d3d6aeb8d901328dc