Add GetNativeHandle() to wxWebSession and wxWebRequest

This allows to retrieve the handles used internally in order to do
something not supported by the public API yet.
This commit is contained in:
Vadim Zeitlin
2021-01-16 00:21:00 +01:00
parent a561cf199b
commit 65aad890e3
8 changed files with 108 additions and 1 deletions

View File

@@ -207,10 +207,25 @@ public:
/**
Check if the object is valid.
No other methods can be used if this function returns @false.
If the object is invalid, it must be assigned a valid request before
any other methods can be used (with the exception of GetNativeHandle()).
*/
bool IsOk() const;
/**
Return the native handle corresponding to this request object.
@c wxWebRequestHandle is an opaque type containing a value of the
following type according to the backend being used:
- For WinHTTP backend, this is @c HINTERNET request handle.
- For CURL backend, this is a @c CURL struct pointer.
- For macOS backend, this is @c NSURLSessionTask object pointer.
@see wxWebSession::GetNativeHandle()
*/
wxWebRequestHandle GetNativeHandle() const;
/**
Send the request to the server asynchronously.
@@ -692,6 +707,20 @@ public:
*/
static bool IsBackendAvailable(const wxString& backend);
/**
Return the native handle corresponding to this session object.
@c wxWebSessionHandle is an opaque type containing a value of the
following type according to the backend being used:
- For WinHTTP backend, this is @c HINTERNET session handle.
- For CURL backend, this is a @c CURLM struct pointer.
- For macOS backend, this is @c NSURLSession object pointer.
@see wxWebRequest::GetNativeHandle()
*/
wxWebSessionHandle GetNativeHandle() const;
/**
Return true if the session was successfully opened and can be used.
*/