mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-25 10:48:53 +00:00
LibWeb: Add AO transform_stream_default_source_pull_algorithm()
This commit is contained in:
parent
894f1e9d62
commit
f91c150cfc
Notes:
sideshowbarker
2024-07-17 07:11:12 +09:00
Author: https://github.com/kennethmyhra
Commit: f91c150cfc
Pull-request: https://github.com/SerenityOS/serenity/pull/19998
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/shannonbooth
2 changed files with 16 additions and 0 deletions
|
@ -2993,6 +2993,21 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<WebIDL::Promise>> transform_stream_default_
|
||||||
return transform_stream_default_controller_perform_transform(*controller, chunk);
|
return transform_stream_default_controller_perform_transform(*controller, chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WebIDL::ExceptionOr<JS::NonnullGCPtr<WebIDL::Promise>> transform_stream_default_source_pull_algorithm(TransformStream& stream)
|
||||||
|
{
|
||||||
|
// 1. Assert: stream.[[backpressure]] is true.
|
||||||
|
VERIFY(stream.backpressure().has_value() && *stream.backpressure());
|
||||||
|
|
||||||
|
// 2. Assert: stream.[[backpressureChangePromise]] is not undefined.
|
||||||
|
VERIFY(stream.backpressure_change_promise());
|
||||||
|
|
||||||
|
// 3. Perform ! TransformStreamSetBackpressure(stream, false).
|
||||||
|
TRY(transform_stream_set_backpressure(stream, false));
|
||||||
|
|
||||||
|
// 4. Return stream.[[backpressureChangePromise]].
|
||||||
|
return JS::NonnullGCPtr { *stream.backpressure_change_promise() };
|
||||||
|
}
|
||||||
|
|
||||||
// https://streams.spec.whatwg.org/#transform-stream-error
|
// https://streams.spec.whatwg.org/#transform-stream-error
|
||||||
WebIDL::ExceptionOr<void> transform_stream_error(TransformStream& stream, JS::Value error)
|
WebIDL::ExceptionOr<void> transform_stream_error(TransformStream& stream, JS::Value error)
|
||||||
{
|
{
|
||||||
|
|
|
@ -144,6 +144,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<WebIDL::Promise>> transform_stream_default_
|
||||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<WebIDL::Promise>> transform_stream_default_sink_abort_algorithm(TransformStream&, JS::Value reason);
|
WebIDL::ExceptionOr<JS::NonnullGCPtr<WebIDL::Promise>> transform_stream_default_sink_abort_algorithm(TransformStream&, JS::Value reason);
|
||||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<WebIDL::Promise>> transform_stream_default_sink_close_algorithm(TransformStream&);
|
WebIDL::ExceptionOr<JS::NonnullGCPtr<WebIDL::Promise>> transform_stream_default_sink_close_algorithm(TransformStream&);
|
||||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<WebIDL::Promise>> transform_stream_default_sink_write_algorithm(TransformStream&, JS::Value chunk);
|
WebIDL::ExceptionOr<JS::NonnullGCPtr<WebIDL::Promise>> transform_stream_default_sink_write_algorithm(TransformStream&, JS::Value chunk);
|
||||||
|
WebIDL::ExceptionOr<JS::NonnullGCPtr<WebIDL::Promise>> transform_stream_default_source_pull_algorithm(TransformStream&);
|
||||||
WebIDL::ExceptionOr<void> transform_stream_error(TransformStream&, JS::Value error);
|
WebIDL::ExceptionOr<void> transform_stream_error(TransformStream&, JS::Value error);
|
||||||
WebIDL::ExceptionOr<void> transform_stream_error_writable_and_unblock_write(TransformStream&, JS::Value error);
|
WebIDL::ExceptionOr<void> transform_stream_error_writable_and_unblock_write(TransformStream&, JS::Value error);
|
||||||
WebIDL::ExceptionOr<void> transform_stream_set_backpressure(TransformStream&, bool backpressure);
|
WebIDL::ExceptionOr<void> transform_stream_set_backpressure(TransformStream&, bool backpressure);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue