Revert "wasm: Proxy emscripten_fetch() to the main thread"

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 <morten.sorvig@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
(cherry picked from commit 157c9eef48916c3e11f43ffb0fe8e8030bed8d06)
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
This commit is contained in:
Piotr Wierciński 2024-04-04 10:20:59 +00:00
parent a4be920e1c
commit bc9d2230d8
2 changed files with 2 additions and 6 deletions

View File

@ -54,7 +54,6 @@ public:
void wakeUp() override;
static void runOnMainThread(std::function<void(void)> fn);
static void runOnMainThreadAsync(std::function<void(void)> 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<void(void)> fn);
static void runAsync(std::function<void(void)> fn);
static void runOnMainThreadAsync(std::function<void(void)> fn);
static QEventDispatcherWasm *g_mainThreadEventDispatcher;

View File

@ -9,7 +9,6 @@
#include <QtCore/qcoreapplication.h>
#include <QtCore/qfileinfo.h>
#include <QtCore/qthread.h>
#include <QtCore/private/qeventdispatcher_wasm_p.h>
#include <QtCore/private/qoffsetstringarray_p.h>
#include <QtCore/private/qtools_p.h>
@ -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;
}