Source code

Revision control

Other Tools

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
using ServiceWorkerUpdateViaCache from "mozilla/dom/ServiceWorkerIPCUtils.h";
9
using mozilla::CopyableErrorResult from "ipc/ErrorIPCUtils.h";
10
11
namespace mozilla {
12
namespace dom {
13
14
// IPC type with enough information to create a ServiceWorker DOM object
15
// in a child process. Note that the state may be slightly out-of-sync
16
// with the parent and should be updated dynamically if necessary.
17
struct IPCServiceWorkerRegistrationDescriptor
18
{
19
uint64_t id;
20
uint64_t version;
21
22
// These values should match the principal and scope in each
23
// associated worker. It may be possible to optimize in the future,
24
// but for now we duplicate the information here to ensure correctness.
25
// Its possible we may need to reference a registration before the
26
// worker is installed yet, etc.
27
PrincipalInfo principalInfo;
28
nsCString scope;
29
30
ServiceWorkerUpdateViaCache updateViaCache;
31
32
IPCServiceWorkerDescriptor? installing;
33
IPCServiceWorkerDescriptor? waiting;
34
IPCServiceWorkerDescriptor? active;
35
};
36
37
union IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult
38
{
39
IPCServiceWorkerRegistrationDescriptor;
40
CopyableErrorResult;
41
};
42
43
struct IPCServiceWorkerRegistrationDescriptorList
44
{
45
IPCServiceWorkerRegistrationDescriptor[] values;
46
};
47
48
union IPCServiceWorkerRegistrationDescriptorListOrCopyableErrorResult
49
{
50
IPCServiceWorkerRegistrationDescriptorList;
51
CopyableErrorResult;
52
};
53
54
} // namespace dom
55
} // namespace mozilla