mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:47:45 +00:00
GHttp: Rename GHttpNetworkJob => GHttpJob. And tidy up a little bit.
This commit is contained in:
parent
37ae00a4dd
commit
7fcca0ce4b
4 changed files with 15 additions and 16 deletions
31
LibGUI/GHttpJob.h
Normal file
31
LibGUI/GHttpJob.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibGUI/GNetworkJob.h>
|
||||
#include <LibGUI/GHttpRequest.h>
|
||||
#include <AK/HashMap.h>
|
||||
|
||||
class GTCPSocket;
|
||||
|
||||
class GHttpJob final : public GNetworkJob {
|
||||
public:
|
||||
explicit GHttpJob(const GHttpRequest&);
|
||||
virtual ~GHttpJob() override;
|
||||
|
||||
virtual void start() override;
|
||||
|
||||
virtual const char* class_name() const override { return "GHttpJob"; }
|
||||
|
||||
private:
|
||||
enum class State {
|
||||
InStatus,
|
||||
InHeaders,
|
||||
InBody,
|
||||
Finished,
|
||||
};
|
||||
|
||||
GHttpRequest m_request;
|
||||
GTCPSocket* m_socket { nullptr };
|
||||
State m_state { State::InStatus };
|
||||
int m_code { -1 };
|
||||
HashMap<String, String> m_headers;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue