![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
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 79 of file qnetworkreplywasmimpl_p.h.
|
strong |
Enumerator | |
---|---|
SCHEDULED | |
SENT | |
FINISHED | |
CANCELED | |
TO_BE_DESTROYED |
Definition at line 81 of file qnetworkreplywasmimpl_p.h.
|
inline |
Definition at line 83 of file qnetworkreplywasmimpl_p.h.
References reply.
Referenced by QNetworkReplyWasmImplPrivate::doSendRequest().
std::mutex FetchContext::mutex |
Definition at line 86 of file qnetworkreplywasmimpl_p.h.
QNetworkReplyWasmImplPrivate* FetchContext::reply { nullptr } |
Definition at line 85 of file qnetworkreplywasmimpl_p.h.
Referenced by FetchContext(), and QNetworkReplyWasmImplPrivate::~QNetworkReplyWasmImplPrivate().
QByteArray FetchContext::requestData |
Definition at line 87 of file qnetworkreplywasmimpl_p.h.
State FetchContext::state { State::SCHEDULED } |
Definition at line 88 of file qnetworkreplywasmimpl_p.h.
Referenced by QNetworkReplyWasmImplPrivate::~QNetworkReplyWasmImplPrivate(), and QNetworkReplyWasmImplPrivate::setCanceled().