tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit ce8566cc91bfa00fd9ec26208c3d0d1b299e5b89
parent f388efa30e9c2d42d2b8e50c32eacf1dbe6d747e
Author: Lando <lando@lando.test>
Date:   Wed,  5 Nov 2025 10:33:44 +0000

Merge mozilla-central to autoland

Diffstat:
Mbuild/moz.configure/toolchain.configure | 2+-
Mdom/serviceworkers/IPCServiceWorkerDescriptor.ipdlh | 3---
Mdom/serviceworkers/IPCServiceWorkerRegistrationDescriptor.ipdlh | 4+---
Mdom/serviceworkers/PServiceWorkerContainer.ipdl | 7+++----
Mdom/serviceworkers/ServiceWorker.cpp | 2+-
Mdom/serviceworkers/ServiceWorkerContainer.cpp | 2+-
Mdom/serviceworkers/ServiceWorkerContainerParent.cpp | 4++--
Mdom/serviceworkers/ServiceWorkerContainerParent.h | 2+-
Mdom/serviceworkers/ServiceWorkerContainerProxy.cpp | 8+++-----
Mdom/serviceworkers/ServiceWorkerContainerProxy.h | 2+-
Mdom/serviceworkers/ServiceWorkerDescriptor.cpp | 10+++-------
Mdom/serviceworkers/ServiceWorkerDescriptor.h | 7++-----
Mdom/serviceworkers/ServiceWorkerIPCUtils.h | 1-
Mdom/serviceworkers/ServiceWorkerInfo.cpp | 15++++++++-------
Mdom/serviceworkers/ServiceWorkerInfo.h | 5++---
Mdom/serviceworkers/ServiceWorkerManager.cpp | 40+++++++++++++++++-----------------------
Mdom/serviceworkers/ServiceWorkerManager.h | 7+++----
Mdom/serviceworkers/ServiceWorkerPrivate.cpp | 6+-----
Mdom/serviceworkers/ServiceWorkerRegisterJob.cpp | 20+++++++-------------
Mdom/serviceworkers/ServiceWorkerRegisterJob.h | 4+---
Mdom/serviceworkers/ServiceWorkerRegistrar.cpp | 114+++++++++++++++++++++++++++++++++++--------------------------------------------
Mdom/serviceworkers/ServiceWorkerRegistrar.h | 2+-
Mdom/serviceworkers/ServiceWorkerRegistrarTypes.ipdlh | 9---------
Mdom/serviceworkers/ServiceWorkerRegistrationDescriptor.cpp | 18++++--------------
Mdom/serviceworkers/ServiceWorkerRegistrationDescriptor.h | 11++---------
Mdom/serviceworkers/ServiceWorkerRegistrationInfo.cpp | 19+++++++------------
Mdom/serviceworkers/ServiceWorkerRegistrationInfo.h | 10+++-------
Mdom/serviceworkers/ServiceWorkerScriptCache.cpp | 9++++-----
Mdom/serviceworkers/ServiceWorkerUpdateJob.cpp | 5++---
Mdom/serviceworkers/test/gtest/TestReadWrite.cpp | 35++++++++++++++---------------------
Mdom/webidl/ServiceWorkerContainer.webidl | 1-
Mdom/workers/ScriptLoader.cpp | 5-----
Mdom/workers/loader/NetworkLoadHandler.cpp | 30+++++++++++++-----------------
Mdom/workers/loader/WorkerModuleLoader.cpp | 5-----
Mdom/workers/loader/WorkerModuleLoader.h | 2--
Mjs/loader/ModuleLoaderBase.cpp | 16+---------------
Mjs/loader/ModuleLoaderBase.h | 2--
Mnetwerk/protocol/http/HttpBaseChannel.cpp | 11-----------
Mpython/mozbuild/mozbuild/test/configure/macos_fake_sdk/SDKSettings.plist | 2+-
Mtaskcluster/kinds/openh264-plugin/kind.yml | 4++--
Mtaskcluster/kinds/toolchain/macos-sdk.yml | 16++++++++--------
Mtaskcluster/kinds/toolchain/misc.yml | 4++--
Mtaskcluster/scripts/misc/build-cpython.sh | 2+-
Mtaskcluster/scripts/misc/build-custom-car.sh | 2+-
Mtaskcluster/scripts/misc/build-geckodriver.sh | 2+-
Mtaskcluster/scripts/misc/build-gn-macosx.sh | 2+-
Mtaskcluster/scripts/misc/build-llvm-common.sh | 4++--
Mtaskcluster/scripts/misc/build-nasm.sh | 4++--
Mtaskcluster/scripts/misc/build-pkgconf.sh | 4++--
Mtaskcluster/scripts/misc/build-rust-based-toolchain.sh | 2+-
Mtesting/mozharness/configs/openh264/macosx64-aarch64.py | 4++--
Mtesting/mozharness/configs/openh264/macosx64.py | 4++--
Mtesting/web-platform/meta/html/cross-origin-embedder-policy/reflection-credentialless.tentative.https.any.js.ini | 3+--
Mtesting/web-platform/meta/html/cross-origin-embedder-policy/reflection-require-corp.tentative.https.any.js.ini | 3+--
Mtesting/web-platform/meta/html/cross-origin-embedder-policy/reflection-unsafe-none.tentative.https.any.js.ini | 3+--
Mtesting/web-platform/meta/html/semantics/scripting-1/the-script-element/json-module/json-module-service-worker-test.https.html.ini | 6++----
Mtesting/web-platform/meta/html/semantics/scripting-1/the-script-element/module/import-meta/import-meta-object.any.js.ini | 2++
Mtesting/web-platform/meta/html/semantics/scripting-1/the-script-element/module/import-meta/import-meta-resolve.any.js.ini | 5+++++
Mtesting/web-platform/meta/html/semantics/scripting-1/the-script-element/module/import-meta/import-meta-url.any.js.ini | 4+---
Mtesting/web-platform/meta/infrastructure/server/context.any.js.ini | 3+--
Atesting/web-platform/meta/service-workers/service-worker/no-dynamic-import-in-module.any.js.ini | 4++++
Atesting/web-platform/meta/service-workers/service-worker/registration-scope-module-static-import.https.html.ini | 9+++++++++
Mtesting/web-platform/meta/service-workers/service-worker/registration-script-module.https.html.ini | 3+--
Mtesting/web-platform/meta/service-workers/service-worker/registration-script.https.html.ini | 4++--
Mtesting/web-platform/meta/service-workers/service-worker/update-bytecheck-cors-import.https.html.ini | 11+++++++++++
Mtesting/web-platform/meta/service-workers/service-worker/update-bytecheck.https.html.ini | 11+++++++++--
Mtesting/web-platform/meta/service-workers/service-worker/update-registration-with-type.https.html.ini | 6++++++
Mtesting/web-platform/tests/infrastructure/metadata/infrastructure/server/context.any.js.ini | 6+++---
Mtesting/web-platform/tests/service-workers/service-worker/resources/registration-tests-script.js | 8++++----
69 files changed, 251 insertions(+), 351 deletions(-)

diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure @@ -233,7 +233,7 @@ with only_when(host_is_osx | target_is_osx): ) def mac_sdk_min_version(): - return "26.0" + return "26.1" @depends( "--with-macos-sdk", diff --git a/dom/serviceworkers/IPCServiceWorkerDescriptor.ipdlh b/dom/serviceworkers/IPCServiceWorkerDescriptor.ipdlh @@ -5,10 +5,8 @@ include PBackgroundSharedTypes; include "mozilla/dom/ServiceWorkerIPCUtils.h"; -include "mozilla/dom/WorkerIPCUtils.h"; using mozilla::dom::ServiceWorkerState from "mozilla/dom/ServiceWorkerBinding.h"; -using mozilla::dom::WorkerType from "mozilla/dom/WorkerBinding.h"; namespace mozilla { namespace dom { @@ -23,7 +21,6 @@ namespace dom { uint64_t registrationVersion; PrincipalInfo principalInfo; nsCString scope; - WorkerType type; nsCString scriptURL; ServiceWorkerState state; bool handlesFetch; diff --git a/dom/serviceworkers/IPCServiceWorkerRegistrationDescriptor.ipdlh b/dom/serviceworkers/IPCServiceWorkerRegistrationDescriptor.ipdlh @@ -7,11 +7,9 @@ include IPCServiceWorkerDescriptor; include "ipc/ErrorIPCUtils.h"; include "mozilla/dom/ServiceWorkerIPCUtils.h"; -include "mozilla/dom/WorkerIPCUtils.h"; using mozilla::dom::ServiceWorkerUpdateViaCache from "mozilla/dom/ServiceWorkerRegistrationBinding.h"; using mozilla::CopyableErrorResult from "mozilla/ErrorResult.h"; -using mozilla::dom::WorkerType from "mozilla/dom/WorkerBinding.h"; namespace mozilla { namespace dom { @@ -31,7 +29,7 @@ namespace dom { // worker is installed yet, etc. PrincipalInfo principalInfo; nsCString scope; - WorkerType type; + ServiceWorkerUpdateViaCache updateViaCache; IPCServiceWorkerDescriptor? installing; diff --git a/dom/serviceworkers/PServiceWorkerContainer.ipdl b/dom/serviceworkers/PServiceWorkerContainer.ipdl @@ -6,9 +6,8 @@ include protocol PBackground; include ClientIPCTypes; include IPCServiceWorkerRegistrationDescriptor; -include "mozilla/dom/WorkerIPCUtils.h"; -using mozilla::dom::WorkerType from "mozilla/dom/WorkerBinding.h"; +include "mozilla/dom/ServiceWorkerIPCUtils.h"; namespace mozilla { namespace dom { @@ -19,8 +18,8 @@ protocol PServiceWorkerContainer manager PBackground; parent: - async Register(IPCClientInfo aClientInfo, nsCString aScopeURL, WorkerType aType, - nsCString aScriptURL, ServiceWorkerUpdateViaCache aUpdateViaCache) + async Register(IPCClientInfo aClientInfo, nsCString aScopeURL, nsCString aScriptURL, + ServiceWorkerUpdateViaCache aUpdateViaCache) returns (IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult aResult); async GetRegistration(IPCClientInfo aClientInfo, nsCString aURL) diff --git a/dom/serviceworkers/ServiceWorker.cpp b/dom/serviceworkers/ServiceWorker.cpp @@ -85,7 +85,7 @@ ServiceWorker::ServiceWorker(nsIGlobalObject* aGlobal, RefPtr<ServiceWorkerRegistration> reg = aGlobal->GetServiceWorkerRegistration(ServiceWorkerRegistrationDescriptor( mDescriptor.RegistrationId(), mDescriptor.RegistrationVersion(), - mDescriptor.PrincipalInfo(), mDescriptor.Scope(), mDescriptor.Type(), + mDescriptor.PrincipalInfo(), mDescriptor.Scope(), ServiceWorkerUpdateViaCache::Imports)); if (reg) { diff --git a/dom/serviceworkers/ServiceWorkerContainer.cpp b/dom/serviceworkers/ServiceWorkerContainer.cpp @@ -318,7 +318,7 @@ already_AddRefed<Promise> ServiceWorkerContainer::Register( } mActor->SendRegister( - clientInfo.ref().ToIPC(), nsCString(cleanedScopeURL), aOptions.mType, + clientInfo.ref().ToIPC(), nsCString(cleanedScopeURL), nsCString(cleanedScriptURL), aOptions.mUpdateViaCache, [self, outer](const IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult& diff --git a/dom/serviceworkers/ServiceWorkerContainerParent.cpp b/dom/serviceworkers/ServiceWorkerContainerParent.cpp @@ -22,7 +22,7 @@ void ServiceWorkerContainerParent::ActorDestroy(ActorDestroyReason aReason) { IPCResult ServiceWorkerContainerParent::RecvRegister( const IPCClientInfo& aClientInfo, const nsACString& aScopeURL, - const WorkerType& aType, const nsACString& aScriptURL, + const nsACString& aScriptURL, const ServiceWorkerUpdateViaCache& aUpdateViaCache, RegisterResolver&& aResolver) { if (!mProxy) { @@ -31,7 +31,7 @@ IPCResult ServiceWorkerContainerParent::RecvRegister( } mProxy - ->Register(ClientInfo(aClientInfo), aScopeURL, aType, aScriptURL, + ->Register(ClientInfo(aClientInfo), aScopeURL, aScriptURL, aUpdateViaCache) ->Then( GetCurrentSerialEventTarget(), __func__, diff --git a/dom/serviceworkers/ServiceWorkerContainerParent.h b/dom/serviceworkers/ServiceWorkerContainerParent.h @@ -25,7 +25,7 @@ class ServiceWorkerContainerParent final mozilla::ipc::IPCResult RecvRegister( const IPCClientInfo& aClientInfo, const nsACString& aScopeURL, - const WorkerType& aType, const nsACString& aScriptURL, + const nsACString& aScriptURL, const ServiceWorkerUpdateViaCache& aUpdateViaCache, RegisterResolver&& aResolver) override; diff --git a/dom/serviceworkers/ServiceWorkerContainerProxy.cpp b/dom/serviceworkers/ServiceWorkerContainerProxy.cpp @@ -42,8 +42,7 @@ void ServiceWorkerContainerProxy::RevokeActor( RefPtr<ServiceWorkerRegistrationPromise> ServiceWorkerContainerProxy::Register( const ClientInfo& aClientInfo, const nsACString& aScopeURL, - const WorkerType& aType, const nsACString& aScriptURL, - ServiceWorkerUpdateViaCache aUpdateViaCache) { + const nsACString& aScriptURL, ServiceWorkerUpdateViaCache aUpdateViaCache) { AssertIsOnBackgroundThread(); RefPtr<ServiceWorkerRegistrationPromise::Private> promise = @@ -51,7 +50,7 @@ RefPtr<ServiceWorkerRegistrationPromise> ServiceWorkerContainerProxy::Register( nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction( __func__, - [aClientInfo, aScopeURL = nsCString(aScopeURL), aType, + [aClientInfo, aScopeURL = nsCString(aScopeURL), aScriptURL = nsCString(aScriptURL), aUpdateViaCache, promise]() mutable { auto scopeExit = MakeScopeExit( [&] { promise->Reject(NS_ERROR_DOM_INVALID_STATE_ERR, __func__); }); @@ -59,8 +58,7 @@ RefPtr<ServiceWorkerRegistrationPromise> ServiceWorkerContainerProxy::Register( RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance(); NS_ENSURE_TRUE_VOID(swm); - swm->Register(aClientInfo, aScopeURL, aType, aScriptURL, - aUpdateViaCache) + swm->Register(aClientInfo, aScopeURL, aScriptURL, aUpdateViaCache) ->ChainTo(promise.forget(), __func__); scopeExit.release(); diff --git a/dom/serviceworkers/ServiceWorkerContainerProxy.h b/dom/serviceworkers/ServiceWorkerContainerProxy.h @@ -27,7 +27,7 @@ class ServiceWorkerContainerProxy final { RefPtr<ServiceWorkerRegistrationPromise> Register( const ClientInfo& aClientInfo, const nsACString& aScopeURL, - const WorkerType& aType, const nsACString& aScriptURL, + const nsACString& aScriptURL, ServiceWorkerUpdateViaCache aUpdateViaCache); RefPtr<ServiceWorkerRegistrationPromise> GetRegistration( diff --git a/dom/serviceworkers/ServiceWorkerDescriptor.cpp b/dom/serviceworkers/ServiceWorkerDescriptor.cpp @@ -8,7 +8,6 @@ #include "mozilla/dom/IPCServiceWorkerDescriptor.h" #include "mozilla/dom/ServiceWorkerBinding.h" -#include "mozilla/dom/WorkerBinding.h" #include "mozilla/ipc/PBackgroundSharedTypes.h" namespace mozilla::dom { @@ -18,7 +17,7 @@ using mozilla::ipc::PrincipalInfoToPrincipal; ServiceWorkerDescriptor::ServiceWorkerDescriptor( uint64_t aId, uint64_t aRegistrationId, uint64_t aRegistrationVersion, - nsIPrincipal* aPrincipal, const nsACString& aScope, WorkerType aType, + nsIPrincipal* aPrincipal, const nsACString& aScope, const nsACString& aScriptURL, ServiceWorkerState aState) : mData(MakeUnique<IPCServiceWorkerDescriptor>()) { MOZ_ALWAYS_SUCCEEDS( @@ -28,7 +27,6 @@ ServiceWorkerDescriptor::ServiceWorkerDescriptor( mData->registrationId() = aRegistrationId; mData->registrationVersion() = aRegistrationVersion; mData->scope() = aScope; - mData->type() = aType; mData->scriptURL() = aScriptURL; mData->state() = aState; // Set HandlesFetch as true in default @@ -38,10 +36,10 @@ ServiceWorkerDescriptor::ServiceWorkerDescriptor( ServiceWorkerDescriptor::ServiceWorkerDescriptor( uint64_t aId, uint64_t aRegistrationId, uint64_t aRegistrationVersion, const mozilla::ipc::PrincipalInfo& aPrincipalInfo, const nsACString& aScope, - WorkerType aType, const nsACString& aScriptURL, ServiceWorkerState aState) + const nsACString& aScriptURL, ServiceWorkerState aState) : mData(MakeUnique<IPCServiceWorkerDescriptor>( aId, aRegistrationId, aRegistrationVersion, aPrincipalInfo, - nsCString(aScriptURL), aType, nsCString(aScope), aState, true)) {} + nsCString(aScriptURL), nsCString(aScope), aState, true)) {} ServiceWorkerDescriptor::ServiceWorkerDescriptor( const IPCServiceWorkerDescriptor& aDescriptor) @@ -105,8 +103,6 @@ const nsCString& ServiceWorkerDescriptor::Scope() const { return mData->scope(); } -WorkerType ServiceWorkerDescriptor::Type() const { return mData->type(); } - const nsCString& ServiceWorkerDescriptor::ScriptURL() const { return mData->scriptURL(); } diff --git a/dom/serviceworkers/ServiceWorkerDescriptor.h b/dom/serviceworkers/ServiceWorkerDescriptor.h @@ -21,7 +21,6 @@ class PrincipalInfo; namespace dom { class IPCServiceWorkerDescriptor; -enum class WorkerType : uint8_t; enum class ServiceWorkerState : uint8_t; // This class represents a snapshot of a particular ServiceWorkerInfo object. @@ -38,13 +37,13 @@ class ServiceWorkerDescriptor final { ServiceWorkerDescriptor(uint64_t aId, uint64_t aRegistrationId, uint64_t aRegistrationVersion, nsIPrincipal* aPrincipal, const nsACString& aScope, - WorkerType aType, const nsACString& aScriptURL, + const nsACString& aScriptURL, ServiceWorkerState aState); ServiceWorkerDescriptor(uint64_t aId, uint64_t aRegistrationId, uint64_t aRegistrationVersion, const mozilla::ipc::PrincipalInfo& aPrincipalInfo, - const nsACString& aScope, WorkerType aType, + const nsACString& aScope, const nsACString& aScriptURL, ServiceWorkerState aState); @@ -75,8 +74,6 @@ class ServiceWorkerDescriptor final { const nsCString& Scope() const; - WorkerType Type() const; - const nsCString& ScriptURL() const; ServiceWorkerState State() const; diff --git a/dom/serviceworkers/ServiceWorkerIPCUtils.h b/dom/serviceworkers/ServiceWorkerIPCUtils.h @@ -14,7 +14,6 @@ #include "mozilla/dom/BindingIPCUtils.h" #include "mozilla/dom/ServiceWorkerBinding.h" #include "mozilla/dom/ServiceWorkerRegistrationBinding.h" -#include "mozilla/dom/WorkerBinding.h" namespace IPC { diff --git a/dom/serviceworkers/ServiceWorkerInfo.cpp b/dom/serviceworkers/ServiceWorkerInfo.cpp @@ -232,15 +232,16 @@ void ServiceWorkerInfo::UpdateState(ServiceWorkerState aState) { } } -ServiceWorkerInfo::ServiceWorkerInfo( - nsIPrincipal* aPrincipal, const nsACString& aScope, const WorkerType& aType, - uint64_t aRegistrationId, uint64_t aRegistrationVersion, - const nsACString& aScriptSpec, const nsAString& aCacheName, - nsLoadFlags aImportsLoadFlags) +ServiceWorkerInfo::ServiceWorkerInfo(nsIPrincipal* aPrincipal, + const nsACString& aScope, + uint64_t aRegistrationId, + uint64_t aRegistrationVersion, + const nsACString& aScriptSpec, + const nsAString& aCacheName, + nsLoadFlags aImportsLoadFlags) : mPrincipal(aPrincipal), mDescriptor(GetNextID(), aRegistrationId, aRegistrationVersion, - aPrincipal, aScope, aType, aScriptSpec, - ServiceWorkerState::Parsed), + aPrincipal, aScope, aScriptSpec, ServiceWorkerState::Parsed), mCacheName(aCacheName), mWorkerPrivateId(ComputeWorkerPrivateId()), mImportsLoadFlags(aImportsLoadFlags), diff --git a/dom/serviceworkers/ServiceWorkerInfo.h b/dom/serviceworkers/ServiceWorkerInfo.h @@ -91,7 +91,7 @@ class ServiceWorkerInfo final : public nsIServiceWorkerInfo { const nsCString& ScriptSpec() const { return mDescriptor.ScriptURL(); } const nsCString& Scope() const { return mDescriptor.Scope(); } - WorkerType Type() const { return mDescriptor.Type(); } + Maybe<ClientInfo> GetClientInfo(); // Pass-through of ServiceWorkerPrivate::GetLifetimeDeadline(); note that @@ -114,8 +114,7 @@ class ServiceWorkerInfo final : public nsIServiceWorkerInfo { } ServiceWorkerInfo(nsIPrincipal* aPrincipal, const nsACString& aScope, - const WorkerType& aType, uint64_t aRegistrationId, - uint64_t aRegistrationVersion, + uint64_t aRegistrationId, uint64_t aRegistrationVersion, const nsACString& aScriptSpec, const nsAString& aCacheName, nsLoadFlags aImportsLoadFlags); diff --git a/dom/serviceworkers/ServiceWorkerManager.cpp b/dom/serviceworkers/ServiceWorkerManager.cpp @@ -182,7 +182,6 @@ nsresult PopulateRegistrationData( } aData.scope() = aRegistration->Scope(); - aData.type() = aRegistration->Type(); // TODO: When bug 1426401 is implemented we will need to handle more // than just the active worker here. @@ -816,10 +815,8 @@ ServiceWorkerManager::RegisterForTest(nsIPrincipal* aPrincipal, auto scope = NS_ConvertUTF16toUTF8(aScopeURL); auto scriptURL = NS_ConvertUTF16toUTF8(aScriptURL); - auto regPromise = - Register(clientInfo.ref(), scope, WorkerType::Classic, scriptURL, - dom::ServiceWorkerUpdateViaCache::Imports); - + auto regPromise = Register(clientInfo.ref(), scope, scriptURL, + dom::ServiceWorkerUpdateViaCache::Imports); const RefPtr<ServiceWorkerManager> self(this); const nsCOMPtr<nsIPrincipal> principal(aPrincipal); regPromise->Then( @@ -847,8 +844,7 @@ ServiceWorkerManager::RegisterForTest(nsIPrincipal* aPrincipal, RefPtr<ServiceWorkerRegistrationPromise> ServiceWorkerManager::Register( const ClientInfo& aClientInfo, const nsACString& aScopeURL, - const WorkerType& aType, const nsACString& aScriptURL, - ServiceWorkerUpdateViaCache aUpdateViaCache) { + const nsACString& aScriptURL, ServiceWorkerUpdateViaCache aUpdateViaCache) { AUTO_PROFILER_MARKER_UNTYPED("SWM Register", DOM, {}); nsCOMPtr<nsIURI> scopeURI; @@ -901,7 +897,7 @@ RefPtr<ServiceWorkerRegistrationPromise> ServiceWorkerManager::Register( auto lifetime = DetermineLifetimeForClient(aClientInfo); RefPtr<ServiceWorkerRegisterJob> job = new ServiceWorkerRegisterJob( - principal, aScopeURL, aType, aScriptURL, + principal, aScopeURL, aScriptURL, static_cast<ServiceWorkerUpdateViaCache>(aUpdateViaCache), lifetime); job->AppendResultCallback(cb); @@ -1644,11 +1640,11 @@ void ServiceWorkerManager::LoadRegistration( RefPtr<ServiceWorkerRegistrationInfo> registration = GetRegistration(principal, aRegistration.scope()); if (!registration) { - registration = CreateNewRegistration( - aRegistration.scope(), aRegistration.type(), principal, - static_cast<ServiceWorkerUpdateViaCache>( - aRegistration.updateViaCache()), - aRegistration.navigationPreloadState()); + registration = + CreateNewRegistration(aRegistration.scope(), principal, + static_cast<ServiceWorkerUpdateViaCache>( + aRegistration.updateViaCache()), + aRegistration.navigationPreloadState()); } else { // If active worker script matches our expectations for a "current worker", // then we are done. Since scripts with the same URL might have different @@ -1673,9 +1669,9 @@ void ServiceWorkerManager::LoadRegistration( const nsCString& currentWorkerURL = aRegistration.currentWorkerURL(); if (!currentWorkerURL.IsEmpty()) { registration->SetActive(new ServiceWorkerInfo( - registration->Principal(), registration->Scope(), registration->Type(), - registration->Id(), registration->Version(), currentWorkerURL, - aRegistration.cacheName(), importsLoadFlags)); + registration->Principal(), registration->Scope(), registration->Id(), + registration->Version(), currentWorkerURL, aRegistration.cacheName(), + importsLoadFlags)); registration->GetActive()->SetHandlesFetch( aRegistration.currentWorkerHandlesFetch()); registration->GetActive()->SetInstalledTime( @@ -2939,10 +2935,9 @@ ServiceWorkerManager::RegisterForAddonPrincipal(nsIPrincipal* aPrincipal, return NS_OK; } - auto regPromise = Register(clientInfo.ref(), scope, WorkerType::Classic, - NS_ConvertUTF16toUTF8(scriptURL), - dom::ServiceWorkerUpdateViaCache::Imports); - + auto regPromise = + Register(clientInfo.ref(), scope, NS_ConvertUTF16toUTF8(scriptURL), + dom::ServiceWorkerUpdateViaCache::Imports); const RefPtr<ServiceWorkerManager> self(this); const nsCOMPtr<nsIPrincipal> principal(aPrincipal); regPromise->Then( @@ -3115,7 +3110,7 @@ ServiceWorkerManager::GetRegistration(const nsACString& aScopeKey, already_AddRefed<ServiceWorkerRegistrationInfo> ServiceWorkerManager::CreateNewRegistration( - const nsCString& aScope, const WorkerType& aType, nsIPrincipal* aPrincipal, + const nsCString& aScope, nsIPrincipal* aPrincipal, ServiceWorkerUpdateViaCache aUpdateViaCache, IPCNavigationPreloadState aNavigationPreloadState) { #ifdef DEBUG @@ -3130,8 +3125,7 @@ ServiceWorkerManager::CreateNewRegistration( #endif RefPtr<ServiceWorkerRegistrationInfo> registration = - new ServiceWorkerRegistrationInfo(aScope, aType, aPrincipal, - aUpdateViaCache, + new ServiceWorkerRegistrationInfo(aScope, aPrincipal, aUpdateViaCache, std::move(aNavigationPreloadState)); // From now on ownership of registration is with diff --git a/dom/serviceworkers/ServiceWorkerManager.h b/dom/serviceworkers/ServiceWorkerManager.h @@ -10,7 +10,6 @@ #include <cstdint> #include "ErrorList.h" -#include "ServiceWorkerDescriptor.h" #include "ServiceWorkerShutdownState.h" #include "js/ErrorReport.h" #include "mozilla/AlreadyAddRefed.h" @@ -177,7 +176,7 @@ class ServiceWorkerManager final : public nsIServiceWorkerManager, RefPtr<ServiceWorkerRegistrationPromise> Register( const ClientInfo& aClientInfo, const nsACString& aScopeURL, - const WorkerType& aType, const nsACString& aScriptURL, + const nsACString& aScriptURL, ServiceWorkerUpdateViaCache aUpdateViaCache); RefPtr<ServiceWorkerRegistrationPromise> GetRegistration( @@ -194,8 +193,8 @@ class ServiceWorkerManager final : public nsIServiceWorkerManager, const nsACString& aScope) const; already_AddRefed<ServiceWorkerRegistrationInfo> CreateNewRegistration( - const nsCString& aScope, const WorkerType& aType, - nsIPrincipal* aPrincipal, ServiceWorkerUpdateViaCache aUpdateViaCache, + const nsCString& aScope, nsIPrincipal* aPrincipal, + ServiceWorkerUpdateViaCache aUpdateViaCache, IPCNavigationPreloadState aNavigationPreloadState = IPCNavigationPreloadState(false, "true"_ns)); diff --git a/dom/serviceworkers/ServiceWorkerPrivate.cpp b/dom/serviceworkers/ServiceWorkerPrivate.cpp @@ -743,13 +743,9 @@ nsresult ServiceWorkerPrivate::Initialize() { mClientInfo->SetURL(mInfo->ScriptSpec()); mClientInfo->SetFrameType(FrameType::None); - WorkerOptions workerOptions; - workerOptions.mCredentials = RequestCredentials::Omit; - workerOptions.mType = mInfo->Type(); - mRemoteWorkerData = RemoteWorkerData( NS_ConvertUTF8toUTF16(mInfo->ScriptSpec()), baseScriptURL, baseScriptURL, - workerOptions, + WorkerOptions(), /* loading principal */ principalInfo, principalInfo, partitionedPrincipalInfo, /* useRegularPrincipal */ true, diff --git a/dom/serviceworkers/ServiceWorkerRegisterJob.cpp b/dom/serviceworkers/ServiceWorkerRegisterJob.cpp @@ -13,13 +13,12 @@ namespace mozilla::dom { ServiceWorkerRegisterJob::ServiceWorkerRegisterJob( - nsIPrincipal* aPrincipal, const nsACString& aScope, const WorkerType& aType, + nsIPrincipal* aPrincipal, const nsACString& aScope, const nsACString& aScriptSpec, ServiceWorkerUpdateViaCache aUpdateViaCache, const ServiceWorkerLifetimeExtension& aLifetimeExtension) : ServiceWorkerUpdateJob(Type::Register, aPrincipal, aScope, nsCString(aScriptSpec), aUpdateViaCache, - aLifetimeExtension), - mType(aType) {} + aLifetimeExtension) {} void ServiceWorkerRegisterJob::AsyncExecute() { MOZ_ASSERT(NS_IsMainThread()); @@ -36,23 +35,18 @@ void ServiceWorkerRegisterJob::AsyncExecute() { swm->GetRegistration(mPrincipal, mScope); if (registration) { - // if registration already exists, comparing it's options to see if - // they have been changed - bool sameOptions = - GetUpdateViaCache() == registration->GetUpdateViaCache() && - mType == registration->Type(); - - registration->SetOptions(GetUpdateViaCache(), mType); + bool sameUVC = GetUpdateViaCache() == registration->GetUpdateViaCache(); + registration->SetUpdateViaCache(GetUpdateViaCache()); RefPtr<ServiceWorkerInfo> newest = registration->Newest(); - if (newest && mScriptSpec.Equals(newest->ScriptSpec()) && sameOptions) { + if (newest && mScriptSpec.Equals(newest->ScriptSpec()) && sameUVC) { SetRegistration(registration); Finish(NS_OK); return; } } else { - registration = swm->CreateNewRegistration(mScope, mType, mPrincipal, - GetUpdateViaCache()); + registration = + swm->CreateNewRegistration(mScope, mPrincipal, GetUpdateViaCache()); if (!registration) { FailUpdateJob(NS_ERROR_DOM_ABORT_ERR); return; diff --git a/dom/serviceworkers/ServiceWorkerRegisterJob.h b/dom/serviceworkers/ServiceWorkerRegisterJob.h @@ -18,13 +18,11 @@ class ServiceWorkerRegisterJob final : public ServiceWorkerUpdateJob { public: ServiceWorkerRegisterJob( nsIPrincipal* aPrincipal, const nsACString& aScope, - const WorkerType& aType, const nsACString& aScriptSpec, + const nsACString& aScriptSpec, ServiceWorkerUpdateViaCache aUpdateViaCache, const ServiceWorkerLifetimeExtension& aLifetimeExtension); private: - WorkerType mType; - // Implement the Register algorithm steps and then call the parent class // Update() to complete the job execution. virtual void AsyncExecute() override; diff --git a/dom/serviceworkers/ServiceWorkerRegistrar.cpp b/dom/serviceworkers/ServiceWorkerRegistrar.cpp @@ -49,7 +49,7 @@ namespace mozilla::dom { namespace { static const uint32_t gSupportedRegistrarVersions[] = { - SERVICEWORKERREGISTRAR_VERSION, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2}; + SERVICEWORKERREGISTRAR_VERSION, 10, 9, 8, 7, 6, 5, 4, 3, 2}; static const uint32_t kInvalidGeneration = static_cast<uint32_t>(-1); @@ -627,15 +627,43 @@ nsresult ServiceWorkerRegistrar::ReadData() { return NS_ERROR_FAILURE; \ } - // baseSchemaVersion represents the version where major schema changes - // happened and requires a different reading strategy as done below in the - // switch statement. Version 9 is the latest major schema version, versions - // 10 and 11 are just extensions to version 9 and that's why gets processed - // under the same block. - auto baseSchemaVersion = version >= 9 ? 9 : version; - nsAutoCString line; - switch (baseSchemaVersion) { + switch (version) { + // to add new changes to the schema, + // we incremented SERVICEWORKERREGISTRAR_VERSION, + // added new changes on top of existing schema, + // and [[fallthrough]] to the previous one (version 10) + case SERVICEWORKERREGISTRAR_VERSION: { + nsAutoCString numberOfAttemptedActivationsStr; + GET_LINE(numberOfAttemptedActivationsStr); + int64_t numberOfAttemptedActivations = + numberOfAttemptedActivationsStr.ToInteger64(&rv); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + entry->mRegistration.numberOfAttemptedActivations() = + numberOfAttemptedActivations; + nsAutoCString isRegistrationBrokenStr; + GET_LINE(isRegistrationBrokenStr); + int64_t isBroken = isRegistrationBrokenStr.ToInteger64(&rv); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + entry->mRegistration.isBroken() = (isBroken != 0); + nsAutoCString cacheAPIIdStr; + GET_LINE(cacheAPIIdStr); + int64_t cacheAPIId = cacheAPIIdStr.ToInteger64(&rv); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + entry->mRegistration.cacheAPIId() = cacheAPIId; + + [[fallthrough]]; + } + + case 10: + [[fallthrough]]; + case 9: { rv = CreatePrincipalInfo(lineInputStream, entry->mRegistration); if (NS_WARN_IF(NS_FAILED(rv))) { @@ -705,6 +733,10 @@ nsresult ServiceWorkerRegistrar::ReadData() { GET_LINE(entry->mRegistration.navigationPreloadState().headerValue()); + // expando was introcuded in version 10 + // but block was placed in version 9, since + // the expando is placed at the end of data + // and we cannot read it in case 10 block if (version >= 10) { nsAutoCString expandoCountStr; GET_LINE(expandoCountStr); @@ -730,47 +762,6 @@ nsresult ServiceWorkerRegistrar::ReadData() { } } - if (version >= 11) { - nsAutoCString numberOfAttemptedActivationsStr; - GET_LINE(numberOfAttemptedActivationsStr); - int64_t numberOfAttemptedActivations = - numberOfAttemptedActivationsStr.ToInteger64(&rv); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - entry->mRegistration.numberOfAttemptedActivations() = - numberOfAttemptedActivations; - nsAutoCString isRegistrationBrokenStr; - GET_LINE(isRegistrationBrokenStr); - int64_t isBroken = isRegistrationBrokenStr.ToInteger64(&rv); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - entry->mRegistration.isBroken() = (isBroken != 0); - nsAutoCString cacheAPIIdStr; - GET_LINE(cacheAPIIdStr); - int64_t cacheAPIId = cacheAPIIdStr.ToInteger64(&rv); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - entry->mRegistration.cacheAPIId() = cacheAPIId; - } - - // if we are on latest version, get service worker type - if (version == SERVICEWORKERREGISTRAR_VERSION) { - nsAutoCString serviceWorkerTypeStr; - GET_LINE(serviceWorkerTypeStr); - uint32_t serviceWorkerType = - serviceWorkerTypeStr.ToUnsignedInteger(&rv); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - if (serviceWorkerType > static_cast<uint32_t>(WorkerType::Module)) { - return NS_ERROR_INVALID_ARG; - } - entry->mRegistration.type() = - static_cast<WorkerType>(serviceWorkerType); - } break; } @@ -1455,6 +1446,16 @@ nsresult ServiceWorkerRegistrar::WriteData( buffer.Truncate(); + buffer.AppendInt(static_cast<int32_t>( + data.mRegistration.numberOfAttemptedActivations())); + buffer.Append('\n'); + + buffer.AppendInt(static_cast<int32_t>(data.mRegistration.isBroken())); + buffer.Append('\n'); + + buffer.AppendInt(static_cast<int32_t>(data.mRegistration.cacheAPIId())); + buffer.Append('\n'); + buffer.Append(suffix.get()); buffer.Append('\n'); @@ -1513,19 +1514,6 @@ nsresult ServiceWorkerRegistrar::WriteData( buffer.Append('\n'); } - buffer.AppendInt(static_cast<int32_t>( - data.mRegistration.numberOfAttemptedActivations())); - buffer.Append('\n'); - - buffer.AppendInt(static_cast<int32_t>(data.mRegistration.isBroken())); - buffer.Append('\n'); - - buffer.AppendInt(static_cast<int32_t>(data.mRegistration.cacheAPIId())); - buffer.Append('\n'); - - buffer.AppendInt(static_cast<uint32_t>(data.mRegistration.type())); - buffer.Append('\n'); - buffer.AppendLiteral(SERVICEWORKERREGISTRAR_TERMINATOR); buffer.Append('\n'); diff --git a/dom/serviceworkers/ServiceWorkerRegistrar.h b/dom/serviceworkers/ServiceWorkerRegistrar.h @@ -17,7 +17,7 @@ #include "nsTArray.h" #define SERVICEWORKERREGISTRAR_FILE u"serviceworker.txt" -#define SERVICEWORKERREGISTRAR_VERSION 12 +#define SERVICEWORKERREGISTRAR_VERSION 11 #define SERVICEWORKERREGISTRAR_TERMINATOR "#" #define SERVICEWORKERREGISTRAR_TRUE "true" #define SERVICEWORKERREGISTRAR_FALSE "false" diff --git a/dom/serviceworkers/ServiceWorkerRegistrarTypes.ipdlh b/dom/serviceworkers/ServiceWorkerRegistrarTypes.ipdlh @@ -5,13 +5,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ include IPCNavigationPreloadState; -include "mozilla/dom/cache/IPCUtils.h"; -include "mozilla/dom/WorkerIPCUtils.h"; - -include IPCStream; - -using mozilla::dom::WorkerType - from "mozilla/dom/WorkerBinding.h"; include PBackgroundSharedTypes; namespace mozilla { @@ -23,8 +16,6 @@ struct ServiceWorkerRegistrationData bool isBroken; int64_t cacheAPIId; nsCString scope; - WorkerType type; - nsCString currentWorkerURL; bool currentWorkerHandlesFetch; diff --git a/dom/serviceworkers/ServiceWorkerRegistrationDescriptor.cpp b/dom/serviceworkers/ServiceWorkerRegistrationDescriptor.cpp @@ -30,8 +30,7 @@ ServiceWorkerRegistrationDescriptor::NewestInternal() const { ServiceWorkerRegistrationDescriptor::ServiceWorkerRegistrationDescriptor( uint64_t aId, uint64_t aVersion, nsIPrincipal* aPrincipal, - const nsACString& aScope, WorkerType aType, - ServiceWorkerUpdateViaCache aUpdateViaCache) + const nsACString& aScope, ServiceWorkerUpdateViaCache aUpdateViaCache) : mData(MakeUnique<IPCServiceWorkerRegistrationDescriptor>()) { MOZ_ALWAYS_SUCCEEDS( PrincipalToPrincipalInfo(aPrincipal, &mData->principalInfo())); @@ -39,7 +38,6 @@ ServiceWorkerRegistrationDescriptor::ServiceWorkerRegistrationDescriptor( mData->id() = aId; mData->version() = aVersion; mData->scope() = aScope; - mData->type() = aType; mData->updateViaCache() = aUpdateViaCache; mData->installing() = Nothing(); mData->waiting() = Nothing(); @@ -49,10 +47,10 @@ ServiceWorkerRegistrationDescriptor::ServiceWorkerRegistrationDescriptor( ServiceWorkerRegistrationDescriptor::ServiceWorkerRegistrationDescriptor( uint64_t aId, uint64_t aVersion, const mozilla::ipc::PrincipalInfo& aPrincipalInfo, const nsACString& aScope, - WorkerType aType, ServiceWorkerUpdateViaCache aUpdateViaCache) + ServiceWorkerUpdateViaCache aUpdateViaCache) : mData(MakeUnique<IPCServiceWorkerRegistrationDescriptor>( - aId, aVersion, aPrincipalInfo, nsCString(aScope), aType, - aUpdateViaCache, Nothing(), Nothing(), Nothing())) {} + aId, aVersion, aPrincipalInfo, nsCString(aScope), aUpdateViaCache, + Nothing(), Nothing(), Nothing())) {} ServiceWorkerRegistrationDescriptor::ServiceWorkerRegistrationDescriptor( const IPCServiceWorkerRegistrationDescriptor& aDescriptor) @@ -132,10 +130,6 @@ const nsCString& ServiceWorkerRegistrationDescriptor::Scope() const { return mData->scope(); } -WorkerType ServiceWorkerRegistrationDescriptor::Type() const { - return mData->type(); -} - Maybe<ServiceWorkerDescriptor> ServiceWorkerRegistrationDescriptor::GetInstalling() const { Maybe<ServiceWorkerDescriptor> result; @@ -242,10 +236,6 @@ void ServiceWorkerRegistrationDescriptor::SetUpdateViaCache( mData->updateViaCache() = aUpdateViaCache; } -void ServiceWorkerRegistrationDescriptor::SetWorkerType(WorkerType aType) { - mData->type() = aType; -} - void ServiceWorkerRegistrationDescriptor::SetWorkers( ServiceWorkerInfo* aInstalling, ServiceWorkerInfo* aWaiting, ServiceWorkerInfo* aActive) { diff --git a/dom/serviceworkers/ServiceWorkerRegistrationDescriptor.h b/dom/serviceworkers/ServiceWorkerRegistrationDescriptor.h @@ -9,7 +9,6 @@ #include "mozilla/Maybe.h" #include "mozilla/UniquePtr.h" #include "mozilla/dom/ServiceWorkerDescriptor.h" -#include "mozilla/dom/WorkerBinding.h" namespace mozilla { @@ -37,14 +36,12 @@ class ServiceWorkerRegistrationDescriptor final { public: ServiceWorkerRegistrationDescriptor( uint64_t aId, uint64_t aVersion, nsIPrincipal* aPrincipal, - const nsACString& aScope, WorkerType aType, - ServiceWorkerUpdateViaCache aUpdateViaCache); + const nsACString& aScope, ServiceWorkerUpdateViaCache aUpdateViaCache); ServiceWorkerRegistrationDescriptor( uint64_t aId, uint64_t aVersion, const mozilla::ipc::PrincipalInfo& aPrincipalInfo, - const nsACString& aScope, WorkerType aType, - ServiceWorkerUpdateViaCache aUpdateViaCache); + const nsACString& aScope, ServiceWorkerUpdateViaCache aUpdateViaCache); explicit ServiceWorkerRegistrationDescriptor( const IPCServiceWorkerRegistrationDescriptor& aDescriptor); @@ -77,8 +74,6 @@ class ServiceWorkerRegistrationDescriptor final { const nsCString& Scope() const; - WorkerType Type() const; - Maybe<ServiceWorkerDescriptor> GetInstalling() const; Maybe<ServiceWorkerDescriptor> GetWaiting() const; @@ -93,8 +88,6 @@ class ServiceWorkerRegistrationDescriptor final { void SetUpdateViaCache(ServiceWorkerUpdateViaCache aUpdateViaCache); - void SetWorkerType(WorkerType aType); - void SetWorkers(ServiceWorkerInfo* aInstalling, ServiceWorkerInfo* aWaiting, ServiceWorkerInfo* aActive); diff --git a/dom/serviceworkers/ServiceWorkerRegistrationInfo.cpp b/dom/serviceworkers/ServiceWorkerRegistrationInfo.cpp @@ -70,11 +70,11 @@ void ServiceWorkerRegistrationInfo::ClearAsCorrupt() { bool ServiceWorkerRegistrationInfo::IsCorrupt() const { return mCorrupt; } ServiceWorkerRegistrationInfo::ServiceWorkerRegistrationInfo( - const nsACString& aScope, WorkerType aType, nsIPrincipal* aPrincipal, + const nsACString& aScope, nsIPrincipal* aPrincipal, ServiceWorkerUpdateViaCache aUpdateViaCache, IPCNavigationPreloadState&& aNavigationPreloadState) : mPrincipal(aPrincipal), - mDescriptor(GetNextId(), GetNextVersion(), aPrincipal, aScope, aType, + mDescriptor(GetNextId(), GetNextVersion(), aPrincipal, aScope, aUpdateViaCache), mControlledClientsCounter(0), mDelayMultiplier(0), @@ -130,10 +130,6 @@ const nsCString& ServiceWorkerRegistrationInfo::Scope() const { return mDescriptor.Scope(); } -WorkerType ServiceWorkerRegistrationInfo::Type() const { - return mDescriptor.Type(); -} - nsIPrincipal* ServiceWorkerRegistrationInfo::Principal() const { return mPrincipal; } @@ -452,11 +448,11 @@ bool ServiceWorkerRegistrationInfo::IsLastUpdateCheckTimeOverOneDay() const { } void ServiceWorkerRegistrationInfo::UpdateRegistrationState() { - UpdateRegistrationState(mDescriptor.UpdateViaCache(), mDescriptor.Type()); + UpdateRegistrationState(mDescriptor.UpdateViaCache()); } void ServiceWorkerRegistrationInfo::UpdateRegistrationState( - ServiceWorkerUpdateViaCache aUpdateViaCache, WorkerType aType) { + ServiceWorkerUpdateViaCache aUpdateViaCache) { MOZ_ASSERT(NS_IsMainThread()); TimeStamp oldest = TimeStamp::Now() - TimeDuration::FromSeconds(30); @@ -478,7 +474,6 @@ void ServiceWorkerRegistrationInfo::UpdateRegistrationState( mDescriptor.SetWorkers(mInstallingWorker, mWaitingWorker, mActiveWorker); mDescriptor.SetUpdateViaCache(aUpdateViaCache); - mDescriptor.SetWorkerType(aType); for (RefPtr<ServiceWorkerRegistrationListener> pinnedTarget : mInstanceList.ForwardRange()) { @@ -769,9 +764,9 @@ ServiceWorkerUpdateViaCache ServiceWorkerRegistrationInfo::GetUpdateViaCache() return mDescriptor.UpdateViaCache(); } -void ServiceWorkerRegistrationInfo::SetOptions( - ServiceWorkerUpdateViaCache aUpdateViaCache, WorkerType aType) { - UpdateRegistrationState(aUpdateViaCache, aType); +void ServiceWorkerRegistrationInfo::SetUpdateViaCache( + ServiceWorkerUpdateViaCache aUpdateViaCache) { + UpdateRegistrationState(aUpdateViaCache); } int64_t ServiceWorkerRegistrationInfo::GetLastUpdateTime() const { diff --git a/dom/serviceworkers/ServiceWorkerRegistrationInfo.h b/dom/serviceworkers/ServiceWorkerRegistrationInfo.h @@ -81,7 +81,7 @@ class ServiceWorkerRegistrationInfo final using TryToActivateCallback = std::function<void()>; ServiceWorkerRegistrationInfo( - const nsACString& aScope, WorkerType aType, nsIPrincipal* aPrincipal, + const nsACString& aScope, nsIPrincipal* aPrincipal, ServiceWorkerUpdateViaCache aUpdateViaCache, IPCNavigationPreloadState&& aNavigationPreloadState); @@ -100,8 +100,6 @@ class ServiceWorkerRegistrationInfo final const nsCString& Scope() const; - WorkerType Type() const; - nsIPrincipal* Principal() const; bool IsUnregistered() const; @@ -225,8 +223,7 @@ class ServiceWorkerRegistrationInfo final ServiceWorkerUpdateViaCache GetUpdateViaCache() const; - void SetOptions(ServiceWorkerUpdateViaCache aUpdateViaCache, - WorkerType aType); + void SetUpdateViaCache(ServiceWorkerUpdateViaCache aUpdateViaCache); int64_t GetLastUpdateTime() const; @@ -260,8 +257,7 @@ class ServiceWorkerRegistrationInfo final // may get CC-ed. void UpdateRegistrationState(); - void UpdateRegistrationState(ServiceWorkerUpdateViaCache aUpdateViaCache, - WorkerType aType); + void UpdateRegistrationState(ServiceWorkerUpdateViaCache aUpdateViaCache); // Used by devtools to track changes to the properties of // *nsIServiceWorkerRegistrationInfo*. Note, this doesn't necessarily need to diff --git a/dom/serviceworkers/ServiceWorkerScriptCache.cpp b/dom/serviceworkers/ServiceWorkerScriptCache.cpp @@ -1080,14 +1080,13 @@ CompareNetwork::OnStreamComplete(nsIStreamLoader* aLoader, return rv; } - auto mimeTypeUTF16 = NS_ConvertUTF8toUTF16(mimeType); - if (mimeTypeUTF16.IsEmpty() || - !(nsContentUtils::IsJavascriptMIMEType(mimeTypeUTF16) || - nsContentUtils::IsJsonMimeType(mimeTypeUTF16))) { + if (mimeType.IsEmpty() || + !nsContentUtils::IsJavascriptMIMEType(NS_ConvertUTF8toUTF16(mimeType))) { ServiceWorkerManager::LocalizeAndReportToAllClients( mRegistration->Scope(), "ServiceWorkerRegisterMimeTypeError2", nsTArray<nsString>{NS_ConvertUTF8toUTF16(mRegistration->Scope()), - mimeTypeUTF16, NS_ConvertUTF8toUTF16(mURL)}); + NS_ConvertUTF8toUTF16(mimeType), + NS_ConvertUTF8toUTF16(mURL)}); rv = NS_ERROR_DOM_SECURITY_ERR; return rv; } diff --git a/dom/serviceworkers/ServiceWorkerUpdateJob.cpp b/dom/serviceworkers/ServiceWorkerUpdateJob.cpp @@ -418,9 +418,8 @@ void ServiceWorkerUpdateJob::ComparisonResult(nsresult aStatus, } RefPtr<ServiceWorkerInfo> sw = new ServiceWorkerInfo( - mRegistration->Principal(), mRegistration->Scope(), mRegistration->Type(), - mRegistration->Id(), mRegistration->Version(), mScriptSpec, aNewCacheName, - flags); + mRegistration->Principal(), mRegistration->Scope(), mRegistration->Id(), + mRegistration->Version(), mScriptSpec, aNewCacheName, flags); // If the registration is corrupt enough to force an uninstall if the // upgrade fails, then we want to make sure the upgrade takes effect diff --git a/dom/serviceworkers/test/gtest/TestReadWrite.cpp b/dom/serviceworkers/test/gtest/TestReadWrite.cpp @@ -233,6 +233,12 @@ TEST(ServiceWorkerRegistrar, TestReadData) buffer.AppendInt(static_cast<uint32_t>(SERVICEWORKERREGISTRAR_VERSION)); buffer.Append("\n"); + buffer.AppendInt(0); + buffer.AppendLiteral("\n"); + buffer.AppendInt(0); + buffer.AppendLiteral("\n"); + buffer.AppendInt(0); + buffer.AppendLiteral("\n"); buffer.AppendLiteral("^inBrowser=1\n"); buffer.AppendLiteral("https://scope_0.org\ncurrentWorkerURL 0\n"); buffer.Append(SERVICEWORKERREGISTRAR_TRUE "\n"); @@ -251,16 +257,14 @@ TEST(ServiceWorkerRegistrar, TestReadData) buffer.AppendLiteral("true\n"); buffer.AppendInt(0); buffer.AppendLiteral("\n"); + buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n"); + buffer.AppendInt(0); buffer.AppendLiteral("\n"); buffer.AppendInt(0); buffer.AppendLiteral("\n"); buffer.AppendInt(0); buffer.AppendLiteral("\n"); - buffer.AppendInt(0); - buffer.AppendLiteral("\n"); - buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n"); - buffer.AppendLiteral("\n"); buffer.AppendLiteral("https://scope_1.org\ncurrentWorkerURL 1\n"); buffer.Append(SERVICEWORKERREGISTRAR_FALSE "\n"); @@ -279,14 +283,6 @@ TEST(ServiceWorkerRegistrar, TestReadData) buffer.AppendLiteral("false\n"); buffer.AppendInt(0); buffer.AppendLiteral("\n"); - buffer.AppendInt(0); - buffer.AppendLiteral("\n"); - buffer.AppendInt(0); - buffer.AppendLiteral("\n"); - buffer.AppendInt(0); - buffer.AppendLiteral("\n"); - buffer.AppendInt(0); - buffer.AppendLiteral("\n"); buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n"); ASSERT_TRUE(CreateFile(buffer)) @@ -1026,7 +1022,6 @@ TEST(ServiceWorkerRegistrar, TestDedupeWrite) ServiceWorkerRegistrationData reg; reg.scope() = "https://scope_write.dedupe"_ns; - reg.type() = WorkerType::Classic; reg.currentWorkerURL() = nsPrintfCString("currentWorkerURL write %d", i); reg.currentWorkerHandlesFetch() = true; reg.cacheName() = @@ -1091,6 +1086,12 @@ TEST(ServiceWorkerRegistrar, TestLoadHandler) buffer.AppendInt(static_cast<uint32_t>(SERVICEWORKERREGISTRAR_VERSION)); buffer.Append("\n"); + buffer.AppendInt(0); + buffer.AppendLiteral("\n"); + buffer.AppendInt(0); + buffer.AppendLiteral("\n"); + buffer.AppendInt(0); + buffer.AppendLiteral("\n"); buffer.AppendLiteral("^inBrowser=1\n"); buffer.AppendLiteral("https://scope_0.org\ncurrentWorkerURL 0\n"); buffer.Append(SERVICEWORKERREGISTRAR_TRUE "\n"); @@ -1113,14 +1114,6 @@ TEST(ServiceWorkerRegistrar, TestLoadHandler) buffer.AppendLiteral("hello world!\n"); buffer.AppendLiteral("handler_test2\n"); buffer.AppendLiteral("hello\n"); - buffer.AppendInt(0); - buffer.AppendLiteral("\n"); - buffer.AppendInt(0); - buffer.AppendLiteral("\n"); - buffer.AppendInt(0); - buffer.AppendLiteral("\n"); - buffer.AppendInt(0); - buffer.AppendLiteral("\n"); buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n"); ASSERT_TRUE(CreateFile(buffer)) diff --git a/dom/webidl/ServiceWorkerContainer.webidl b/dom/webidl/ServiceWorkerContainer.webidl @@ -37,6 +37,5 @@ interface ServiceWorkerContainer : EventTarget { dictionary RegistrationOptions { USVString scope; - WorkerType type = "classic"; ServiceWorkerUpdateViaCache updateViaCache = "imports"; }; diff --git a/dom/workers/ScriptLoader.cpp b/dom/workers/ScriptLoader.cpp @@ -1146,11 +1146,6 @@ nsresult WorkerScriptLoader::FillCompileOptionsForRequest( aOptions->setSourceMapURL(aRequest->GetSourceMapURL().get()); } - // disable top-level await for module scripts - if (mWorkerRef->Private()->IsServiceWorker() && aRequest->IsModuleRequest()) { - aOptions->topLevelAwait = false; - } - return NS_OK; } diff --git a/dom/workers/loader/NetworkLoadHandler.cpp b/dom/workers/loader/NetworkLoadHandler.cpp @@ -309,23 +309,19 @@ nsresult NetworkLoadHandler::PrepareForRequest(nsIRequest* aRequest) { nsAutoCString mimeType; channel->GetContentType(mimeType); - auto mimeTypeUTF16 = NS_ConvertUTF8toUTF16(mimeType); - if (!nsContentUtils::IsJavascriptMIMEType(mimeTypeUTF16)) { - // JSON is allowed as a non-toplevel. - if (loadContext->IsTopLevel() || - !nsContentUtils::IsJsonMimeType(mimeTypeUTF16)) { - const nsCString& scope = mWorkerRef->Private() - ->GetServiceWorkerRegistrationDescriptor() - .Scope(); - - ServiceWorkerManager::LocalizeAndReportToAllClients( - scope, "ServiceWorkerRegisterMimeTypeError2", - nsTArray<nsString>{ - NS_ConvertUTF8toUTF16(scope), NS_ConvertUTF8toUTF16(mimeType), - NS_ConvertUTF8toUTF16(loadContext->mRequest->mURL)}); - - return NS_ERROR_DOM_NETWORK_ERR; - } + if (!nsContentUtils::IsJavascriptMIMEType( + NS_ConvertUTF8toUTF16(mimeType))) { + const nsCString& scope = mWorkerRef->Private() + ->GetServiceWorkerRegistrationDescriptor() + .Scope(); + + ServiceWorkerManager::LocalizeAndReportToAllClients( + scope, "ServiceWorkerRegisterMimeTypeError2", + nsTArray<nsString>{ + NS_ConvertUTF8toUTF16(scope), NS_ConvertUTF8toUTF16(mimeType), + NS_ConvertUTF8toUTF16(loadContext->mRequest->mURL)}); + + return NS_ERROR_DOM_NETWORK_ERR; } } diff --git a/dom/workers/loader/WorkerModuleLoader.cpp b/dom/workers/loader/WorkerModuleLoader.cpp @@ -128,11 +128,6 @@ bool WorkerModuleLoader::IsDynamicImportSupported() { return !workerPrivate->IsServiceWorker(); } -bool WorkerModuleLoader::IsForServiceWorker() const { - WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate(); - return workerPrivate && workerPrivate->IsServiceWorker(); -} - bool WorkerModuleLoader::CanStartLoad(ModuleLoadRequest* aRequest, nsresult* aRvOut) { return true; diff --git a/dom/workers/loader/WorkerModuleLoader.h b/dom/workers/loader/WorkerModuleLoader.h @@ -98,8 +98,6 @@ class WorkerModuleLoader : public JS::loader::ModuleLoaderBase { return aModuleType == JS::ModuleType::JavaScript || aModuleType == JS::ModuleType::JSON; } - - virtual bool IsForServiceWorker() const override; }; } // namespace mozilla::dom::workerinternals::loader diff --git a/js/loader/ModuleLoaderBase.cpp b/js/loader/ModuleLoaderBase.cpp @@ -1478,14 +1478,7 @@ nsresult ModuleLoaderBase::EvaluateModule(ModuleLoadRequest* aRequest) { mozilla::dom::AutoEntryScript aes(mGlobalObject, "EvaluateModule", NS_IsMainThread()); - // We would like to handle any evaluation errors synchronously for service - // workers immediately such that if we are performing service worker - // registration we can fail it right away rather than having it fail later on - // an event loop turn which might be too late and the registration process - // would have succeeded by then. - return EvaluateModuleInContext( - aes.cx(), aRequest, - IsForServiceWorker() ? ThrowModuleErrorsSync : ReportModuleErrorsAsync); + return EvaluateModuleInContext(aes.cx(), aRequest, ReportModuleErrorsAsync); } nsresult ModuleLoaderBase::EvaluateModuleInContext( @@ -1561,13 +1554,6 @@ nsresult ModuleLoaderBase::EvaluateModuleInContext( // If the promise is rejected, the value is unwrapped from the promise value. if (!ThrowOnModuleEvaluationFailure(aCx, evaluationPromise, errorBehaviour)) { LOG(("ScriptLoadRequest (%p): evaluation failed on throw", aRequest)); - - if (IsForServiceWorker()) { - // If this module eval is being done for service workers, then we would - // like to throw/return right from here, such that if we are in - // registration phase, we can fail it synchronously right away. - return NS_ERROR_ABORT; - } } // TODO: Bug 1973321: Prepare Bytecode encoding for dynamic import diff --git a/js/loader/ModuleLoaderBase.h b/js/loader/ModuleLoaderBase.h @@ -333,8 +333,6 @@ class ModuleLoaderBase : public nsISupports { virtual bool IsDynamicImportSupported() { return true; } - virtual bool IsForServiceWorker() const { return false; } - // Called when dynamic import started successfully. virtual void OnDynamicImportStarted(ModuleLoadRequest* aRequest) {} diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -3037,17 +3037,6 @@ nsresult EnsureMIMEOfScript(HttpBaseChannel* aChannel, nsIURI* aURI, return NS_OK; } - const auto internalPolicyType = aLoadInfo->InternalContentPolicyType(); - if (internalPolicyType == - nsIContentPolicy::TYPE_INTERNAL_WORKER_STATIC_MODULE && - nsContentUtils::IsJsonMimeType(typeString)) { - // script and json are both allowed - glean::http::script_block_incorrect_mime - .EnumGet(glean::http::ScriptBlockIncorrectMimeLabel::eTextJson) - .Add(); - return NS_OK; - } - switch (aLoadInfo->InternalContentPolicyType()) { case nsIContentPolicy::TYPE_SCRIPT: case nsIContentPolicy::TYPE_INTERNAL_SCRIPT: diff --git a/python/mozbuild/mozbuild/test/configure/macos_fake_sdk/SDKSettings.plist b/python/mozbuild/mozbuild/test/configure/macos_fake_sdk/SDKSettings.plist @@ -3,6 +3,6 @@ <plist version="1.0"> <dict> <key>Version</key> - <string>26.0</string> + <string>26.1</string> </dict> </plist> diff --git a/taskcluster/kinds/openh264-plugin/kind.yml b/taskcluster/kinds/openh264-plugin/kind.yml @@ -125,7 +125,7 @@ tasks: - linux64-clang - linux64-dump_syms - linux64-nasm - - macosx64-sdk-26.0 + - macosx64-sdk-26.1 macosx64-aarch64/opt: attributes: build_platform: macosx64-aarch64 @@ -149,7 +149,7 @@ tasks: - linux64-cctools-port - linux64-clang - linux64-dump_syms - - macosx64-sdk-26.0 + - macosx64-sdk-26.1 win32/opt: attributes: build_platform: win32 diff --git a/taskcluster/kinds/toolchain/macos-sdk.yml b/taskcluster/kinds/toolchain/macos-sdk.yml @@ -30,20 +30,20 @@ macosx64-sdk-13.3: - Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk toolchain-artifact: project/gecko/mac-sdk/MacOSX13.3.sdk.tar.zst -macosx64-sdk-26.0: - description: "macOS 26.0 SDK" +macosx64-sdk-26.1: + description: "macOS 26.1 SDK" treeherder: - symbol: TM(sdk26.0) + symbol: TM(sdk26.1) run: arguments: - - https://swcdn.apple.com/content/downloads/27/62/093-35114-A_AAH24ZZQB5/yn87ru9qe9225m8hwq2ic3hjy5yc5vw7h9/CLTools_macOSNMOS_SDK.pkg - - d3286bd6d4dff1b12f1d0dab4816719e605a1bfb76af84575deec37b25fc4462d4fc1258aa43b138a557c4f9304e06740441b101eb367a4b5bd77200b0708c71 - - Library/Developer/CommandLineTools/SDKs/MacOSX26.0.sdk - toolchain-artifact: project/gecko/mac-sdk/MacOSX26.0.sdk.tar.zst + - https://swcdn.apple.com/content/downloads/22/09/093-00219-A_WIA1LP39TY/evbam2mb02xqr05ju9ddb95y8qil8kz9tm/CLTools_macOSNMOS_SDK.pkg + - f6a5f44b3652f5abdf7ad2602f54ad38774404f45264a4e70cfccc58b8b39aed2a89f74ef22c44bf932d0a55b062ebc3651f73fa06ff755ee5da53b9dcc62fba + - Library/Developer/CommandLineTools/SDKs/MacOSX26.1.sdk + toolchain-artifact: project/gecko/mac-sdk/MacOSX26.1.sdk.tar.zst toolchain-alias: - macosx64-sdk - macosx64-sdk-toolchain - - MacOSX26.0.sdk + - MacOSX26.1.sdk ios-sdk-18.4: description: "iPhoneOS18.4 SDK" diff --git a/taskcluster/kinds/toolchain/misc.yml b/taskcluster/kinds/toolchain/misc.yml @@ -256,7 +256,7 @@ macosx-custom-car: toolchain-artifact: public/build/car_macosx.tar.zst fetches: toolchain: - - MacOSX26.0.sdk + - MacOSX26.1.sdk macosx-arm64-custom-car: description: "Custom chromium-as-release build for mac (apple silicon)" @@ -292,7 +292,7 @@ macosx-arm64-custom-car: toolchain-artifact: public/build/car_macosx_arm.tar.zst fetches: toolchain: - - MacOSX26.0.sdk + - MacOSX26.1.sdk android-custom-car: description: "Custom chromium-as-release build for Android" diff --git a/taskcluster/scripts/misc/build-cpython.sh b/taskcluster/scripts/misc/build-cpython.sh @@ -37,7 +37,7 @@ case `uname -s` in esac # NOTE: both CFLAGS and CPPFLAGS need to be set here, otherwise # configure step fails. - sysroot_flags="-isysroot ${MOZ_FETCHES_DIR}/MacOSX26.0.sdk -mmacosx-version-min=${macosx_version_min}" + sysroot_flags="-isysroot ${MOZ_FETCHES_DIR}/MacOSX26.1.sdk -mmacosx-version-min=${macosx_version_min}" export CPPFLAGS="${sysroot_flags} -I${xz_prefix}/include" export CFLAGS=${sysroot_flags} export LDFLAGS="${LDFLAGS} ${sysroot_flags} -L${xz_prefix}/lib" diff --git a/taskcluster/scripts/misc/build-custom-car.sh b/taskcluster/scripts/misc/build-custom-car.sh @@ -60,7 +60,7 @@ fi # Logic for macosx64 if [[ $(uname -s) == "Darwin" ]]; then # Modify the config with fetched sdk path - export MACOS_SYSROOT="$MOZ_FETCHES_DIR/MacOSX26.0.sdk" + export MACOS_SYSROOT="$MOZ_FETCHES_DIR/MacOSX26.1.sdk" # Bug 1990712 & 1989676 # HACK: Create a stub DarwinBasic.modulemap to satisfy Ninja’s dependency graph. # This file does not exist in Command Line Tools SDKs. It seems only the full diff --git a/taskcluster/scripts/misc/build-geckodriver.sh b/taskcluster/scripts/misc/build-geckodriver.sh @@ -25,7 +25,7 @@ case "$TARGET" in # OSX cross builds are a bit harder *-apple-darwin) export PATH="$MOZ_FETCHES_DIR/clang/bin:$PATH" - RUSTFLAGS="-Clinker=$MOZ_FETCHES_DIR/clang/bin/clang++ -C link-arg=-isysroot -C link-arg=$MOZ_FETCHES_DIR/MacOSX26.0.sdk -C link-arg=-fuse-ld=lld -C link-arg=--target=$TARGET" + RUSTFLAGS="-Clinker=$MOZ_FETCHES_DIR/clang/bin/clang++ -C link-arg=-isysroot -C link-arg=$MOZ_FETCHES_DIR/MacOSX26.1.sdk -C link-arg=-fuse-ld=lld -C link-arg=--target=$TARGET" if test "$TARGET" = "aarch64-apple-darwin"; then export MACOSX_DEPLOYMENT_TARGET=11.0 else diff --git a/taskcluster/scripts/misc/build-gn-macosx.sh b/taskcluster/scripts/misc/build-gn-macosx.sh @@ -5,7 +5,7 @@ set -e -v WORKSPACE=$HOME/workspace -CROSS_SYSROOT=$MOZ_FETCHES_DIR/MacOSX26.0.sdk +CROSS_SYSROOT=$MOZ_FETCHES_DIR/MacOSX26.1.sdk export MACOSX_DEPLOYMENT_TARGET=10.15 export CC=$MOZ_FETCHES_DIR/clang/bin/clang diff --git a/taskcluster/scripts/misc/build-llvm-common.sh b/taskcluster/scripts/misc/build-llvm-common.sh @@ -39,11 +39,11 @@ case "$target" in -DCMAKE_LIPO=$MOZ_FETCHES_DIR/clang/bin/llvm-lipo -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_SYSTEM_VERSION=$MACOSX_DEPLOYMENT_TARGET - -DCMAKE_OSX_SYSROOT=$MOZ_FETCHES_DIR/MacOSX26.0.sdk + -DCMAKE_OSX_SYSROOT=$MOZ_FETCHES_DIR/MacOSX26.1.sdk -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld -DCMAKE_SHARED_LINKER_FLAGS=-fuse-ld=lld -DDARWIN_osx_ARCHS=$arch - -DDARWIN_osx_SYSROOT=$MOZ_FETCHES_DIR/MacOSX26.0.sdk + -DDARWIN_osx_SYSROOT=$MOZ_FETCHES_DIR/MacOSX26.1.sdk -DDARWIN_macosx_OVERRIDE_SDK_VERSION=11.0 -DDARWIN_osx_BUILTIN_ARCHS=$arch -DLLVM_DEFAULT_TARGET_TRIPLE=$target diff --git a/taskcluster/scripts/misc/build-nasm.sh b/taskcluster/scripts/misc/build-nasm.sh @@ -38,13 +38,13 @@ case "$1" in macosx64) export MACOSX_DEPLOYMENT_TARGET=10.15 TARGET=x86_64-apple-darwin - CC="clang -fuse-ld=lld --target=$TARGET -isysroot $MOZ_FETCHES_DIR/MacOSX26.0.sdk" + CC="clang -fuse-ld=lld --target=$TARGET -isysroot $MOZ_FETCHES_DIR/MacOSX26.1.sdk" EXE= ;; macosx64-aarch64) export MACOSX_DEPLOYMENT_TARGET=11.0 TARGET=aarch64-apple-darwin - CC="clang -fuse-ld=lld --target=$TARGET -isysroot $MOZ_FETCHES_DIR/MacOSX26.0.sdk" + CC="clang -fuse-ld=lld --target=$TARGET -isysroot $MOZ_FETCHES_DIR/MacOSX26.1.sdk" EXE= ;; *) diff --git a/taskcluster/scripts/misc/build-pkgconf.sh b/taskcluster/scripts/misc/build-pkgconf.sh @@ -21,13 +21,13 @@ aarch64-unknown-linux-gnu) x86_64-apple-darwin) export MACOSX_DEPLOYMENT_TARGET=10.15 TARGET=$1 - CC="clang --target=$TARGET -isysroot $MOZ_FETCHES_DIR/MacOSX26.0.sdk" + CC="clang --target=$TARGET -isysroot $MOZ_FETCHES_DIR/MacOSX26.1.sdk" EXE= ;; aarch64-apple-darwin) export MACOSX_DEPLOYMENT_TARGET=11.0 TARGET=$1 - CC="clang --target=$TARGET -isysroot $MOZ_FETCHES_DIR/MacOSX26.0.sdk" + CC="clang --target=$TARGET -isysroot $MOZ_FETCHES_DIR/MacOSX26.1.sdk" EXE= ;; x86_64-pc-windows-gnu) diff --git a/taskcluster/scripts/misc/build-rust-based-toolchain.sh b/taskcluster/scripts/misc/build-rust-based-toolchain.sh @@ -42,7 +42,7 @@ aarch64-unknown-linux-gnu) else export MACOSX_DEPLOYMENT_TARGET=10.15 fi - MACOS_SYSROOT=$MOZ_FETCHES_DIR/MacOSX26.0.sdk + MACOS_SYSROOT=$MOZ_FETCHES_DIR/MacOSX26.1.sdk export RUSTFLAGS="-Clinker=$MOZ_FETCHES_DIR/clang/bin/clang++ -C link-arg=-isysroot -C link-arg=$MACOS_SYSROOT -C link-arg=-fuse-ld=lld -C link-arg=--target=$TARGET $rust_lto_flags" export CC="$MOZ_FETCHES_DIR/clang/bin/clang" export CXX="$MOZ_FETCHES_DIR/clang/bin/clang++" diff --git a/testing/mozharness/configs/openh264/macosx64-aarch64.py b/testing/mozharness/configs/openh264/macosx64-aarch64.py @@ -22,14 +22,14 @@ config = { "partial_env": { "CFLAGS": ( "-target aarch64-apple-darwin -mcpu=apple-a12 " - "-isysroot {MOZ_FETCHES_DIR}/MacOSX26.0.sdk " + "-isysroot {MOZ_FETCHES_DIR}/MacOSX26.1.sdk " "-mmacosx-version-min=11.0".format( MOZ_FETCHES_DIR=os.environ["MOZ_FETCHES_DIR"] ) ), "LDFLAGS": ( "-target aarch64-apple-darwin -mcpu=apple-a12 " - "-isysroot {MOZ_FETCHES_DIR}/MacOSX26.0.sdk " + "-isysroot {MOZ_FETCHES_DIR}/MacOSX26.1.sdk " "-mmacosx-version-min=11.0".format( MOZ_FETCHES_DIR=os.environ["MOZ_FETCHES_DIR"] ) diff --git a/testing/mozharness/configs/openh264/macosx64.py b/testing/mozharness/configs/openh264/macosx64.py @@ -22,14 +22,14 @@ config = { "partial_env": { "CXXFLAGS": ( "-target x86_64-apple-darwin " - "-isysroot {MOZ_FETCHES_DIR}/MacOSX26.0.sdk " + "-isysroot {MOZ_FETCHES_DIR}/MacOSX26.1.sdk " "-mmacosx-version-min=10.12".format( MOZ_FETCHES_DIR=os.environ["MOZ_FETCHES_DIR"] ) ), "LDFLAGS": ( "-target x86_64-apple-darwin " - "-isysroot {MOZ_FETCHES_DIR}/MacOSX26.0.sdk " + "-isysroot {MOZ_FETCHES_DIR}/MacOSX26.1.sdk " "-mmacosx-version-min=10.12".format( MOZ_FETCHES_DIR=os.environ["MOZ_FETCHES_DIR"] ) diff --git a/testing/web-platform/meta/html/cross-origin-embedder-policy/reflection-credentialless.tentative.https.any.js.ini b/testing/web-platform/meta/html/cross-origin-embedder-policy/reflection-credentialless.tentative.https.any.js.ini @@ -24,5 +24,4 @@ [reflection-credentialless.tentative.https.any.serviceworker-module.html] - [reflection-credentialless] - expected: FAIL + expected: ERROR diff --git a/testing/web-platform/meta/html/cross-origin-embedder-policy/reflection-require-corp.tentative.https.any.js.ini b/testing/web-platform/meta/html/cross-origin-embedder-policy/reflection-require-corp.tentative.https.any.js.ini @@ -31,5 +31,4 @@ [reflection-require-corp.tentative.https.any.serviceworker-module.html] - [reflection-require-corp] - expected: FAIL + expected: ERROR diff --git a/testing/web-platform/meta/html/cross-origin-embedder-policy/reflection-unsafe-none.tentative.https.any.js.ini b/testing/web-platform/meta/html/cross-origin-embedder-policy/reflection-unsafe-none.tentative.https.any.js.ini @@ -26,5 +26,4 @@ [reflection-unsafe-none.tentative.https.any.serviceworker-module.html] - [reflection-unsafe-none] - expected: FAIL + expected: ERROR diff --git a/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/json-module/json-module-service-worker-test.https.html.ini b/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/json-module/json-module-service-worker-test.https.html.ini @@ -1,4 +1,3 @@ [json-module-service-worker-test.https.html] - # JSON module as a top-level is not throwing error, could be because of async script evaluation - [Trying to register a service worker with a top-level JSON Module should fail] - expected: FAIL -\ No newline at end of file + [Javascript importing JSON Module should load within the context of a service worker] + expected: FAIL diff --git a/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/import-meta/import-meta-object.any.js.ini b/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/import-meta/import-meta-object.any.js.ini @@ -0,0 +1,2 @@ +[import-meta-object.any.serviceworker-module.html] + expected: ERROR diff --git a/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/import-meta/import-meta-resolve.any.js.ini b/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/import-meta/import-meta-resolve.any.js.ini @@ -4,3 +4,8 @@ if not fission and (os == "linux"): CRASH [import-meta-resolve.any.sharedworker-module.html] + +[import-meta-resolve.any.serviceworker-module.html] + expected: + if tsan: TIMEOUT + ERROR diff --git a/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/import-meta/import-meta-url.any.js.ini b/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/import-meta/import-meta-url.any.js.ini @@ -11,6 +11,4 @@ if (os == "android") and not debug: [OK, CRASH] [import-meta-url.any.serviceworker-module.html] - expected: - if (os == "mac") and not debug: [OK, CRASH] - if (os == "android") and not debug: [OK, CRASH] + expected: ERROR diff --git a/testing/web-platform/meta/infrastructure/server/context.any.js.ini b/testing/web-platform/meta/infrastructure/server/context.any.js.ini @@ -1,8 +1,7 @@ [context.any.sharedworker-module.html] [context.any.serviceworker-module.html] - expected: - if (os == "android") and not debug: [OK, ERROR] + expected: ERROR [context.any.worker.html] expected: diff --git a/testing/web-platform/meta/service-workers/service-worker/no-dynamic-import-in-module.any.js.ini b/testing/web-platform/meta/service-workers/service-worker/no-dynamic-import-in-module.any.js.ini @@ -0,0 +1,4 @@ +[no-dynamic-import-in-module.any.serviceworker-module.html] + expected: + if (os == "android") and fission: [ERROR, TIMEOUT] + ERROR diff --git a/testing/web-platform/meta/service-workers/service-worker/registration-scope-module-static-import.https.html.ini b/testing/web-platform/meta/service-workers/service-worker/registration-scope-module-static-import.https.html.ini @@ -0,0 +1,9 @@ +[registration-scope-module-static-import.https.html] + [static imports redirecting to outside path restriction should be allowed] + expected: FAIL + + [static imports to outside path restriction should be allowed] + expected: FAIL + + [imported-module-script.js works when used as top-level] + expected: FAIL diff --git a/testing/web-platform/meta/service-workers/service-worker/registration-script-module.https.html.ini b/testing/web-platform/meta/service-workers/service-worker/registration-script-module.https.html.ini @@ -3,4 +3,4 @@ if (os == "mac") and not debug: [OK, TIMEOUT] [Registering script including caught exception] expected: - if (os == "mac") and not debug: [PASS, TIMEOUT] -\ No newline at end of file + if (os == "mac") and not debug: [PASS, TIMEOUT] diff --git a/testing/web-platform/meta/service-workers/service-worker/registration-script.https.html.ini b/testing/web-platform/meta/service-workers/service-worker/registration-script.https.html.ini @@ -17,7 +17,7 @@ expected: if (os == "android") and not debug: [PASS, TIMEOUT] - [Registering script including undefined error: classic] + [Registering script including undefined error] expected: if (os == "android") and not debug: [PASS, NOTRUN] @@ -25,6 +25,6 @@ expected: if (os == "android") and not debug: [PASS, NOTRUN] - [Registering script including uncaught exception: classic] + [Registering script including uncaught exception] expected: if (os == "android") and not debug: [PASS, NOTRUN] diff --git a/testing/web-platform/meta/service-workers/service-worker/update-bytecheck-cors-import.https.html.ini b/testing/web-platform/meta/service-workers/service-worker/update-bytecheck-cors-import.https.html.ini @@ -1,3 +1,14 @@ [update-bytecheck-cors-import.https.html] expected: if (os == "android") and debug: [OK, ERROR] + [Test module script(main: default, imported: default)] + expected: FAIL + + [Test module script(main: default, imported: time)] + expected: FAIL + + [Test module script(main: time, imported: default)] + expected: FAIL + + [Test module script(main: time, imported: time)] + expected: FAIL diff --git a/testing/web-platform/meta/service-workers/service-worker/update-bytecheck.https.html.ini b/testing/web-platform/meta/service-workers/service-worker/update-bytecheck.https.html.ini @@ -2,10 +2,17 @@ max-asserts: 2 expected: if (os == "android") and debug: [OK, ERROR] + [Test module script(main: default, imported: default)] + expected: FAIL + + [Test module script(main: default, imported: time)] + expected: FAIL [Test module script(main: time, imported: default)] - expected: - if (processor == "x86") and not debug: [PASS, FAIL] + expected: FAIL + + [Test module script(main: time, imported: time)] + expected: FAIL [Test(main: time, imported: default)] expected: diff --git a/testing/web-platform/meta/service-workers/service-worker/update-registration-with-type.https.html.ini b/testing/web-platform/meta/service-workers/service-worker/update-registration-with-type.https.html.ini @@ -1,4 +1,10 @@ [update-registration-with-type.https.html] + [Update the registration with a different script type (module => classic).] + expected: FAIL + + [Update the registration with a different script type (classic => module).] + expected: FAIL + [Update the registration with a different script type (classic => module) and with a same main script. Expect evaluation failed.] expected: FAIL diff --git a/testing/web-platform/tests/infrastructure/metadata/infrastructure/server/context.any.js.ini b/testing/web-platform/tests/infrastructure/metadata/infrastructure/server/context.any.js.ini @@ -4,9 +4,9 @@ if product == "epiphany" or product == "webkit": FAIL # https://bugs.webkit.org/show_bug.cgi?id=200815 [context.any.serviceworker-module.html] - [context] - expected: - if product == "epiphany" or product == "webkit": FAIL # https://bugs.webkit.org/show_bug.cgi?id=200815 + expected: + if product == "firefox": ERROR + if product == "firefox_android": ERROR [context.any.worker-module.html] diff --git a/testing/web-platform/tests/service-workers/service-worker/resources/registration-tests-script.js b/testing/web-platform/tests/service-workers/service-worker/resources/registration-tests-script.js @@ -30,21 +30,21 @@ function registration_tests_script(register_method, type) { promise_test(function(t) { var script = 'resources/malformed-worker.py?undefined-error'; - var scope = `resources/scope/undefined-error/${type}`; + var scope = 'resources/scope/undefined-error'; return promise_rejects_js(t, TypeError, register_method(script, {scope: scope}), 'Registration of script including undefined error should fail.'); - }, `Registering script including undefined error: ${type}`); + }, 'Registering script including undefined error'); promise_test(function(t) { var script = 'resources/malformed-worker.py?uncaught-exception'; - var scope = `resources/scope/uncaught-exception/${type}`; + var scope = 'resources/scope/uncaught-exception'; return promise_rejects_js(t, TypeError, register_method(script, {scope: scope}), 'Registration of script including uncaught exception should fail.'); - }, `Registering script including uncaught exception: ${type}`); + }, 'Registering script including uncaught exception'); if (type === 'classic') { promise_test(function(t) {