LibWeb: Implement AO transform_stream_unblock_write

This commit is contained in:
Kenneth Myhra 2024-06-02 21:35:49 +02:00 committed by Tim Flynn
commit afb74eca52
Notes: sideshowbarker 2024-07-16 23:05:02 +09:00
2 changed files with 9 additions and 0 deletions

View file

@ -5175,6 +5175,14 @@ void transform_stream_set_up(TransformStream& stream, JS::NonnullGCPtr<Transform
set_up_transform_stream_default_controller(stream, controller, transform_algorithm_wrapper, flush_algorithm_wrapper);
}
// https://streams.spec.whatwg.org/#transform-stream-unblock-write
void transform_stream_unblock_write(TransformStream& stream)
{
// 1. If stream.[[backpressure]] is true, perform ! TransformStreamSetBackpressure(stream, false).
if (stream.backpressure().has_value() && stream.backpressure().value())
transform_stream_set_backpressure(stream, false);
}
// https://streams.spec.whatwg.org/#is-non-negative-number
bool is_non_negative_number(JS::Value value)
{

View file

@ -183,6 +183,7 @@ void transform_stream_error(TransformStream&, JS::Value error);
void transform_stream_error_writable_and_unblock_write(TransformStream&, JS::Value error);
void transform_stream_set_backpressure(TransformStream&, bool backpressure);
void transform_stream_set_up(TransformStream&, JS::NonnullGCPtr<TransformAlgorithm>, JS::GCPtr<FlushAlgorithm> = {}, JS::GCPtr<CancelAlgorithm> = {});
void transform_stream_unblock_write(TransformStream&);
bool is_non_negative_number(JS::Value);
bool can_transfer_array_buffer(JS::ArrayBuffer const& array_buffer);