1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 06:15:06 +00:00

LibWeb: Make ReadableStreamAddReadRequest take a NonnullGCPtr

Make it more obvious in the function signature that this function will
be taking a GC ref to a ReadRequest by appending it to the
ReadableStreams pending read requests.
This commit is contained in:
Shannon Booth 2023-11-19 11:44:29 +13:00 committed by Andreas Kling
parent 5ef41dca53
commit f27e76b0b7
2 changed files with 2 additions and 2 deletions

View file

@ -346,7 +346,7 @@ void readable_stream_error(ReadableStream& stream, JS::Value error)
}
// https://streams.spec.whatwg.org/#readable-stream-add-read-request
void readable_stream_add_read_request(ReadableStream& stream, ReadRequest& read_request)
void readable_stream_add_read_request(ReadableStream& stream, JS::NonnullGCPtr<ReadRequest> read_request)
{
// 1. Assert: stream.[[reader]] implements ReadableStreamDefaultReader.
VERIFY(stream.reader().has_value() && stream.reader()->has<JS::NonnullGCPtr<ReadableStreamDefaultReader>>());

View file

@ -37,7 +37,7 @@ WebIDL::ExceptionOr<double> extract_high_water_mark(QueuingStrategy const&, doub
void readable_stream_close(ReadableStream&);
void readable_stream_error(ReadableStream&, JS::Value error);
void readable_stream_add_read_request(ReadableStream&, ReadRequest&);
void readable_stream_add_read_request(ReadableStream&, JS::NonnullGCPtr<ReadRequest>);
WebIDL::ExceptionOr<JS::NonnullGCPtr<WebIDL::Promise>> readable_stream_cancel(ReadableStream&, JS::Value reason);
void readable_stream_fulfill_read_into_request(ReadableStream&, JS::Value chunk, bool done);
void readable_stream_fulfill_read_request(ReadableStream&, JS::Value chunk, bool done);