Get rid of public wxWebSession::GetHeaders()

This is unnecessary, it can be protected and we can initialize
wxWebRequest::m_headers directly in its ctor instead of using this
function (which also simplifies code and makes it impossible to forget
to do this).
This commit is contained in:
Vadim Zeitlin
2020-12-13 03:09:55 +01:00
parent 7b7f9fa6c0
commit 59bc7e59d7
5 changed files with 18 additions and 13 deletions

View File

@@ -100,14 +100,7 @@ protected:
wxFileOffset m_dataSize;
wxSharedPtr<wxInputStream> m_dataStream;
wxWebRequest(wxWebSession& session, int id):
m_storage(Storage_Memory),
m_dataSize(0),
m_session(session),
m_id(id),
m_state(State_Idle),
m_ignoreServerErrorStatus(false),
m_bytesReceived(0) { }
wxWebRequest(wxWebSession& session, int id);
bool CheckServerStatus();
@@ -227,8 +220,6 @@ public:
virtual void SetHeader(const wxString& name, const wxString& value)
{ m_headers[name] = value; }
const wxWebRequestHeaderMap& GetHeaders() const { return m_headers; }
void SetTempDir(const wxString& dir) { m_tempDir = dir; }
wxString GetTempDir() const;
@@ -245,7 +236,12 @@ public:
protected:
wxWebSession();
const wxWebRequestHeaderMap& GetHeaders() const { return m_headers; }
private:
// Make it a friend to allow accessing our m_headers.
friend class wxWebRequest;
wxWebRequestHeaderMap m_headers;
wxString m_tempDir;