Commit Graph

7 Commits

Author SHA1 Message Date
Vadim Zeitlin
d0f56b1d04 Document wxWebResponse::GetContentLength()
Also change its return type from wxInt64 to wxFileOffset for consistency
with all the other length/progress-related functions in wxWebRequest.
2021-01-12 03:25:16 +01:00
Vadim Zeitlin
1e6d6be8bb Add wxWebCredentials and use it in SetCredentials()
Prefer using a class encapsulating both the user name and the password
to using a pair of variables.
2021-01-10 21:27:15 +01:00
Vadim Zeitlin
c70ac66200 Simplify and make more robust wxWebSessionWinHTTP initialization
Rename Init() to Open() as we need this method to return bool to
indicate its success in order to avoid using non-initialized handle
later. Init() is also reserved, by convention, for the common part of
all class ctors in wx code.

Remove m_initialized entirely, it doesn't seem to be obviously better to
cache the failure to create a session than to retry doing it every time
(in fact, it would seem to be worse) and not having it is simpler.

This commit is best viewed ignoring white space.
2021-01-09 16:56:04 +01:00
Vadim Zeitlin
d22956a56a Tiny simplification in wxWebRequestWinHTTP code
Add and use SetFailed(error) function for symmetry with the existing
SetFailedWithLastError().
2021-01-05 00:41:21 +01:00
Vadim Zeitlin
50424cba2c Change wxWebRequest and related objects to hide ref counting
Don't force the application code to deal with wxObjectDataPtr<> or,
worse, calling {Inc,Dec}Ref() manually by hiding it inside the wx
objects themselves and giving the value-like semantics to them.

There should be no real changes in the behaviour, but the API does
change significantly. Notably, wxWebRequest is not a wxEvtHandler itself
any longer, as this would be incompatible with the value semantics, and
an event handler needs to be specified when creating it, so that it
could be notified about the request state changes.
2020-12-30 02:02:20 +01:00
Vadim Zeitlin
71d5729171 Make wxWebSessionFactory private
Having wxWebSessionFactory part of the public API implies keeping
compatibility with the possible ways of implementing it which is too
restrictive for no good reason, so move this class to the private header
and don't document it nor wxWebSession::RegisterFactory() (which is now
private).
2020-12-27 01:03:08 +01:00
Vadim Zeitlin
e5bd5a926c Move backend-specific wxWebRequest headers to private subdirs
There is no need to make these headers public and keeping them private
will allow making backwards-incompatible changes to them in the future.
2020-12-26 17:00:07 +01:00