LibWeb: Use Vector<ByteBuffer> to store chunks in ReadLoopReadRequest

This stores the incoming chunks into a Vector of ByteBuffer in order to
be able to retrieve them in the same order as they came in.
This commit is contained in:
Kenneth Myhra 2024-04-06 12:10:42 +02:00 committed by Andreas Kling
commit 12cfa08a09
Notes: sideshowbarker 2024-07-17 03:27:40 +09:00
2 changed files with 10 additions and 6 deletions

View file

@ -36,7 +36,7 @@ class ReadLoopReadRequest final : public ReadRequest {
public:
// successSteps, which is an algorithm accepting a byte sequence
using SuccessSteps = JS::SafeFunction<void(ByteBuffer)>;
using SuccessSteps = JS::SafeFunction<void(Vector<ByteBuffer> const&)>;
// failureSteps, which is an algorithm accepting a JavaScript value
using FailureSteps = JS::SafeFunction<void(JS::Value error)>;
@ -55,7 +55,7 @@ private:
JS::VM& m_vm;
JS::NonnullGCPtr<JS::Realm> m_realm;
JS::NonnullGCPtr<ReadableStreamDefaultReader> m_reader;
ByteBuffer m_bytes;
Vector<ByteBuffer> m_byte_chunks;
SuccessSteps m_success_steps;
FailureSteps m_failure_steps;
};