2018-01-31 19:29:49 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
include PBackgroundSharedTypes;
|
|
|
|
include IPCServiceWorkerDescriptor;
|
|
|
|
|
|
|
|
using ServiceWorkerUpdateViaCache from "mozilla/dom/ServiceWorkerIPCUtils.h";
|
2018-07-10 02:02:40 +03:00
|
|
|
using mozilla::CopyableErrorResult from "ipc/ErrorIPCUtils.h";
|
2018-01-31 19:29:49 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
// IPC type with enough information to create a ServiceWorker DOM object
|
|
|
|
// in a child process. Note that the state may be slightly out-of-sync
|
|
|
|
// with the parent and should be updated dynamically if necessary.
|
|
|
|
struct IPCServiceWorkerRegistrationDescriptor
|
|
|
|
{
|
2018-03-03 00:02:50 +03:00
|
|
|
uint64_t id;
|
2018-07-02 17:44:19 +03:00
|
|
|
uint64_t version;
|
2018-03-03 00:02:50 +03:00
|
|
|
|
2018-01-31 19:29:49 +03:00
|
|
|
// These values should match the principal and scope in each
|
|
|
|
// associated worker. It may be possible to optimize in the future,
|
|
|
|
// but for now we duplicate the information here to ensure correctness.
|
|
|
|
// Its possible we may need to reference a registration before the
|
|
|
|
// worker is installed yet, etc.
|
|
|
|
PrincipalInfo principalInfo;
|
|
|
|
nsCString scope;
|
|
|
|
|
|
|
|
ServiceWorkerUpdateViaCache updateViaCache;
|
|
|
|
|
|
|
|
OptionalIPCServiceWorkerDescriptor installing;
|
|
|
|
OptionalIPCServiceWorkerDescriptor waiting;
|
|
|
|
OptionalIPCServiceWorkerDescriptor active;
|
|
|
|
};
|
|
|
|
|
2018-07-10 02:02:40 +03:00
|
|
|
union IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult
|
|
|
|
{
|
|
|
|
IPCServiceWorkerRegistrationDescriptor;
|
|
|
|
CopyableErrorResult;
|
|
|
|
};
|
|
|
|
|
2018-07-10 02:02:41 +03:00
|
|
|
struct IPCServiceWorkerRegistrationDescriptorList
|
|
|
|
{
|
|
|
|
IPCServiceWorkerRegistrationDescriptor[] values;
|
|
|
|
};
|
|
|
|
|
|
|
|
union IPCServiceWorkerRegistrationDescriptorListOrCopyableErrorResult
|
|
|
|
{
|
|
|
|
IPCServiceWorkerRegistrationDescriptorList;
|
|
|
|
CopyableErrorResult;
|
|
|
|
};
|
|
|
|
|
2018-01-31 19:29:49 +03:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|