mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 13:02:09 +02:00
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.
This commit is contained in:
committed by
Tim Flynn
parent
d852b59d99
commit
2e9c8ab669
Notes:
github-actions[bot]
2025-12-08 18:58:39 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/2e9c8ab669f Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7061 Reviewed-by: https://github.com/trflynn89 ✅
@@ -71,6 +71,8 @@ private:
|
||||
GC::Ptr<WebIDL::Promise> m_last_write_promise;
|
||||
Vector<JS::Value, 1> m_unwritten_chunks;
|
||||
|
||||
GC::Ref<WebIDL::ReactionSteps> m_on_shutdown;
|
||||
|
||||
bool m_prevent_close { false };
|
||||
bool m_prevent_abort { false };
|
||||
bool m_prevent_cancel { false };
|
||||
|
||||
Reference in New Issue
Block a user