Issue #2402 - Don't call WorkerPrivate::WorkerName() to get service worker scope. https://bugzilla.mozilla.org/show_bug.cgi?id=1350433

This commit is contained in:
Brian Smith 2024-01-07 07:34:05 -06:00 committed by roytam1
commit 5202c08cfb
5 changed files with 14 additions and 7 deletions

View file

@ -550,7 +550,7 @@ private:
RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
if (swm) {
swm->HandleError(aCx, aWorkerPrivate->GetPrincipal(),
aWorkerPrivate->WorkerName(),
aWorkerPrivate->ServiceWorkerScope(),
aWorkerPrivate->ScriptURL(),
EmptyString(), EmptyString(), EmptyString(),
0, 0, JSREPORT_ERROR, JSEXN_ERR);
@ -1255,7 +1255,7 @@ private:
RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
if (swm) {
swm->HandleError(aCx, aWorkerPrivate->GetPrincipal(),
aWorkerPrivate->WorkerName(),
aWorkerPrivate->ServiceWorkerScope(),
aWorkerPrivate->ScriptURL(),
mReport.mMessage,
mReport.mFilename, mReport.mLine, mReport.mLineNumber,
@ -6727,7 +6727,7 @@ WorkerPrivate::GetOrCreateGlobalScope(JSContext* aCx)
if (IsSharedWorker()) {
globalScope = new SharedWorkerGlobalScope(this, WorkerName());
} else if (IsServiceWorker()) {
globalScope = new ServiceWorkerGlobalScope(this, WorkerName());
globalScope = new ServiceWorkerGlobalScope(this, ServiceWorkerScope());
} else {
globalScope = new DedicatedWorkerGlobalScope(this);
}