LibWeb: Implement ReadableStreamPipeTo according to spec

Our existing implementation of stream piping was extremely ad-hoc. It
did nothing to handle closed/errored streams, and did not read from or
write to streams in a way required by the spec.

This new implementation uses a custom JS::Cell to drive the read/write
loop.
This commit is contained in:
Timothy Flynn 2025-04-09 12:01:51 -04:00 committed by Tim Flynn
commit eb0a51faf0
Notes: github-actions[bot] 2025-04-11 16:11:49 +00:00
33 changed files with 3926 additions and 85 deletions

View file

@ -29,6 +29,7 @@ GC::Ref<Promise> react_to_promise(Promise const&, GC::Ptr<ReactionSteps> on_fulf
GC::Ref<Promise> upon_fulfillment(Promise const&, GC::Ref<ReactionSteps>);
GC::Ref<Promise> upon_rejection(Promise const&, GC::Ref<ReactionSteps>);
void mark_promise_as_handled(Promise const&);
bool is_promise_fulfilled(Promise const&);
void wait_for_all(JS::Realm&, Vector<GC::Ref<Promise>> const& promises, Function<void(Vector<JS::Value> const&)> success_steps, Function<void(JS::Value)> failure_steps);
GC::Ref<Promise> get_promise_for_wait_for_all(JS::Realm&, Vector<GC::Ref<Promise>> const& promises);