mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:07:35 +00:00
LibWeb: Add AO set_up_transform_stream_default_controller()
This commit is contained in:
parent
86455bbb74
commit
f7c532d093
2 changed files with 21 additions and 0 deletions
|
@ -2888,6 +2888,26 @@ WebIDL::ExceptionOr<void> initialize_transform_stream(TransformStream& stream, J
|
|||
return {};
|
||||
}
|
||||
|
||||
// https://streams.spec.whatwg.org/#set-up-transform-stream-default-controller
|
||||
void set_up_transform_stream_default_controller(TransformStream& stream, TransformStreamDefaultController& controller, TransformAlgorithm&& transform_algorithm, FlushAlgorithm&& flush_algorithm)
|
||||
{
|
||||
// 1. Assert: stream implements TransformStream.
|
||||
// 2. Assert: stream.[[controller]] is undefined.
|
||||
VERIFY(!stream.controller());
|
||||
|
||||
// 3. Set controller.[[stream]] to stream.
|
||||
controller.set_stream(stream);
|
||||
|
||||
// 4. Set stream.[[controller]] to controller.
|
||||
stream.set_controller(controller);
|
||||
|
||||
// 5. Set controller.[[transformAlgorithm]] to transformAlgorithm.
|
||||
controller.set_transform_algorithm(move(transform_algorithm));
|
||||
|
||||
// 6. Set controller.[[flushAlgorithm]] to flushAlgorithm.
|
||||
controller.set_flush_algorithm(move(flush_algorithm));
|
||||
}
|
||||
|
||||
// https://streams.spec.whatwg.org/#transform-stream-default-controller-clear-algorithms
|
||||
void transform_stream_default_controller_clear_algorithms(TransformStreamDefaultController& controller)
|
||||
{
|
||||
|
|
|
@ -139,6 +139,7 @@ WebIDL::ExceptionOr<void> writable_stream_default_controller_process_write(Writa
|
|||
WebIDL::ExceptionOr<void> writable_stream_default_controller_write(WritableStreamDefaultController&, JS::Value chunk, JS::Value chunk_size);
|
||||
|
||||
WebIDL::ExceptionOr<void> initialize_transform_stream(TransformStream&, JS::NonnullGCPtr<JS::PromiseCapability> start_promise, double writable_high_water_mark, SizeAlgorithm&& writable_size_algorithm, double readable_high_water_mark, SizeAlgorithm&& readable_size_algorithm);
|
||||
void set_up_transform_stream_default_controller(TransformStream&, TransformStreamDefaultController&, TransformAlgorithm&&, FlushAlgorithm&&);
|
||||
void transform_stream_default_controller_clear_algorithms(TransformStreamDefaultController&);
|
||||
WebIDL::ExceptionOr<void> transform_stream_default_controller_enqueue(TransformStreamDefaultController&, JS::Value chunk);
|
||||
WebIDL::ExceptionOr<void> transform_stream_default_controller_error(TransformStreamDefaultController&, JS::Value error);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue