From 40b7d814c3c207c9bf20658ee76204a6c5fac599 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 10 Dec 2019 20:46:33 +0100 Subject: [PATCH] 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. :^) --- Libraries/LibCore/CHttpJob.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Libraries/LibCore/CHttpJob.h b/Libraries/LibCore/CHttpJob.h index cb0e00506c..b3f879ce56 100644 --- a/Libraries/LibCore/CHttpJob.h +++ b/Libraries/LibCore/CHttpJob.h @@ -2,6 +2,7 @@ #include #include +#include #include class CTCPSocket; @@ -15,6 +16,9 @@ public: virtual void start() override; virtual void shutdown() override; + CHttpResponse* response() { return static_cast(CNetworkJob::response()); } + const CHttpResponse* response() const { return static_cast(CNetworkJob::response()); } + private: void on_socket_connected(); void finish_up();