IPCServiceWorkerRegistrationDescriptor.ipdlh (1958B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 include PBackgroundSharedTypes; 6 include IPCServiceWorkerDescriptor; 7 8 include "ipc/ErrorIPCUtils.h"; 9 include "mozilla/dom/ServiceWorkerIPCUtils.h"; 10 include "mozilla/dom/WorkerIPCUtils.h"; 11 12 using mozilla::dom::ServiceWorkerUpdateViaCache from "mozilla/dom/ServiceWorkerRegistrationBinding.h"; 13 using mozilla::CopyableErrorResult from "mozilla/ErrorResult.h"; 14 using mozilla::dom::WorkerType from "mozilla/dom/WorkerBinding.h"; 15 16 namespace mozilla { 17 namespace dom { 18 19 // IPC type with enough information to create a ServiceWorker DOM object 20 // in a child process. Note that the state may be slightly out-of-sync 21 // with the parent and should be updated dynamically if necessary. 22 [Comparable] struct IPCServiceWorkerRegistrationDescriptor 23 { 24 uint64_t id; 25 uint64_t version; 26 27 // These values should match the principal and scope in each 28 // associated worker. It may be possible to optimize in the future, 29 // but for now we duplicate the information here to ensure correctness. 30 // Its possible we may need to reference a registration before the 31 // worker is installed yet, etc. 32 PrincipalInfo principalInfo; 33 nsCString scope; 34 WorkerType type; 35 ServiceWorkerUpdateViaCache updateViaCache; 36 37 IPCServiceWorkerDescriptor? installing; 38 IPCServiceWorkerDescriptor? waiting; 39 IPCServiceWorkerDescriptor? active; 40 }; 41 42 union IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult 43 { 44 IPCServiceWorkerRegistrationDescriptor; 45 CopyableErrorResult; 46 }; 47 48 struct IPCServiceWorkerRegistrationDescriptorList 49 { 50 IPCServiceWorkerRegistrationDescriptor[] values; 51 }; 52 53 union IPCServiceWorkerRegistrationDescriptorListOrCopyableErrorResult 54 { 55 IPCServiceWorkerRegistrationDescriptorList; 56 CopyableErrorResult; 57 }; 58 59 } // namespace dom 60 } // namespace mozilla