Ver Fonte

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.
Shannon Booth há 1 ano atrás
pai
commit
f27e76b0b7

+ 1 - 1
Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp

@@ -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>>());

+ 1 - 1
Userland/Libraries/LibWeb/Streams/AbstractOperations.h

@@ -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);