LibWeb: Add a 'piped through' helper method on ReadableStream

This reads a bit nicer, and follows the streams spec pattern on
performing operations on a stream outside of the streams spec.
This commit is contained in:
Shannon Booth 2024-12-24 12:25:01 +13:00 committed by Andreas Kling
commit da408cb09a
Notes: github-actions[bot] 2024-12-25 11:03:22 +00:00
5 changed files with 22 additions and 6 deletions

View file

@ -108,6 +108,7 @@ public:
WebIDL::ExceptionOr<void> pull_from_bytes(ByteBuffer);
WebIDL::ExceptionOr<void> enqueue(JS::Value chunk);
void set_up_with_byte_reading_support(GC::Ptr<PullAlgorithm> = {}, GC::Ptr<CancelAlgorithm> = {}, double high_water_mark = 0);
GC::Ref<WebIDL::Promise> piped_through(GC::Ref<WritableStream>, bool prevent_close = false, bool prevent_abort = false, bool prevent_cancel = false, JS::Value signal = JS::js_undefined());
private:
explicit ReadableStream(JS::Realm&);