commit c8854f0a27252c5a22df63ffee8d8efb327f6e9c parent 10657554bc2492b3a866be5c3883b33cd04d0964 Author: Harveer Singh <hsingh@mozilla.com> Date: Wed, 29 Oct 2025 19:40:10 +0000 Bug 1360870: idl changes to support module service workers.r=asuth,edenchuang,webidl,smaug,dom-worker-reviewers Differential Revision: https://phabricator.services.mozilla.com/D264454 Diffstat:
5 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/dom/serviceworkers/IPCServiceWorkerDescriptor.ipdlh b/dom/serviceworkers/IPCServiceWorkerDescriptor.ipdlh @@ -5,8 +5,10 @@ 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 { @@ -21,6 +23,7 @@ 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,9 +7,11 @@ 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 { @@ -29,7 +31,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,8 +6,9 @@ include protocol PBackground; include ClientIPCTypes; include IPCServiceWorkerRegistrationDescriptor; +include "mozilla/dom/WorkerIPCUtils.h"; -include "mozilla/dom/ServiceWorkerIPCUtils.h"; +using mozilla::dom::WorkerType from "mozilla/dom/WorkerBinding.h"; namespace mozilla { namespace dom { @@ -18,8 +19,8 @@ protocol PServiceWorkerContainer manager PBackground; parent: - async Register(IPCClientInfo aClientInfo, nsCString aScopeURL, nsCString aScriptURL, - ServiceWorkerUpdateViaCache aUpdateViaCache) + async Register(IPCClientInfo aClientInfo, nsCString aScopeURL, WorkerType aType, + nsCString aScriptURL, ServiceWorkerUpdateViaCache aUpdateViaCache) returns (IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult aResult); async GetRegistration(IPCClientInfo aClientInfo, nsCString aURL) diff --git a/dom/serviceworkers/ServiceWorkerRegistrarTypes.ipdlh b/dom/serviceworkers/ServiceWorkerRegistrarTypes.ipdlh @@ -5,6 +5,13 @@ * 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 { @@ -16,6 +23,8 @@ struct ServiceWorkerRegistrationData bool isBroken; int64_t cacheAPIId; nsCString scope; + WorkerType type; + nsCString currentWorkerURL; bool currentWorkerHandlesFetch; diff --git a/dom/webidl/ServiceWorkerContainer.webidl b/dom/webidl/ServiceWorkerContainer.webidl @@ -37,5 +37,6 @@ interface ServiceWorkerContainer : EventTarget { dictionary RegistrationOptions { USVString scope; + WorkerType type = "classic"; ServiceWorkerUpdateViaCache updateViaCache = "imports"; };