Files
ladybird/Services/RequestServer/RequestClient.ipc
Timothy Flynn 9375660b64 LibHTTP+LibWeb+RequestServer: Move Fetch's HTTP header infra to LibHTTP
The end goal here is for LibHTTP to be the home of our RFC 9111 (HTTP
caching) implementation. We currently have one implementation in LibWeb
for our in-memory cache and another in RequestServer for our disk cache.

The implementations both largely revolve around interacting with HTTP
headers. But in LibWeb, we are using Fetch's header infra, and in RS we
are using are home-grown header infra from LibHTTP.

So to give these a common denominator, this patch replaces the LibHTTP
implementation with Fetch's infra. Our existing LibHTTP implementation
was not particularly compliant with any spec, so this at least gives us
a standards-based common implementation.

This migration also required moving a handful of other Fetch AOs over
to LibHTTP. (It turns out these AOs were all from the Fetch/Infra/HTTP
folder, so perhaps it makes sense for LibHTTP to be the implementation
of that entire set of facilities.)
2025-11-27 14:57:29 +01:00

28 lines
1.2 KiB
Plaintext

#include <LibHTTP/Header.h>
#include <LibRequests/CacheSizes.h>
#include <LibRequests/NetworkError.h>
#include <LibRequests/RequestTimingInfo.h>
#include <LibURL/URL.h>
endpoint RequestClient
{
request_started(i32 request_id, IPC::File fd) =|
request_finished(i32 request_id, u64 total_size, Requests::RequestTimingInfo timing_info, Optional<Requests::NetworkError> network_error) =|
headers_became_available(i32 request_id, Vector<HTTP::Header> response_headers, Optional<u32> status_code, Optional<String> reason_phrase) =|
// Websocket API
// FIXME: See if this can be merged with the regular APIs
websocket_connected(i64 websocket_id) =|
websocket_received(i64 websocket_id, bool is_text, ByteBuffer data) =|
websocket_errored(i64 websocket_id, i32 message) =|
websocket_closed(i64 websocket_id, u16 code, ByteString reason, bool clean) =|
websocket_ready_state_changed(i64 websocket_id, u32 ready_state) =|
websocket_subprotocol(i64 websocket_id, ByteString subprotocol) =|
websocket_certificate_requested(i64 websocket_id) =|
// Certificate requests
certificate_requested(i32 request_id) =|
estimated_cache_size(u64 cache_size_estimation_id, Requests::CacheSizes sizes) =|
}