From dcd0b5ff11e2bc6aa9a8715fcaef1e81f25c8aad Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 1 Oct 2024 17:27:43 +0200 Subject: [PATCH] WebAssembly: Use newer approach for channel setup Change-Id: I3f7cfbbbe0734c651ad33fcb88850b9445be1df5 Reviewed-by: Alessandro Portale --- src/plugins/projectexplorer/runcontrol.cpp | 15 +++++++++++++++ src/plugins/projectexplorer/runcontrol.h | 3 +++ .../webassembly/webassemblyrunconfiguration.cpp | 4 ++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index 14f2094c166..62b11f11570 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -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); diff --git a/src/plugins/projectexplorer/runcontrol.h b/src/plugins/projectexplorer/runcontrol.h index 69bcf1cdc1d..3003e83fef0 100644 --- a/src/plugins/projectexplorer/runcontrol.h +++ b/src/plugins/projectexplorer/runcontrol.h @@ -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(); diff --git a/src/plugins/webassembly/webassemblyrunconfiguration.cpp b/src/plugins/webassembly/webassemblyrunconfiguration.cpp index 664625669c6..62d96ae5f6d 100644 --- a/src/plugins/webassembly/webassemblyrunconfiguration.cpp +++ b/src/plugins/webassembly/webassemblyrunconfiguration.cpp @@ -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()); }); }