summaryrefslogtreecommitdiffstats
path: root/dom/serviceworkers
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
commit59203c63bb777a3bacec32fb8830fba33540e809 (patch)
tree58298e711c0ff0575818c30485b44a2f21bf28a0 /dom/serviceworkers
parentAdding upstream version 126.0.1. (diff)
downloadfirefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz
firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/serviceworkers')
-rw-r--r--dom/serviceworkers/ServiceWorkerEvents.cpp1
-rw-r--r--dom/serviceworkers/ServiceWorkerOp.cpp17
-rw-r--r--dom/serviceworkers/ServiceWorkerOp.h3
-rw-r--r--dom/serviceworkers/test/gtest/TestReadWrite.cpp9
-rw-r--r--dom/serviceworkers/test/test_serviceworker_interfaces.js1
5 files changed, 14 insertions, 17 deletions
diff --git a/dom/serviceworkers/ServiceWorkerEvents.cpp b/dom/serviceworkers/ServiceWorkerEvents.cpp
index 6027625021..9fc7bb1a91 100644
--- a/dom/serviceworkers/ServiceWorkerEvents.cpp
+++ b/dom/serviceworkers/ServiceWorkerEvents.cpp
@@ -26,7 +26,6 @@
#include "mozilla/dom/PromiseNativeHandler.h"
#include "mozilla/dom/PushEventBinding.h"
#include "mozilla/dom/PushMessageDataBinding.h"
-#include "mozilla/dom/PushUtil.h"
#include "mozilla/dom/Request.h"
#include "mozilla/dom/Response.h"
#include "mozilla/dom/ServiceWorkerOp.h"
diff --git a/dom/serviceworkers/ServiceWorkerOp.cpp b/dom/serviceworkers/ServiceWorkerOp.cpp
index 9c4fc569d1..2b11742c6c 100644
--- a/dom/serviceworkers/ServiceWorkerOp.cpp
+++ b/dom/serviceworkers/ServiceWorkerOp.cpp
@@ -278,8 +278,7 @@ class ServiceWorkerOp::ServiceWorkerOpRunnable final
ServiceWorkerOpRunnable(RefPtr<ServiceWorkerOp> aOwner,
WorkerPrivate* aWorkerPrivate)
- : WorkerDebuggeeRunnable(aWorkerPrivate, "ServiceWorkerOpRunnable",
- WorkerThread),
+ : WorkerDebuggeeRunnable("ServiceWorkerOpRunnable"),
mOwner(std::move(aOwner)) {
AssertIsOnMainThread();
MOZ_ASSERT(mOwner);
@@ -320,7 +319,7 @@ class ServiceWorkerOp::ServiceWorkerOpRunnable final
};
NS_IMPL_ISUPPORTS_INHERITED0(ServiceWorkerOp::ServiceWorkerOpRunnable,
- WorkerRunnable)
+ WorkerThreadRunnable)
bool ServiceWorkerOp::MaybeStart(RemoteWorkerChild* aOwner,
RemoteWorkerChild::State& aState) {
@@ -403,10 +402,11 @@ void ServiceWorkerOp::StartOnMainThread(RefPtr<RemoteWorkerChild>& aOwner) {
auto lock = aOwner->mState.Lock();
MOZ_ASSERT(lock->is<Running>());
- RefPtr<WorkerRunnable> workerRunnable =
+ RefPtr<WorkerThreadRunnable> workerRunnable =
GetRunnable(lock->as<Running>().mWorkerPrivate);
- if (NS_WARN_IF(!workerRunnable->Dispatch())) {
+ if (NS_WARN_IF(
+ !workerRunnable->Dispatch(lock->as<Running>().mWorkerPrivate))) {
RejectAll(NS_ERROR_FAILURE);
}
}
@@ -452,7 +452,7 @@ bool ServiceWorkerOp::IsTerminationOp() const {
ServiceWorkerOpArgs::TServiceWorkerTerminateWorkerOpArgs;
}
-RefPtr<WorkerRunnable> ServiceWorkerOp::GetRunnable(
+RefPtr<WorkerThreadRunnable> ServiceWorkerOp::GetRunnable(
WorkerPrivate* aWorkerPrivate) {
AssertIsOnMainThread();
MOZ_ASSERT(aWorkerPrivate);
@@ -522,7 +522,7 @@ class UpdateServiceWorkerStateOp final : public ServiceWorkerOp {
UpdateStateOpRunnable(RefPtr<UpdateServiceWorkerStateOp> aOwner,
WorkerPrivate* aWorkerPrivate)
- : MainThreadWorkerControlRunnable(aWorkerPrivate),
+ : MainThreadWorkerControlRunnable("UpdateStateOpRunnable"),
mOwner(std::move(aOwner)) {
AssertIsOnMainThread();
MOZ_ASSERT(mOwner);
@@ -559,7 +559,8 @@ class UpdateServiceWorkerStateOp final : public ServiceWorkerOp {
~UpdateServiceWorkerStateOp() = default;
- RefPtr<WorkerRunnable> GetRunnable(WorkerPrivate* aWorkerPrivate) override {
+ RefPtr<WorkerThreadRunnable> GetRunnable(
+ WorkerPrivate* aWorkerPrivate) override {
AssertIsOnMainThread();
MOZ_ASSERT(aWorkerPrivate);
MOZ_ASSERT(mArgs.type() ==
diff --git a/dom/serviceworkers/ServiceWorkerOp.h b/dom/serviceworkers/ServiceWorkerOp.h
index d485f6f210..3d872a00e5 100644
--- a/dom/serviceworkers/ServiceWorkerOp.h
+++ b/dom/serviceworkers/ServiceWorkerOp.h
@@ -62,7 +62,8 @@ class ServiceWorkerOp : public RemoteWorkerChild::Op {
bool IsTerminationOp() const;
// Override to provide a runnable that's not a `ServiceWorkerOpRunnable.`
- virtual RefPtr<WorkerRunnable> GetRunnable(WorkerPrivate* aWorkerPrivate);
+ virtual RefPtr<WorkerThreadRunnable> GetRunnable(
+ WorkerPrivate* aWorkerPrivate);
// Overridden by ServiceWorkerOp subclasses, it should return true when
// the ServiceWorkerOp was executed successfully (and false if it did fail).
diff --git a/dom/serviceworkers/test/gtest/TestReadWrite.cpp b/dom/serviceworkers/test/gtest/TestReadWrite.cpp
index 66b966f9e2..8c8dcc3810 100644
--- a/dom/serviceworkers/test/gtest/TestReadWrite.cpp
+++ b/dom/serviceworkers/test/gtest/TestReadWrite.cpp
@@ -25,15 +25,10 @@ using namespace mozilla::ipc;
class ServiceWorkerRegistrarTest : public ServiceWorkerRegistrar {
public:
ServiceWorkerRegistrarTest() {
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
nsresult rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR,
getter_AddRefs(mProfileDir));
- MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
-#else
- NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR,
- getter_AddRefs(mProfileDir));
-#endif
- MOZ_DIAGNOSTIC_ASSERT(mProfileDir);
+ MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
+ MOZ_RELEASE_ASSERT(mProfileDir);
}
nsresult TestReadData() { return ReadData(); }
diff --git a/dom/serviceworkers/test/test_serviceworker_interfaces.js b/dom/serviceworkers/test/test_serviceworker_interfaces.js
index c13c228d71..74dc6db488 100644
--- a/dom/serviceworkers/test/test_serviceworker_interfaces.js
+++ b/dom/serviceworkers/test/test_serviceworker_interfaces.js
@@ -40,6 +40,7 @@ let wasmGlobalInterfaces = [
{ name: "Function", insecureContext: true, nightly: true },
{ name: "Exception", insecureContext: true },
{ name: "Tag", insecureContext: true },
+ { name: "JSTag", insecureContext: true, earlyBetaOrEarlier: true },
{ name: "compile", insecureContext: true },
{ name: "compileStreaming", insecureContext: true },
{ name: "instantiate", insecureContext: true },