mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb: Implement read a chunk concept for ReadableStreamDefaultReader
This commit is contained in:
parent
50f454fdd5
commit
34ecc59508
Notes:
sideshowbarker
2024-07-16 20:31:50 +09:00
Author: https://github.com/kennethmyhra
Commit: 34ecc59508
Pull-request: https://github.com/SerenityOS/serenity/pull/24132
Reviewed-by: https://github.com/shannonbooth
Reviewed-by: https://github.com/trflynn89
2 changed files with 9 additions and 0 deletions
|
@ -15,6 +15,7 @@
|
|||
#include <LibWeb/Bindings/ExceptionOrUtils.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Bindings/ReadableStreamDefaultReaderPrototype.h>
|
||||
#include <LibWeb/Fetch/Infrastructure/IncrementalReadLoopReadRequest.h>
|
||||
#include <LibWeb/Streams/AbstractOperations.h>
|
||||
#include <LibWeb/Streams/ReadableStream.h>
|
||||
#include <LibWeb/Streams/ReadableStreamDefaultReader.h>
|
||||
|
@ -187,6 +188,13 @@ JS::NonnullGCPtr<JS::Promise> ReadableStreamDefaultReader::read()
|
|||
return JS::NonnullGCPtr { verify_cast<JS::Promise>(*promise_capability->promise()) };
|
||||
}
|
||||
|
||||
void ReadableStreamDefaultReader::read_a_chunk(Fetch::Infrastructure::IncrementalReadLoopReadRequest& read_request)
|
||||
{
|
||||
// To read a chunk from a ReadableStreamDefaultReader reader, given a read request readRequest,
|
||||
// perform ! ReadableStreamDefaultReaderRead(reader, readRequest).
|
||||
readable_stream_default_reader_read(*this, read_request);
|
||||
}
|
||||
|
||||
// https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes
|
||||
void ReadableStreamDefaultReader::read_all_bytes(ReadLoopReadRequest::SuccessSteps success_steps, ReadLoopReadRequest::FailureSteps failure_steps)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue