Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
The FetchContext class ensures the requestData object remains valid while a fetch operation is pending. More...
#include <qnetworkreplywasmimpl_p.h>
Public Types | |
enum class | State { SCHEDULED , SENT , FINISHED , CANCELED , TO_BE_DESTROYED } |
Public Member Functions | |
FetchContext (QNetworkReplyWasmImplPrivate *networkReply) | |
Public Attributes | |
QNetworkReplyWasmImplPrivate * | reply { nullptr } |
std::mutex | mutex |
QByteArray | requestData |
State | state { State::SCHEDULED } |
The FetchContext class ensures the requestData object remains valid while a fetch operation is pending.
Since Emscripten fetch is asynchronous, requestData must persist until one of the final callbacks is invoked. Additionally, there's a potential race condition between the thread scheduling the fetch operation and the one executing it. Since fetch must occur on the main thread due to browser limitations, a mutex safeguards the FetchContext to ensure atomic state transitions.
Definition at line 78 of file qnetworkreplywasmimpl_p.h.
|
strong |
Enumerator | |
---|---|
SCHEDULED | |
SENT | |
FINISHED | |
CANCELED | |
TO_BE_DESTROYED |
Definition at line 80 of file qnetworkreplywasmimpl_p.h.
|
inline |
Definition at line 82 of file qnetworkreplywasmimpl_p.h.
std::mutex FetchContext::mutex |
Definition at line 85 of file qnetworkreplywasmimpl_p.h.
Referenced by QNetworkReplyWasmImplPrivate::~QNetworkReplyWasmImplPrivate(), and QNetworkReplyWasmImplPrivate::setCanceled().
QNetworkReplyWasmImplPrivate* FetchContext::reply { nullptr } |
Definition at line 84 of file qnetworkreplywasmimpl_p.h.
Referenced by QNetworkReplyWasmImplPrivate::~QNetworkReplyWasmImplPrivate().
QByteArray FetchContext::requestData |
Definition at line 86 of file qnetworkreplywasmimpl_p.h.
Referenced by QNetworkReplyWasmImplPrivate::doSendRequest().
State FetchContext::state { State::SCHEDULED } |
Definition at line 87 of file qnetworkreplywasmimpl_p.h.
Referenced by QNetworkReplyWasmImplPrivate::~QNetworkReplyWasmImplPrivate(), and QNetworkReplyWasmImplPrivate::setCanceled().