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 ChannelInfo;
6
include ClientIPCTypes;
7
include DOMTypes;
8
include FetchTypes;
9
10
using ServiceWorkerState from "mozilla/dom/ServiceWorkerIPCUtils.h";
11
12
namespace mozilla {
13
namespace dom {
14
15
/**
16
* ServiceWorkerOpArgs
17
*/
18
struct ServiceWorkerCheckScriptEvaluationOpArgs {};
19
20
struct ServiceWorkerUpdateStateOpArgs {
21
ServiceWorkerState state;
22
};
23
24
struct ServiceWorkerTerminateWorkerOpArgs {};
25
26
struct ServiceWorkerLifeCycleEventOpArgs {
27
nsString eventName;
28
};
29
30
// Possibly need to differentiate an empty array from the absence of an array.
31
union OptionalPushData {
32
void_t;
33
uint8_t[];
34
};
35
36
struct ServiceWorkerPushEventOpArgs {
37
nsString messageId;
38
OptionalPushData data;
39
};
40
41
struct ServiceWorkerPushSubscriptionChangeEventOpArgs {};
42
43
struct ServiceWorkerNotificationEventOpArgs {
44
nsString eventName;
45
nsString id;
46
nsString title;
47
nsString dir;
48
nsString lang;
49
nsString body;
50
nsString tag;
51
nsString icon;
52
nsString data;
53
nsString behavior;
54
nsString scope;
55
uint32_t disableOpenClickDelay;
56
};
57
58
struct ServiceWorkerMessageEventOpArgs {
59
ClientInfoAndState clientInfoAndState;
60
ClonedMessageData clonedData;
61
};
62
63
struct ServiceWorkerFetchEventOpArgs {
64
nsCString workerScriptSpec;
65
IPCInternalRequest internalRequest;
66
nsString clientId;
67
nsString resultingClientId;
68
bool isReload;
69
bool isNonSubresourceRequest;
70
};
71
72
union ServiceWorkerOpArgs {
73
ServiceWorkerCheckScriptEvaluationOpArgs;
74
ServiceWorkerUpdateStateOpArgs;
75
ServiceWorkerTerminateWorkerOpArgs;
76
ServiceWorkerLifeCycleEventOpArgs;
77
ServiceWorkerPushEventOpArgs;
78
ServiceWorkerPushSubscriptionChangeEventOpArgs;
79
ServiceWorkerNotificationEventOpArgs;
80
ServiceWorkerMessageEventOpArgs;
81
ServiceWorkerFetchEventOpArgs;
82
};
83
84
/**
85
* IPCFetchEventRespondWithResult
86
*/
87
struct FetchEventRespondWithClosure {
88
nsCString respondWithScriptSpec;
89
uint32_t respondWithLineNumber;
90
uint32_t respondWithColumnNumber;
91
};
92
93
struct IPCSynthesizeResponseArgs {
94
IPCInternalResponse internalResponse;
95
FetchEventRespondWithClosure closure;
96
};
97
98
struct ResetInterceptionArgs {};
99
100
struct CancelInterceptionArgs {
101
nsresult status;
102
};
103
104
union IPCFetchEventRespondWithResult {
105
IPCSynthesizeResponseArgs;
106
ResetInterceptionArgs;
107
CancelInterceptionArgs;
108
};
109
110
/**
111
* ServiceWorkerOpResult
112
*/
113
struct ServiceWorkerCheckScriptEvaluationOpResult {
114
bool workerScriptExecutedSuccessfully;
115
bool fetchHandlerWasAdded;
116
};
117
118
struct ServiceWorkerFetchEventOpResult {
119
nsresult rv;
120
};
121
122
union ServiceWorkerOpResult {
123
nsresult;
124
ServiceWorkerCheckScriptEvaluationOpResult;
125
ServiceWorkerFetchEventOpResult;
126
};
127
128
} // namespace dom
129
} // namespace mozilla