gecko-dev/dom/serviceworkers/ServiceWorkerOpArgs.ipdlh
Perry Jiang a0f4d9f5ad Bug 1611046 - add ServiceWorker shutdown progress tracking r=dom-workers-and-storage-reviewers,asuth
ServiceWorkerShutdownState encapsulates the shutdown progress for a particular
ServiceWorker. The shutdown process involves a "shutdown message" passing
multiple threads in both parent/content processes; we report a progress update
when it's known that a shutdown message has reached a particular thread. The
idea is that in the event of a shutdown timeout, ServiceWorkerShutdownBlocker
will be able to provide diagnostics for where shutdown processes are stalled.

Differential Revision: https://phabricator.services.mozilla.com/D60791

--HG--
extra : moz-landing-system : lando
2020-01-29 10:08:35 +00:00

131 lines
2.8 KiB
Plaintext

/* 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 ChannelInfo;
include ClientIPCTypes;
include DOMTypes;
include FetchTypes;
using ServiceWorkerState from "mozilla/dom/ServiceWorkerIPCUtils.h";
namespace mozilla {
namespace dom {
/**
* ServiceWorkerOpArgs
*/
struct ServiceWorkerCheckScriptEvaluationOpArgs {};
struct ServiceWorkerUpdateStateOpArgs {
ServiceWorkerState state;
};
struct ServiceWorkerTerminateWorkerOpArgs {
uint32_t shutdownStateId;
};
struct ServiceWorkerLifeCycleEventOpArgs {
nsString eventName;
};
// Possibly need to differentiate an empty array from the absence of an array.
union OptionalPushData {
void_t;
uint8_t[];
};
struct ServiceWorkerPushEventOpArgs {
nsString messageId;
OptionalPushData data;
};
struct ServiceWorkerPushSubscriptionChangeEventOpArgs {};
struct ServiceWorkerNotificationEventOpArgs {
nsString eventName;
nsString id;
nsString title;
nsString dir;
nsString lang;
nsString body;
nsString tag;
nsString icon;
nsString data;
nsString behavior;
nsString scope;
uint32_t disableOpenClickDelay;
};
struct ServiceWorkerMessageEventOpArgs {
ClientInfoAndState clientInfoAndState;
ClonedMessageData clonedData;
};
struct ServiceWorkerFetchEventOpArgs {
nsCString workerScriptSpec;
IPCInternalRequest internalRequest;
nsString clientId;
nsString resultingClientId;
bool isNonSubresourceRequest;
};
union ServiceWorkerOpArgs {
ServiceWorkerCheckScriptEvaluationOpArgs;
ServiceWorkerUpdateStateOpArgs;
ServiceWorkerTerminateWorkerOpArgs;
ServiceWorkerLifeCycleEventOpArgs;
ServiceWorkerPushEventOpArgs;
ServiceWorkerPushSubscriptionChangeEventOpArgs;
ServiceWorkerNotificationEventOpArgs;
ServiceWorkerMessageEventOpArgs;
ServiceWorkerFetchEventOpArgs;
};
/**
* IPCFetchEventRespondWithResult
*/
struct FetchEventRespondWithClosure {
nsCString respondWithScriptSpec;
uint32_t respondWithLineNumber;
uint32_t respondWithColumnNumber;
};
struct IPCSynthesizeResponseArgs {
IPCInternalResponse internalResponse;
FetchEventRespondWithClosure closure;
};
struct ResetInterceptionArgs {};
struct CancelInterceptionArgs {
nsresult status;
};
union IPCFetchEventRespondWithResult {
IPCSynthesizeResponseArgs;
ResetInterceptionArgs;
CancelInterceptionArgs;
};
/**
* ServiceWorkerOpResult
*/
struct ServiceWorkerCheckScriptEvaluationOpResult {
bool workerScriptExecutedSuccessfully;
bool fetchHandlerWasAdded;
};
struct ServiceWorkerFetchEventOpResult {
nsresult rv;
};
union ServiceWorkerOpResult {
nsresult;
ServiceWorkerCheckScriptEvaluationOpResult;
ServiceWorkerFetchEventOpResult;
};
} // namespace dom
} // namespace mozilla