Process event about the request becoming active synchronously

This is required in order to allow doing something with the request when
it already have a valid native handle, but hasn't actually started yet.
This commit is contained in:
Vadim Zeitlin
2021-01-16 14:59:41 +01:00
parent 1bf6d5e188
commit 3241c443c5
2 changed files with 28 additions and 3 deletions

View File

@@ -137,7 +137,14 @@ public:
*/
State_Unauthorized,
/// The request has been started and is transferring data
/**
The request is about to start.
An event notifying about the switch to this state is generated when
Start() is called (unless an error occurs, in which case the state
becomes State_Failed instead). Handling this event allows to do
something right before the asynchronous request actually starts.
*/
State_Active,
/**
@@ -222,6 +229,11 @@ public:
- For CURL backend, this is a @c CURL struct pointer.
- For macOS backend, this is @c NSURLSessionTask object pointer.
Note that this function returns a valid value only after the request is
started successfully using Start(). Notably, it is guaranteed to return
a valid value when handling wxWebRequestEvent corresponding to the
switch to @c State_Active.
@see wxWebSession::GetNativeHandle()
*/
wxWebRequestHandle GetNativeHandle() const;