Commit graph

4 commits

Author SHA1 Message Date
Aliaksandr Kalenik
2e9c8ab669 LibWeb: Register shutdown-on-close handler once in ReadableStreamPipeTo
Previously, we added a `reader.closed()` promise reaction during every
`ReadableStreamPipeTo::process()` call, which meant allocating a new
reaction objects for every processed chunk and retaining all of them
until the stream closed. The same issue existed for `writer.closed()`
inside `ReadableStreamPipeTo::read_chunk()`.

This change registers a single shutdown handler for both the reader and
the writer in the ReadableStreamPipeTo constructor.
2025-12-08 13:57:14 -05:00
Aliaksandr Kalenik
18089937a5 LibWeb: Use last promise to wait for pending writes ReadableStreamPipeTo
ReadableStreamPipeTo is used in fetching, and previously requests with
large bodies could lead to tens of thousands of pending write promises
being accumulated in `m_pending_writes`.

With this change, instead of accumulating all pending write promises up
until pipe shutdown, we only keep track of the last one and use it to
determine whether there are pending writes when we need to shut down the
pipe.
2025-12-08 11:45:02 -05:00
Timothy Flynn
26c01f0957 LibWeb: Move WritableStream AOs into their own file
The main streams AO file has gotten very large, and is a bit difficult
to navigate. In an effort to improve DX, this migrates WritableStream
AOs to their own file.
2025-04-18 06:55:40 -04:00
Timothy Flynn
a9ddd427cb LibWeb: Move ReadableStream AOs into their own file
The main streams AO file has gotten very large, and is a bit difficult
to navigate. In an effort to improve DX, this migrates ReadableStream
AOs to their own file. And the helper classes used for the tee and pipe-
to operations are also in their own files.
2025-04-18 06:55:40 -04:00