1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:37:34 +00:00

LibWeb: Add AO set_up_transform_stream_default_controller()

This commit is contained in:
Kenneth Myhra 2023-07-08 20:07:45 +02:00 committed by Andreas Kling
parent 86455bbb74
commit f7c532d093
2 changed files with 21 additions and 0 deletions

View file

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