ladybird/Servers/ProtocolServer/HttpDownload.cpp

23 lines
604 B
C++
Raw Normal View History

#include <LibCore/CHttpJob.h>
#include <LibCore/CHttpResponse.h>
#include <ProtocolServer/HttpDownload.h>
HttpDownload::HttpDownload(PSClientConnection& client, NonnullRefPtr<CHttpJob>&& job)
: Download(client)
, m_job(job)
{
m_job->on_finish = [this](bool success) {
set_payload(m_job->response()->payload());
did_finish(success);
};
}
HttpDownload::~HttpDownload()
{
}
NonnullRefPtr<HttpDownload> HttpDownload::create_with_job(Badge<HttpProtocol>, PSClientConnection& client, NonnullRefPtr<CHttpJob>&& job)
{
return adopt(*new HttpDownload(client, move(job)));
}