mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-02 17:28:48 +00:00
LibHTTP+ProtocolServer+LibGemini: Remove Request::schedule()
This API is only used for HttpRequest, but replicated in GeminiRequest without an actual user, so remove it and construct the job like the rest of the protocols.
This commit is contained in:
parent
b11b4b29e9
commit
a461526b07
Notes:
sideshowbarker
2024-07-19 01:38:02 +09:00
Author: https://github.com/alimpfard
Commit: a461526b07
Pull-request: https://github.com/SerenityOS/serenity/pull/3867
Reviewed-by: https://github.com/awesomekling
5 changed files with 4 additions and 22 deletions
|
@ -39,13 +39,6 @@ GeminiRequest::~GeminiRequest()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<Core::NetworkJob> GeminiRequest::schedule()
|
|
||||||
{
|
|
||||||
auto job = GeminiJob::construct(*this);
|
|
||||||
job->start();
|
|
||||||
return job;
|
|
||||||
}
|
|
||||||
|
|
||||||
ByteBuffer GeminiRequest::to_raw_request() const
|
ByteBuffer GeminiRequest::to_raw_request() const
|
||||||
{
|
{
|
||||||
StringBuilder builder;
|
StringBuilder builder;
|
||||||
|
|
|
@ -43,8 +43,6 @@ public:
|
||||||
|
|
||||||
ByteBuffer to_raw_request() const;
|
ByteBuffer to_raw_request() const;
|
||||||
|
|
||||||
RefPtr<Core::NetworkJob> schedule();
|
|
||||||
|
|
||||||
static Optional<GeminiRequest> from_raw_request(const ByteBuffer&);
|
static Optional<GeminiRequest> from_raw_request(const ByteBuffer&);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -38,13 +38,6 @@ HttpRequest::~HttpRequest()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<Core::NetworkJob> HttpRequest::schedule()
|
|
||||||
{
|
|
||||||
auto job = HttpJob::construct(*this);
|
|
||||||
job->start();
|
|
||||||
return job;
|
|
||||||
}
|
|
||||||
|
|
||||||
String HttpRequest::method_name() const
|
String HttpRequest::method_name() const
|
||||||
{
|
{
|
||||||
switch (m_method) {
|
switch (m_method) {
|
||||||
|
|
|
@ -67,8 +67,6 @@ public:
|
||||||
String method_name() const;
|
String method_name() const;
|
||||||
ByteBuffer to_raw_request() const;
|
ByteBuffer to_raw_request() const;
|
||||||
|
|
||||||
RefPtr<Core::NetworkJob> schedule();
|
|
||||||
|
|
||||||
void set_headers(const HashMap<String, String>&);
|
void set_headers(const HashMap<String, String>&);
|
||||||
|
|
||||||
static Optional<HttpRequest> from_raw_request(const ByteBuffer&);
|
static Optional<HttpRequest> from_raw_request(const ByteBuffer&);
|
||||||
|
|
|
@ -50,10 +50,10 @@ OwnPtr<Download> HttpProtocol::start_download(ClientConnection& client, const St
|
||||||
request.set_url(url);
|
request.set_url(url);
|
||||||
request.set_headers(headers);
|
request.set_headers(headers);
|
||||||
request.set_body(request_body);
|
request.set_body(request_body);
|
||||||
auto job = request.schedule();
|
auto job = HTTP::HttpJob::construct(request);
|
||||||
if (!job)
|
auto download = HttpDownload::create_with_job({}, client, (HTTP::HttpJob&)*job);
|
||||||
return nullptr;
|
job->start();
|
||||||
return HttpDownload::create_with_job({}, client, (HTTP::HttpJob&)*job);
|
return download;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue