LibWeb: Sort remaining stream AOs (mostly) in spec order

The remaining AOs can stay where they are. This patch just sorts them in
spec order to match the other AO files. Section 8.1 is last, however, as
these are all templates and need the declarations of other AOs above.
This commit is contained in:
Timothy Flynn 2025-04-17 20:09:43 -04:00 committed by Tim Flynn
commit 629cd3c42a
Notes: github-actions[bot] 2025-04-18 10:56:36 +00:00
2 changed files with 78 additions and 75 deletions

View file

@ -17,21 +17,24 @@
namespace Web::Streams {
GC::Ref<SizeAlgorithm> extract_size_algorithm(JS::VM&, QueuingStrategy const&);
// 7.4. Abstract operations, https://streams.spec.whatwg.org/#qs-abstract-ops
WebIDL::ExceptionOr<double> extract_high_water_mark(QueuingStrategy const&, double default_hwm);
GC::Ref<SizeAlgorithm> extract_size_algorithm(JS::VM&, QueuingStrategy const&);
WebIDL::ExceptionOr<GC::Ref<JS::ArrayBuffer>> transfer_array_buffer(JS::Realm& realm, JS::ArrayBuffer& buffer);
bool is_non_negative_number(JS::Value);
bool can_copy_data_block_bytes_buffer(JS::ArrayBuffer const& to_buffer, u64 to_index, JS::ArrayBuffer const& from_buffer, u64 from_index, u64 count);
// 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);
WebIDL::ExceptionOr<GC::Ref<JS::ArrayBuffer>> transfer_array_buffer(JS::Realm& realm, JS::ArrayBuffer& buffer);
WebIDL::ExceptionOr<JS::Value> clone_as_uint8_array(JS::Realm&, WebIDL::ArrayBufferView&);
WebIDL::ExceptionOr<JS::Value> structured_clone(JS::Realm&, JS::Value value);
bool can_copy_data_block_bytes_buffer(JS::ArrayBuffer const& to_buffer, u64 to_index, JS::ArrayBuffer const& from_buffer, u64 from_index, u64 count);
// 8.1. Queue-with-sizes, https://streams.spec.whatwg.org/#queue-with-sizes
// https://streams.spec.whatwg.org/#value-with-size
struct ValueWithSize {
JS::Value value;
double size;
double size { 0 };
};
// https://streams.spec.whatwg.org/#dequeue-value