mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:17:44 +00:00
Services: Rename ProtocolServer to RequestServer
The current ProtocolServer was really only used for requests, and with the recent introduction of the WebSocket service, long-lasting connections with another server are not part of it. To better reflect this, this commit renames it to RequestServer. This commit also changes the existing 'protocol' portal to 'request', the existing 'protocol' user and group to 'request', and most mentions of the 'download' aspect of the request to 'request' when relevant, to make everything consistent across the system. Note that LibProtocol still exists as-is, but the more generic Client class and the more specific Download class have both been renamed to a more accurate RequestClient and Request to match the new names. This commit only change names, not behaviors.
This commit is contained in:
parent
22413ef729
commit
71d27abb97
58 changed files with 786 additions and 788 deletions
44
Userland/Libraries/LibProtocol/RequestClient.h
Normal file
44
Userland/Libraries/LibProtocol/RequestClient.h
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/HashMap.h>
|
||||
#include <LibIPC/ServerConnection.h>
|
||||
#include <RequestServer/RequestClientEndpoint.h>
|
||||
#include <RequestServer/RequestServerEndpoint.h>
|
||||
|
||||
namespace Protocol {
|
||||
|
||||
class Request;
|
||||
|
||||
class RequestClient
|
||||
: public IPC::ServerConnection<RequestClientEndpoint, RequestServerEndpoint>
|
||||
, public RequestClientEndpoint {
|
||||
C_OBJECT(RequestClient);
|
||||
|
||||
public:
|
||||
virtual void handshake() override;
|
||||
|
||||
bool is_supported_protocol(const String&);
|
||||
template<typename RequestHashMapTraits = Traits<String>>
|
||||
RefPtr<Request> start_request(const String& method, const String& url, const HashMap<String, String, RequestHashMapTraits>& request_headers = {}, ReadonlyBytes request_body = {});
|
||||
|
||||
bool stop_request(Badge<Request>, Request&);
|
||||
bool set_certificate(Badge<Request>, Request&, String, String);
|
||||
|
||||
private:
|
||||
RequestClient();
|
||||
|
||||
virtual void handle(const Messages::RequestClient::RequestProgress&) override;
|
||||
virtual void handle(const Messages::RequestClient::RequestFinished&) override;
|
||||
virtual OwnPtr<Messages::RequestClient::CertificateRequestedResponse> handle(const Messages::RequestClient::CertificateRequested&) override;
|
||||
virtual void handle(const Messages::RequestClient::HeadersBecameAvailable&) override;
|
||||
|
||||
HashMap<i32, RefPtr<Request>> m_requests;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue