LibWeb: Implement transferable streams AOs

These AOs are common between transferable ReadableStream, WritableStream
and TransformStream objects.
This commit is contained in:
Timothy Flynn 2025-05-20 17:18:20 -04:00 committed by Tim Flynn
commit 7e225b496d
Notes: github-actions[bot] 2025-05-21 10:56:08 +00:00
2 changed files with 375 additions and 0 deletions

View file

@ -21,6 +21,13 @@ namespace Web::Streams {
WebIDL::ExceptionOr<double> extract_high_water_mark(QueuingStrategy const&, double default_hwm);
GC::Ref<SizeAlgorithm> extract_size_algorithm(JS::VM&, QueuingStrategy const&);
// 8.2. Transferable streams, https://streams.spec.whatwg.org/#transferrable-streams
void cross_realm_transform_send_error(JS::Realm&, HTML::MessagePort&, JS::Value error);
WebIDL::ExceptionOr<void> pack_and_post_message(JS::Realm&, HTML::MessagePort&, StringView type, JS::Value value);
WebIDL::ExceptionOr<void> pack_and_post_message_handling_error(JS::Realm&, HTML::MessagePort&, StringView type, JS::Value value);
void set_up_cross_realm_transform_readable(JS::Realm&, ReadableStream&, HTML::MessagePort&);
void set_up_cross_realm_transform_writable(JS::Realm&, WritableStream&, HTML::MessagePort&);
// 8.3. Miscellaneous, https://streams.spec.whatwg.org/#misc-abstract-ops
bool can_transfer_array_buffer(JS::ArrayBuffer const& array_buffer);
bool is_non_negative_number(JS::Value);