From 71848c23a4d09bbb7eff1b27d2cb28904e35240d Mon Sep 17 00:00:00 2001 From: Moonchild Date: Fri, 24 Jul 2020 11:09:54 +0000 Subject: Issue #1587 Part 11 (followup 1): Implement multithreaded signals for workers. --- dom/workers/ScriptLoader.cpp | 2 +- dom/workers/ServiceWorkerPrivate.cpp | 2 +- dom/workers/ServiceWorkerScriptCache.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'dom/workers') diff --git a/dom/workers/ScriptLoader.cpp b/dom/workers/ScriptLoader.cpp index bcec94dcb..80e136384 100644 --- a/dom/workers/ScriptLoader.cpp +++ b/dom/workers/ScriptLoader.cpp @@ -694,7 +694,7 @@ private: ir->SetPrincipalInfo(Move(principalInfo)); RefPtr response = - new mozilla::dom::Response(mCacheCreator->Global(), ir); + new mozilla::dom::Response(mCacheCreator->Global(), ir, nullptr); mozilla::dom::RequestOrUSVString request; diff --git a/dom/workers/ServiceWorkerPrivate.cpp b/dom/workers/ServiceWorkerPrivate.cpp index 23ae3b366..571ceca37 100644 --- a/dom/workers/ServiceWorkerPrivate.cpp +++ b/dom/workers/ServiceWorkerPrivate.cpp @@ -1510,7 +1510,7 @@ private: if (NS_WARN_IF(!global)) { return false; } - RefPtr request = new Request(global, internalReq); + RefPtr request = new Request(global, internalReq, nullptr); MOZ_ASSERT_IF(internalReq->IsNavigationRequest(), request->Redirect() == RequestRedirect::Manual); diff --git a/dom/workers/ServiceWorkerScriptCache.cpp b/dom/workers/ServiceWorkerScriptCache.cpp index 707b689e8..3db58e694 100644 --- a/dom/workers/ServiceWorkerScriptCache.cpp +++ b/dom/workers/ServiceWorkerScriptCache.cpp @@ -554,7 +554,7 @@ private: ir->SetPrincipalInfo(Move(mPrincipalInfo)); } - RefPtr response = new Response(aCache->GetGlobalObject(), ir); + RefPtr response = new Response(aCache->GetGlobalObject(), ir, nullptr); RequestOrUSVString request; request.SetAsUSVString().Rebind(URL().Data(), URL().Length()); -- cgit v1.2.3 From 45db2388fe0fe11e522b15f8836308ef9301e949 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Wed, 29 Jul 2020 11:55:30 +0000 Subject: [dom] Fix a spec compliance issue with the HTML LS regarding script loading. This fixes a spec compliance issue with section 8.1.4.2 Fetching scripts. --- dom/workers/ScriptLoader.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'dom/workers') diff --git a/dom/workers/ScriptLoader.cpp b/dom/workers/ScriptLoader.cpp index 80e136384..8f2023609 100644 --- a/dom/workers/ScriptLoader.cpp +++ b/dom/workers/ScriptLoader.cpp @@ -1101,14 +1101,16 @@ private: rv = NS_GetFinalChannelURI(channel, getter_AddRefs(finalURI)); NS_ENSURE_SUCCESS(rv, rv); - nsCString filename; - rv = finalURI->GetSpec(filename); - NS_ENSURE_SUCCESS(rv, rv); + if (principal->Subsumes(channelPrincipal)) { + nsCString filename; + rv = finalURI->GetSpec(filename); + NS_ENSURE_SUCCESS(rv, rv); - if (!filename.IsEmpty()) { - // This will help callers figure out what their script url resolved to in - // case of errors. - aLoadInfo.mURL.Assign(NS_ConvertUTF8toUTF16(filename)); + if (!filename.IsEmpty()) { + // This will help callers figure out what their script url resolved to in + // case of errors. + aLoadInfo.mURL.Assign(NS_ConvertUTF8toUTF16(filename)); + } } nsCOMPtr chanLoadInfo = channel->GetLoadInfo(); -- cgit v1.2.3