WebAssembly: Use newer approach for channel setup

Change-Id: I3f7cfbbbe0734c651ad33fcb88850b9445be1df5
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
hjk
2024-10-01 17:27:43 +02:00
parent 5b8d37b1de
commit dcd0b5ff11
3 changed files with 20 additions and 2 deletions

View File

@@ -298,9 +298,11 @@ public:
bool useDebugChannel = false;
bool useQmlChannel = false;
bool usePerfChannel = false;
bool useWorkerChannel = false;
QUrl debugChannel;
QUrl qmlChannel;
QUrl perfChannel;
QUrl workerChannel;
};
class RunControlPrivate : public QObject, public RunControlPrivateData
@@ -606,6 +608,8 @@ void RunControlPrivate::startPortsGathererIfNeededAndContinueStart()
qmlChannel = getNextChannel();
if (usePerfChannel)
perfChannel = getNextChannel();
if (useWorkerChannel)
workerChannel = getNextChannel();
continueStart();
} else {
@@ -700,6 +704,17 @@ QUrl RunControl::perfChannel() const
return d->perfChannel;
}
void RunControl::requestWorkerChannel()
{
d->enablePortsGatherer();
d->useWorkerChannel = true;
}
QUrl RunControl::workerChannel() const
{
return d->workerChannel;
}
void RunControlPrivate::continueStart()
{
checkState(RunControlState::Starting);

View File

@@ -258,6 +258,9 @@ public:
bool usesPerfChannel() const;
QUrl perfChannel() const;
void requestWorkerChannel();
QUrl workerChannel() const;
signals:
void appendMessage(const QString &msg, Utils::OutputFormat format);
void aboutToStart();

View File

@@ -205,7 +205,7 @@ public:
EmrunRunWorker(RunControl *runControl)
: SimpleTargetRunner(runControl)
{
runControl->enablePortsGatherer();
runControl->requestWorkerChannel();
setStartModifier([this, runControl] {
const QString browserId =
@@ -213,7 +213,7 @@ public:
setCommandLine(emrunCommand(runControl->target(),
runControl->buildKey(),
browserId,
QString::number(runControl->findEndPoint().port())));
QString::number(runControl->workerChannel().port())));
setEnvironment(runControl->buildEnvironment());
});
}