summaryrefslogtreecommitdiffstats
path: root/dom/promise
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /dom/promise
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz
firefox-8dd16259287f58f9273002717ec4d27e97127719.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/promise')
-rw-r--r--dom/promise/Promise.cpp8
-rw-r--r--dom/promise/PromiseNativeHandler.h5
2 files changed, 6 insertions, 7 deletions
diff --git a/dom/promise/Promise.cpp b/dom/promise/Promise.cpp
index 3abb517ac7..4ef34dfae5 100644
--- a/dom/promise/Promise.cpp
+++ b/dom/promise/Promise.cpp
@@ -719,12 +719,11 @@ void Promise::MaybeRejectWithClone(JSContext* aCx,
// A WorkerRunnable to resolve/reject the Promise on the worker thread.
// Calling thread MUST hold PromiseWorkerProxy's mutex before creating this.
-class PromiseWorkerProxyRunnable final : public WorkerRunnable {
+class PromiseWorkerProxyRunnable final : public WorkerThreadRunnable {
public:
PromiseWorkerProxyRunnable(PromiseWorkerProxy* aPromiseWorkerProxy,
PromiseWorkerProxy::RunCallbackFunc aFunc)
- : WorkerRunnable(aPromiseWorkerProxy->GetWorkerPrivate(),
- "PromiseWorkerProxyRunnable", WorkerThread),
+ : WorkerThreadRunnable("PromiseWorkerProxyRunnable"),
mPromiseWorkerProxy(aPromiseWorkerProxy),
mFunc(aFunc) {
MOZ_ASSERT(NS_IsMainThread());
@@ -735,7 +734,6 @@ class PromiseWorkerProxyRunnable final : public WorkerRunnable {
WorkerPrivate* aWorkerPrivate) override {
MOZ_ASSERT(aWorkerPrivate);
aWorkerPrivate->AssertIsOnWorkerThread();
- MOZ_ASSERT(aWorkerPrivate == mWorkerPrivate);
MOZ_ASSERT(mPromiseWorkerProxy);
RefPtr<Promise> workerPromise = mPromiseWorkerProxy->GetWorkerPromise();
@@ -862,7 +860,7 @@ void PromiseWorkerProxy::RunCallback(JSContext* aCx,
RefPtr<PromiseWorkerProxyRunnable> runnable =
new PromiseWorkerProxyRunnable(this, aFunc);
- runnable->Dispatch();
+ runnable->Dispatch(GetWorkerPrivate());
}
void PromiseWorkerProxy::ResolvedCallback(JSContext* aCx,
diff --git a/dom/promise/PromiseNativeHandler.h b/dom/promise/PromiseNativeHandler.h
index f311f2d29e..d505316b13 100644
--- a/dom/promise/PromiseNativeHandler.h
+++ b/dom/promise/PromiseNativeHandler.h
@@ -12,6 +12,7 @@
#include "js/Value.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/Maybe.h"
+#include "mozilla/StaticString.h"
#include "nsISupports.h"
namespace mozilla::dom {
@@ -58,7 +59,7 @@ class MozPromiseRejectOnDestruction final
// (Accepting RefPtr<T> instead of T* because compiler fails to implicitly
// convert it at call sites)
MozPromiseRejectOnDestruction(const RefPtr<T>& aMozPromise,
- const char* aCallSite)
+ StaticString aCallSite)
: mMozPromise(aMozPromise), mCallSite(aCallSite) {
MOZ_ASSERT(aMozPromise);
}
@@ -70,7 +71,7 @@ class MozPromiseRejectOnDestruction final
}
RefPtr<T> mMozPromise;
- const char* mCallSite;
+ StaticString mCallSite;
};
} // namespace mozilla::dom