1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:48:14 +00:00

LibWeb: Add an alias for FetchAlgorithm's consume-body callback argument

This will make it more convenient in places where the Variant would need
to be re-typed outside of this class.
This commit is contained in:
Timothy Flynn 2023-05-11 11:01:03 -04:00 committed by Andreas Kling
parent 567b8da1e0
commit cb32bb3502

View file

@ -20,12 +20,14 @@ class FetchAlgorithms : public JS::Cell {
public:
struct ConsumeBodyFailureTag { };
using BodyBytes = Variant<Empty, ConsumeBodyFailureTag, ByteBuffer>;
using ProcessRequestBodyChunkLengthFunction = JS::SafeFunction<void(u64)>;
using ProcessRequestEndOfBodyFunction = JS::SafeFunction<void()>;
using ProcessEarlyHintsResponseFunction = JS::SafeFunction<void(JS::NonnullGCPtr<Infrastructure::Response>)>;
using ProcessResponseFunction = JS::SafeFunction<void(JS::NonnullGCPtr<Infrastructure::Response>)>;
using ProcessResponseEndOfBodyFunction = JS::SafeFunction<void(JS::NonnullGCPtr<Infrastructure::Response>)>;
using ProcessResponseConsumeBodyFunction = JS::SafeFunction<void(JS::NonnullGCPtr<Infrastructure::Response>, Variant<Empty, ConsumeBodyFailureTag, ByteBuffer>)>;
using ProcessResponseConsumeBodyFunction = JS::SafeFunction<void(JS::NonnullGCPtr<Infrastructure::Response>, BodyBytes)>;
struct Input {
Optional<ProcessRequestBodyChunkLengthFunction> process_request_body_chunk_length;