From bc9d2230d85a694a9a4a2b358e4a299960a51c2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wierci=C5=84ski?= Date: Thu, 4 Apr 2024 10:20:59 +0000 Subject: [PATCH] Revert "wasm: Proxy emscripten_fetch() to the main thread" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f2f2b6ef18907a76461b54e110618e7840971fa7. Reason for revert: There are couple of issues introduced. Lets revert to base revision and go with fixes from there. Pick-to: 6.6 6.5 Change-Id: I8341de42ef3e4a609bfbffdb763dd5c28794473c Reviewed-by: Morten Johan Sørvig Reviewed-by: Qt CI Bot Reviewed-by: Even Oscar Andersen (cherry picked from commit 157c9eef48916c3e11f43ffb0fe8e8030bed8d06) Reviewed-by: Piotr Wierciński --- src/corelib/kernel/qeventdispatcher_wasm_p.h | 2 +- src/network/access/qnetworkreplywasmimpl.cpp | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/corelib/kernel/qeventdispatcher_wasm_p.h b/src/corelib/kernel/qeventdispatcher_wasm_p.h index 09231e0d4c4..b486d1f1f70 100644 --- a/src/corelib/kernel/qeventdispatcher_wasm_p.h +++ b/src/corelib/kernel/qeventdispatcher_wasm_p.h @@ -54,7 +54,6 @@ public: void wakeUp() override; static void runOnMainThread(std::function fn); - static void runOnMainThreadAsync(std::function fn); static void socketSelect(int timeout, int socket, bool waitForRead, bool waitForWrite, bool *selectForRead, bool *selectForWrite, bool *socketDisconnect); protected: @@ -91,6 +90,7 @@ private: static void run(std::function fn); static void runAsync(std::function fn); + static void runOnMainThreadAsync(std::function fn); static QEventDispatcherWasm *g_mainThreadEventDispatcher; diff --git a/src/network/access/qnetworkreplywasmimpl.cpp b/src/network/access/qnetworkreplywasmimpl.cpp index eb3e50dec86..d8190434ccf 100644 --- a/src/network/access/qnetworkreplywasmimpl.cpp +++ b/src/network/access/qnetworkreplywasmimpl.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include @@ -296,10 +295,7 @@ void QNetworkReplyWasmImplPrivate::doSendRequest() QByteArray destinationPath = dPath.toUtf8(); attr.destinationPath = destinationPath.constData(); - auto url = request.url().toString().toUtf8(); - QEventDispatcherWasm::runOnMainThread([attr, url]() mutable { - emscripten_fetch(&attr, url); - }); + m_fetch = emscripten_fetch(&attr, request.url().toString().toUtf8()); state = Working; }