summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2023-05-11 11:01:03 -0400
committerAndreas Kling <kling@serenityos.org>2023-05-12 05:47:36 +0200
commitcb32bb3502eebbd82199fcced6382c0c982d52ad (patch)
tree74fea3c394d8e8b5c4da1895cd5d1a8cc1cdeeb1 /Userland
parent567b8da1e0a0df9b63e5e50897542cee0499ad95 (diff)
downloadserenity-cb32bb3502eebbd82199fcced6382c0c982d52ad.zip
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.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchAlgorithms.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchAlgorithms.h b/Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchAlgorithms.h
index a73f6e4856..2676547d78 100644
--- a/Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchAlgorithms.h
+++ b/Userland/Libraries/LibWeb/Fetch/Infrastructure/FetchAlgorithms.h
@@ -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;