mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-09 19:16:02 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
61
Libraries/LibRequests/RequestClient.h
Normal file
61
Libraries/LibRequests/RequestClient.h
Normal file
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <andreas@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/HashMap.h>
|
||||
#include <LibHTTP/HeaderMap.h>
|
||||
#include <LibIPC/ConnectionToServer.h>
|
||||
#include <LibRequests/WebSocket.h>
|
||||
#include <LibWebSocket/WebSocket.h>
|
||||
#include <RequestServer/RequestClientEndpoint.h>
|
||||
#include <RequestServer/RequestServerEndpoint.h>
|
||||
|
||||
namespace Requests {
|
||||
|
||||
class Request;
|
||||
|
||||
class RequestClient final
|
||||
: public IPC::ConnectionToServer<RequestClientEndpoint, RequestServerEndpoint>
|
||||
, public RequestClientEndpoint {
|
||||
IPC_CLIENT_CONNECTION(RequestClient, "/tmp/session/%sid/portal/request"sv)
|
||||
|
||||
public:
|
||||
explicit RequestClient(IPC::Transport);
|
||||
virtual ~RequestClient() override;
|
||||
|
||||
RefPtr<Request> start_request(ByteString const& method, URL::URL const&, HTTP::HeaderMap const& request_headers = {}, ReadonlyBytes request_body = {}, Core::ProxyData const& = {});
|
||||
|
||||
RefPtr<WebSocket> websocket_connect(const URL::URL&, ByteString const& origin = {}, Vector<ByteString> const& protocols = {}, Vector<ByteString> const& extensions = {}, HTTP::HeaderMap const& request_headers = {});
|
||||
|
||||
void ensure_connection(URL::URL const&, ::RequestServer::CacheLevel);
|
||||
|
||||
bool stop_request(Badge<Request>, Request&);
|
||||
bool set_certificate(Badge<Request>, Request&, ByteString, ByteString);
|
||||
|
||||
private:
|
||||
virtual void die() override;
|
||||
|
||||
virtual void request_started(i32, IPC::File const&) override;
|
||||
virtual void request_finished(i32, u64, Optional<NetworkError> const&) override;
|
||||
virtual void certificate_requested(i32) override;
|
||||
virtual void headers_became_available(i32, HTTP::HeaderMap const&, Optional<u32> const&, Optional<String> const&) override;
|
||||
|
||||
virtual void websocket_connected(i64 websocket_id) override;
|
||||
virtual void websocket_received(i64 websocket_id, bool, ByteBuffer const&) override;
|
||||
virtual void websocket_errored(i64 websocket_id, i32) override;
|
||||
virtual void websocket_closed(i64 websocket_id, u16, ByteString const&, bool) override;
|
||||
virtual void websocket_ready_state_changed(i64 websocket_id, u32 ready_state) override;
|
||||
virtual void websocket_subprotocol(i64 websocket_id, ByteString const& subprotocol) override;
|
||||
virtual void websocket_certificate_requested(i64 websocket_id) override;
|
||||
|
||||
HashMap<i32, RefPtr<Request>> m_requests;
|
||||
HashMap<i64, NonnullRefPtr<WebSocket>> m_websockets;
|
||||
|
||||
i64 m_next_websocket_id { 0 };
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue