mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 09:09:43 +00:00
LibWeb: Add a 'get a reader' helper method on ReadableStream
This commit is contained in:
parent
da408cb09a
commit
9ce0c5914b
Notes:
github-actions[bot]
2024-12-25 11:03:14 +00:00
Author: https://github.com/shannonbooth
Commit: 9ce0c5914b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3029
Reviewed-by: https://github.com/kennethmyhra ✅
5 changed files with 14 additions and 6 deletions
|
@ -259,6 +259,13 @@ bool ReadableStream::is_disturbed() const
|
|||
return m_disturbed;
|
||||
}
|
||||
|
||||
// https://streams.spec.whatwg.org/#readablestream-get-a-reader
|
||||
WebIDL::ExceptionOr<GC::Ref<ReadableStreamDefaultReader>> ReadableStream::get_a_reader()
|
||||
{
|
||||
// To get a reader for a ReadableStream stream, return ? AcquireReadableStreamDefaultReader(stream). The result will be a ReadableStreamDefaultReader.
|
||||
return TRY(acquire_readable_stream_default_reader(*this));
|
||||
}
|
||||
|
||||
// https://streams.spec.whatwg.org/#readablestream-pull-from-bytes
|
||||
WebIDL::ExceptionOr<void> ReadableStream::pull_from_bytes(ByteBuffer bytes)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue