mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-18 15:32:22 +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:
parent
2a21675b01
commit
40b7d814c3
Notes:
sideshowbarker
2024-07-19 10:53:48 +09:00
Author: https://github.com/awesomekling
Commit: 40b7d814c3
1 changed files with 4 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue