1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:57:44 +00:00

LibCore: Make CHttpJob::response() return a CHttpResponse*

We know that the CNetworkResponse inside a CHttpJob is always going to
be a CHttpResponse, so we can return a casted pointer to be nice. :^)
This commit is contained in:
Andreas Kling 2019-12-10 20:46:33 +01:00
parent 2a21675b01
commit 40b7d814c3

View file

@ -2,6 +2,7 @@
#include <AK/HashMap.h>
#include <LibCore/CHttpRequest.h>
#include <LibCore/CHttpResponse.h>
#include <LibCore/CNetworkJob.h>
class CTCPSocket;
@ -15,6 +16,9 @@ public:
virtual void start() override;
virtual void shutdown() override;
CHttpResponse* response() { return static_cast<CHttpResponse*>(CNetworkJob::response()); }
const CHttpResponse* response() const { return static_cast<const CHttpResponse*>(CNetworkJob::response()); }
private:
void on_socket_connected();
void finish_up();