/work/obj-fuzz/ipc/ipdl/PServiceWorkerManagerChild.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | // |
2 | | // Automatically generated by ipdlc. |
3 | | // Edit at your own risk |
4 | | // |
5 | | |
6 | | |
7 | | #include "mozilla/dom/PServiceWorkerManagerChild.h" |
8 | | |
9 | | #include "mozilla/ipc/PBackgroundChild.h" |
10 | | #include "mozilla/dom/PServiceWorkerUpdaterChild.h" |
11 | | |
12 | | #include "nsIFile.h" |
13 | | #include "GeckoProfiler.h" |
14 | | |
15 | | namespace mozilla { |
16 | | namespace dom { |
17 | | |
18 | | |
19 | | auto PServiceWorkerManagerChild::Recv__delete__() -> mozilla::ipc::IPCResult |
20 | 0 | { |
21 | 0 | return IPC_OK(); |
22 | 0 | } |
23 | | |
24 | | auto PServiceWorkerManagerChild::ActorDestroy(ActorDestroyReason aWhy) -> void |
25 | 0 | { |
26 | 0 | } |
27 | | |
28 | | MOZ_IMPLICIT PServiceWorkerManagerChild::PServiceWorkerManagerChild() : |
29 | | mozilla::ipc::IProtocol(mozilla::ipc::ChildSide), |
30 | | mLivenessState(mozilla::ipc::LivenessState::Dead) |
31 | 0 | { |
32 | 0 | MOZ_COUNT_CTOR(PServiceWorkerManagerChild); |
33 | 0 | } |
34 | | |
35 | | PServiceWorkerManagerChild::~PServiceWorkerManagerChild() |
36 | 0 | { |
37 | 0 | MOZ_COUNT_DTOR(PServiceWorkerManagerChild); |
38 | 0 | } |
39 | | |
40 | | auto PServiceWorkerManagerChild::Manager() const -> PBackgroundChild* |
41 | 0 | { |
42 | 0 | return static_cast<PBackgroundChild*>(IProtocol::Manager()); |
43 | 0 | } |
44 | | |
45 | | auto PServiceWorkerManagerChild::ManagedPServiceWorkerUpdaterChild(nsTArray<PServiceWorkerUpdaterChild*>& aArr) const -> void |
46 | 0 | { |
47 | 0 | (mManagedPServiceWorkerUpdaterChild).ToArray(aArr); |
48 | 0 | } |
49 | | |
50 | | auto PServiceWorkerManagerChild::ManagedPServiceWorkerUpdaterChild() const -> const ManagedContainer<PServiceWorkerUpdaterChild>& |
51 | 0 | { |
52 | 0 | return mManagedPServiceWorkerUpdaterChild; |
53 | 0 | } |
54 | | |
55 | | auto PServiceWorkerManagerChild::SendRegister(const ServiceWorkerRegistrationData& data) -> bool |
56 | 0 | { |
57 | 0 | IPC::Message* msg__ = PServiceWorkerManager::Msg_Register(Id()); |
58 | 0 |
|
59 | 0 | WriteIPDLParam(msg__, this, data); |
60 | 0 | // Sentinel = 'data' |
61 | 0 | (msg__)->WriteSentinel(843352540); |
62 | 0 |
|
63 | 0 |
|
64 | 0 |
|
65 | 0 |
|
66 | 0 | if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerManagerChild")) { |
67 | 0 | mozilla::ipc::LogMessageForProtocol("PServiceWorkerManagerChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
68 | 0 | } |
69 | 0 | AUTO_PROFILER_LABEL("PServiceWorkerManager::Msg_Register", OTHER); |
70 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
71 | 0 | mozilla::ipc::LogicError("Transition error"); |
72 | 0 | } |
73 | 0 |
|
74 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
75 | 0 | return sendok__; |
76 | 0 | } |
77 | | |
78 | | auto PServiceWorkerManagerChild::SendUnregister( |
79 | | const PrincipalInfo& principalInfo, |
80 | | const nsString& scope) -> bool |
81 | 0 | { |
82 | 0 | IPC::Message* msg__ = PServiceWorkerManager::Msg_Unregister(Id()); |
83 | 0 |
|
84 | 0 | WriteIPDLParam(msg__, this, principalInfo); |
85 | 0 | // Sentinel = 'principalInfo' |
86 | 0 | (msg__)->WriteSentinel(3386633731); |
87 | 0 | WriteIPDLParam(msg__, this, scope); |
88 | 0 | // Sentinel = 'scope' |
89 | 0 | (msg__)->WriteSentinel(2191984953); |
90 | 0 |
|
91 | 0 |
|
92 | 0 |
|
93 | 0 |
|
94 | 0 | if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerManagerChild")) { |
95 | 0 | mozilla::ipc::LogMessageForProtocol("PServiceWorkerManagerChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
96 | 0 | } |
97 | 0 | AUTO_PROFILER_LABEL("PServiceWorkerManager::Msg_Unregister", OTHER); |
98 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
99 | 0 | mozilla::ipc::LogicError("Transition error"); |
100 | 0 | } |
101 | 0 |
|
102 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
103 | 0 | return sendok__; |
104 | 0 | } |
105 | | |
106 | | auto PServiceWorkerManagerChild::SendPropagateSoftUpdate( |
107 | | const OriginAttributes& originAttributes, |
108 | | const nsString& scope) -> bool |
109 | 0 | { |
110 | 0 | IPC::Message* msg__ = PServiceWorkerManager::Msg_PropagateSoftUpdate(Id()); |
111 | 0 |
|
112 | 0 | WriteIPDLParam(msg__, this, originAttributes); |
113 | 0 | // Sentinel = 'originAttributes' |
114 | 0 | (msg__)->WriteSentinel(2655275965); |
115 | 0 | WriteIPDLParam(msg__, this, scope); |
116 | 0 | // Sentinel = 'scope' |
117 | 0 | (msg__)->WriteSentinel(2191984953); |
118 | 0 |
|
119 | 0 |
|
120 | 0 |
|
121 | 0 |
|
122 | 0 | if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerManagerChild")) { |
123 | 0 | mozilla::ipc::LogMessageForProtocol("PServiceWorkerManagerChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
124 | 0 | } |
125 | 0 | AUTO_PROFILER_LABEL("PServiceWorkerManager::Msg_PropagateSoftUpdate", OTHER); |
126 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
127 | 0 | mozilla::ipc::LogicError("Transition error"); |
128 | 0 | } |
129 | 0 |
|
130 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
131 | 0 | return sendok__; |
132 | 0 | } |
133 | | |
134 | | auto PServiceWorkerManagerChild::SendPropagateUnregister( |
135 | | const PrincipalInfo& principalInfo, |
136 | | const nsString& scope) -> bool |
137 | 0 | { |
138 | 0 | IPC::Message* msg__ = PServiceWorkerManager::Msg_PropagateUnregister(Id()); |
139 | 0 |
|
140 | 0 | WriteIPDLParam(msg__, this, principalInfo); |
141 | 0 | // Sentinel = 'principalInfo' |
142 | 0 | (msg__)->WriteSentinel(3386633731); |
143 | 0 | WriteIPDLParam(msg__, this, scope); |
144 | 0 | // Sentinel = 'scope' |
145 | 0 | (msg__)->WriteSentinel(2191984953); |
146 | 0 |
|
147 | 0 |
|
148 | 0 |
|
149 | 0 |
|
150 | 0 | if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerManagerChild")) { |
151 | 0 | mozilla::ipc::LogMessageForProtocol("PServiceWorkerManagerChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
152 | 0 | } |
153 | 0 | AUTO_PROFILER_LABEL("PServiceWorkerManager::Msg_PropagateUnregister", OTHER); |
154 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
155 | 0 | mozilla::ipc::LogicError("Transition error"); |
156 | 0 | } |
157 | 0 |
|
158 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
159 | 0 | return sendok__; |
160 | 0 | } |
161 | | |
162 | | auto PServiceWorkerManagerChild::SendPropagateRemove(const nsCString& host) -> bool |
163 | 0 | { |
164 | 0 | IPC::Message* msg__ = PServiceWorkerManager::Msg_PropagateRemove(Id()); |
165 | 0 |
|
166 | 0 | WriteIPDLParam(msg__, this, host); |
167 | 0 | // Sentinel = 'host' |
168 | 0 | (msg__)->WriteSentinel(4070301394); |
169 | 0 |
|
170 | 0 |
|
171 | 0 |
|
172 | 0 |
|
173 | 0 | if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerManagerChild")) { |
174 | 0 | mozilla::ipc::LogMessageForProtocol("PServiceWorkerManagerChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
175 | 0 | } |
176 | 0 | AUTO_PROFILER_LABEL("PServiceWorkerManager::Msg_PropagateRemove", OTHER); |
177 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
178 | 0 | mozilla::ipc::LogicError("Transition error"); |
179 | 0 | } |
180 | 0 |
|
181 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
182 | 0 | return sendok__; |
183 | 0 | } |
184 | | |
185 | | auto PServiceWorkerManagerChild::SendPropagateRemoveAll() -> bool |
186 | 0 | { |
187 | 0 | IPC::Message* msg__ = PServiceWorkerManager::Msg_PropagateRemoveAll(Id()); |
188 | 0 |
|
189 | 0 |
|
190 | 0 |
|
191 | 0 |
|
192 | 0 |
|
193 | 0 | if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerManagerChild")) { |
194 | 0 | mozilla::ipc::LogMessageForProtocol("PServiceWorkerManagerChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
195 | 0 | } |
196 | 0 | AUTO_PROFILER_LABEL("PServiceWorkerManager::Msg_PropagateRemoveAll", OTHER); |
197 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
198 | 0 | mozilla::ipc::LogicError("Transition error"); |
199 | 0 | } |
200 | 0 |
|
201 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
202 | 0 | return sendok__; |
203 | 0 | } |
204 | | |
205 | | auto PServiceWorkerManagerChild::SendShutdown() -> bool |
206 | 0 | { |
207 | 0 | IPC::Message* msg__ = PServiceWorkerManager::Msg_Shutdown(Id()); |
208 | 0 |
|
209 | 0 |
|
210 | 0 |
|
211 | 0 |
|
212 | 0 |
|
213 | 0 | if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerManagerChild")) { |
214 | 0 | mozilla::ipc::LogMessageForProtocol("PServiceWorkerManagerChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
215 | 0 | } |
216 | 0 | AUTO_PROFILER_LABEL("PServiceWorkerManager::Msg_Shutdown", OTHER); |
217 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
218 | 0 | mozilla::ipc::LogicError("Transition error"); |
219 | 0 | } |
220 | 0 |
|
221 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
222 | 0 | return sendok__; |
223 | 0 | } |
224 | | |
225 | | auto PServiceWorkerManagerChild::SendPServiceWorkerUpdaterConstructor( |
226 | | const OriginAttributes& originAttributes, |
227 | | const nsCString& scope) -> PServiceWorkerUpdaterChild* |
228 | 0 | { |
229 | 0 | return SendPServiceWorkerUpdaterConstructor(AllocPServiceWorkerUpdaterChild(originAttributes, scope), originAttributes, scope); |
230 | 0 | } |
231 | | |
232 | | auto PServiceWorkerManagerChild::SendPServiceWorkerUpdaterConstructor( |
233 | | PServiceWorkerUpdaterChild* actor, |
234 | | const OriginAttributes& originAttributes, |
235 | | const nsCString& scope) -> PServiceWorkerUpdaterChild* |
236 | 0 | { |
237 | 0 | if ((!(actor))) { |
238 | 0 | NS_WARNING("Error constructing actor PServiceWorkerUpdaterChild"); |
239 | 0 | return nullptr; |
240 | 0 | } |
241 | 0 | (actor)->SetManagerAndRegister(this); |
242 | 0 | (mManagedPServiceWorkerUpdaterChild).PutEntry(actor); |
243 | 0 | (actor)->mLivenessState = mozilla::ipc::LivenessState::Start; |
244 | 0 |
|
245 | 0 | IPC::Message* msg__ = PServiceWorkerManager::Msg_PServiceWorkerUpdaterConstructor(Id()); |
246 | 0 |
|
247 | 0 | MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param"); |
248 | 0 | WriteIPDLParam(msg__, this, actor); |
249 | 0 | // Sentinel = 'actor' |
250 | 0 | (msg__)->WriteSentinel(875202478); |
251 | 0 | WriteIPDLParam(msg__, this, originAttributes); |
252 | 0 | // Sentinel = 'originAttributes' |
253 | 0 | (msg__)->WriteSentinel(2655275965); |
254 | 0 | WriteIPDLParam(msg__, this, scope); |
255 | 0 | // Sentinel = 'scope' |
256 | 0 | (msg__)->WriteSentinel(2191984953); |
257 | 0 |
|
258 | 0 |
|
259 | 0 |
|
260 | 0 | if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerManagerChild")) { |
261 | 0 | mozilla::ipc::LogMessageForProtocol("PServiceWorkerManagerChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
262 | 0 | } |
263 | 0 | AUTO_PROFILER_LABEL("PServiceWorkerManager::Msg_PServiceWorkerUpdaterConstructor", OTHER); |
264 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
265 | 0 | mozilla::ipc::LogicError("Transition error"); |
266 | 0 | } |
267 | 0 |
|
268 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
269 | 0 | if ((!(sendok__))) { |
270 | 0 | FatalError("constructor for actor failed"); |
271 | 0 | return nullptr; |
272 | 0 | } |
273 | 0 | return actor; |
274 | 0 | } |
275 | | |
276 | | auto PServiceWorkerManagerChild::RemoveManagee( |
277 | | int32_t aProtocolId, |
278 | | IProtocol* aListener) -> void |
279 | 0 | { |
280 | 0 | switch (aProtocolId) { |
281 | 0 | case PServiceWorkerUpdaterMsgStart: |
282 | 0 | { |
283 | 0 | PServiceWorkerUpdaterChild* actor = static_cast<PServiceWorkerUpdaterChild*>(aListener); |
284 | 0 | auto& container = mManagedPServiceWorkerUpdaterChild; |
285 | 0 | MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!"); |
286 | 0 |
|
287 | 0 | (container).RemoveEntry(actor); |
288 | 0 | DeallocPServiceWorkerUpdaterChild(actor); |
289 | 0 | return; |
290 | 0 | } |
291 | 0 | default: |
292 | 0 | { |
293 | 0 | FatalError("unreached"); |
294 | 0 | return; |
295 | 0 | } |
296 | 0 | } |
297 | 0 | } |
298 | | |
299 | | auto PServiceWorkerManagerChild::OnMessageReceived(const Message& msg__) -> PServiceWorkerManagerChild::Result |
300 | 0 | { |
301 | 0 | switch ((msg__).type()) { |
302 | 0 | case PServiceWorkerManager::Reply_PServiceWorkerUpdaterConstructor__ID: |
303 | 0 | { |
304 | 0 | return MsgProcessed; |
305 | 0 | } |
306 | 0 | case PServiceWorkerManager::Msg_NotifyRegister__ID: |
307 | 0 | { |
308 | 0 | if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerManagerChild")) { |
309 | 0 | mozilla::ipc::LogMessageForProtocol("PServiceWorkerManagerChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
310 | 0 | } |
311 | 0 | AUTO_PROFILER_LABEL("PServiceWorkerManager::Msg_NotifyRegister", OTHER); |
312 | 0 |
|
313 | 0 | PickleIterator iter__(msg__); |
314 | 0 | ServiceWorkerRegistrationData data; |
315 | 0 |
|
316 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(data)))))) { |
317 | 0 | FatalError("Error deserializing 'ServiceWorkerRegistrationData'"); |
318 | 0 | return MsgValueError; |
319 | 0 | } |
320 | 0 | // Sentinel = 'data' |
321 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 843352540)))) { |
322 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'ServiceWorkerRegistrationData'"); |
323 | 0 | return MsgValueError; |
324 | 0 | } |
325 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
326 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
327 | 0 | FatalError("Transition error"); |
328 | 0 | return MsgValueError; |
329 | 0 | } |
330 | 0 | if ((!(RecvNotifyRegister(data)))) { |
331 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
332 | 0 | // Error handled in mozilla::ipc::IPCResult |
333 | 0 | return MsgProcessingError; |
334 | 0 | } |
335 | 0 | |
336 | 0 | return MsgProcessed; |
337 | 0 | } |
338 | 0 | case PServiceWorkerManager::Msg_NotifySoftUpdate__ID: |
339 | 0 | { |
340 | 0 | if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerManagerChild")) { |
341 | 0 | mozilla::ipc::LogMessageForProtocol("PServiceWorkerManagerChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
342 | 0 | } |
343 | 0 | AUTO_PROFILER_LABEL("PServiceWorkerManager::Msg_NotifySoftUpdate", OTHER); |
344 | 0 |
|
345 | 0 | PickleIterator iter__(msg__); |
346 | 0 | OriginAttributes originAttributes; |
347 | 0 | nsString scope; |
348 | 0 |
|
349 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(originAttributes)))))) { |
350 | 0 | FatalError("Error deserializing 'OriginAttributes'"); |
351 | 0 | return MsgValueError; |
352 | 0 | } |
353 | 0 | // Sentinel = 'originAttributes' |
354 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2655275965)))) { |
355 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'OriginAttributes'"); |
356 | 0 | return MsgValueError; |
357 | 0 | } |
358 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(scope)))))) { |
359 | 0 | FatalError("Error deserializing 'nsString'"); |
360 | 0 | return MsgValueError; |
361 | 0 | } |
362 | 0 | // Sentinel = 'scope' |
363 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2191984953)))) { |
364 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsString'"); |
365 | 0 | return MsgValueError; |
366 | 0 | } |
367 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
368 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
369 | 0 | FatalError("Transition error"); |
370 | 0 | return MsgValueError; |
371 | 0 | } |
372 | 0 | if ((!(RecvNotifySoftUpdate(originAttributes, scope)))) { |
373 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
374 | 0 | // Error handled in mozilla::ipc::IPCResult |
375 | 0 | return MsgProcessingError; |
376 | 0 | } |
377 | 0 | |
378 | 0 | return MsgProcessed; |
379 | 0 | } |
380 | 0 | case PServiceWorkerManager::Msg_NotifyUnregister__ID: |
381 | 0 | { |
382 | 0 | if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerManagerChild")) { |
383 | 0 | mozilla::ipc::LogMessageForProtocol("PServiceWorkerManagerChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
384 | 0 | } |
385 | 0 | AUTO_PROFILER_LABEL("PServiceWorkerManager::Msg_NotifyUnregister", OTHER); |
386 | 0 |
|
387 | 0 | PickleIterator iter__(msg__); |
388 | 0 | PrincipalInfo principalInfo; |
389 | 0 | nsString scope; |
390 | 0 |
|
391 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(principalInfo)))))) { |
392 | 0 | FatalError("Error deserializing 'PrincipalInfo'"); |
393 | 0 | return MsgValueError; |
394 | 0 | } |
395 | 0 | // Sentinel = 'principalInfo' |
396 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3386633731)))) { |
397 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'PrincipalInfo'"); |
398 | 0 | return MsgValueError; |
399 | 0 | } |
400 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(scope)))))) { |
401 | 0 | FatalError("Error deserializing 'nsString'"); |
402 | 0 | return MsgValueError; |
403 | 0 | } |
404 | 0 | // Sentinel = 'scope' |
405 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2191984953)))) { |
406 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsString'"); |
407 | 0 | return MsgValueError; |
408 | 0 | } |
409 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
410 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
411 | 0 | FatalError("Transition error"); |
412 | 0 | return MsgValueError; |
413 | 0 | } |
414 | 0 | if ((!(RecvNotifyUnregister(principalInfo, scope)))) { |
415 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
416 | 0 | // Error handled in mozilla::ipc::IPCResult |
417 | 0 | return MsgProcessingError; |
418 | 0 | } |
419 | 0 | |
420 | 0 | return MsgProcessed; |
421 | 0 | } |
422 | 0 | case PServiceWorkerManager::Msg_NotifyRemove__ID: |
423 | 0 | { |
424 | 0 | if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerManagerChild")) { |
425 | 0 | mozilla::ipc::LogMessageForProtocol("PServiceWorkerManagerChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
426 | 0 | } |
427 | 0 | AUTO_PROFILER_LABEL("PServiceWorkerManager::Msg_NotifyRemove", OTHER); |
428 | 0 |
|
429 | 0 | PickleIterator iter__(msg__); |
430 | 0 | nsCString host; |
431 | 0 |
|
432 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(host)))))) { |
433 | 0 | FatalError("Error deserializing 'nsCString'"); |
434 | 0 | return MsgValueError; |
435 | 0 | } |
436 | 0 | // Sentinel = 'host' |
437 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4070301394)))) { |
438 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'"); |
439 | 0 | return MsgValueError; |
440 | 0 | } |
441 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
442 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
443 | 0 | FatalError("Transition error"); |
444 | 0 | return MsgValueError; |
445 | 0 | } |
446 | 0 | if ((!(RecvNotifyRemove(host)))) { |
447 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
448 | 0 | // Error handled in mozilla::ipc::IPCResult |
449 | 0 | return MsgProcessingError; |
450 | 0 | } |
451 | 0 | |
452 | 0 | return MsgProcessed; |
453 | 0 | } |
454 | 0 | case PServiceWorkerManager::Msg_NotifyRemoveAll__ID: |
455 | 0 | { |
456 | 0 | if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerManagerChild")) { |
457 | 0 | mozilla::ipc::LogMessageForProtocol("PServiceWorkerManagerChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
458 | 0 | } |
459 | 0 | AUTO_PROFILER_LABEL("PServiceWorkerManager::Msg_NotifyRemoveAll", OTHER); |
460 | 0 |
|
461 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
462 | 0 | FatalError("Transition error"); |
463 | 0 | return MsgValueError; |
464 | 0 | } |
465 | 0 | if ((!(RecvNotifyRemoveAll()))) { |
466 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
467 | 0 | // Error handled in mozilla::ipc::IPCResult |
468 | 0 | return MsgProcessingError; |
469 | 0 | } |
470 | 0 | |
471 | 0 | return MsgProcessed; |
472 | 0 | } |
473 | 0 | case PServiceWorkerManager::Msg___delete____ID: |
474 | 0 | { |
475 | 0 | if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerManagerChild")) { |
476 | 0 | mozilla::ipc::LogMessageForProtocol("PServiceWorkerManagerChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
477 | 0 | } |
478 | 0 | AUTO_PROFILER_LABEL("PServiceWorkerManager::Msg___delete__", OTHER); |
479 | 0 |
|
480 | 0 | PickleIterator iter__(msg__); |
481 | 0 | PServiceWorkerManagerChild* actor; |
482 | 0 |
|
483 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) { |
484 | 0 | FatalError("Error deserializing 'PServiceWorkerManagerChild'"); |
485 | 0 | return MsgValueError; |
486 | 0 | } |
487 | 0 | if ((!((*((&(actor))))))) { |
488 | 0 | FatalError("Error deserializing 'PServiceWorkerManagerChild'"); |
489 | 0 | return MsgValueError; |
490 | 0 | } |
491 | 0 | // Sentinel = 'actor' |
492 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) { |
493 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'PServiceWorkerManagerChild'"); |
494 | 0 | return MsgValueError; |
495 | 0 | } |
496 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
497 | 0 | if ((!(StateTransition(true, (&(mLivenessState)))))) { |
498 | 0 | FatalError("Transition error"); |
499 | 0 | return MsgValueError; |
500 | 0 | } |
501 | 0 | if ((!(Recv__delete__()))) { |
502 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
503 | 0 | // Error handled in mozilla::ipc::IPCResult |
504 | 0 | return MsgProcessingError; |
505 | 0 | } |
506 | 0 | |
507 | 0 | |
508 | 0 | IProtocol* mgr = (actor)->Manager(); |
509 | 0 | (actor)->DestroySubtree(Deletion); |
510 | 0 | (actor)->DeallocSubtree(); |
511 | 0 | (mgr)->RemoveManagee(PServiceWorkerManagerMsgStart, actor); |
512 | 0 |
|
513 | 0 | return MsgProcessed; |
514 | 0 | } |
515 | 0 | default: |
516 | 0 | { |
517 | 0 | return MsgNotKnown; |
518 | 0 | } |
519 | 0 | } |
520 | 0 | } |
521 | | |
522 | | auto PServiceWorkerManagerChild::OnMessageReceived( |
523 | | const Message& msg__, |
524 | | Message*& reply__) -> PServiceWorkerManagerChild::Result |
525 | 0 | { |
526 | 0 | return MsgNotKnown; |
527 | 0 | } |
528 | | |
529 | | auto PServiceWorkerManagerChild::OnCallReceived( |
530 | | const Message& msg__, |
531 | | Message*& reply__) -> PServiceWorkerManagerChild::Result |
532 | 0 | { |
533 | 0 | MOZ_ASSERT_UNREACHABLE("message protocol not supported"); |
534 | 0 | return MsgNotKnown; |
535 | 0 | } |
536 | | |
537 | | auto PServiceWorkerManagerChild::GetProtocolTypeId() -> int32_t |
538 | 0 | { |
539 | 0 | return PServiceWorkerManagerMsgStart; |
540 | 0 | } |
541 | | |
542 | | auto PServiceWorkerManagerChild::DestroySubtree(ActorDestroyReason why) -> void |
543 | 0 | { |
544 | 0 | // Unregister from our manager. |
545 | 0 | Unregister(Id()); |
546 | 0 |
|
547 | 0 | ActorDestroyReason subtreewhy = (((why) == (Deletion)) || ((why) == (FailedConstructor)) ? AncestorDeletion : why); |
548 | 0 |
|
549 | 0 | { |
550 | 0 | // Recursively shutting down PServiceWorkerUpdater kids |
551 | 0 | nsTArray<PServiceWorkerUpdaterChild*> kids; |
552 | 0 | // Accumulate kids into a stable structure to iterate over |
553 | 0 | ManagedPServiceWorkerUpdaterChild(kids); |
554 | 0 | for (auto& kid : kids) { |
555 | 0 | // Guarding against a child removing a sibling from the list during the iteration. |
556 | 0 | if ((mManagedPServiceWorkerUpdaterChild).Contains(kid)) { |
557 | 0 | (kid)->DestroySubtree(subtreewhy); |
558 | 0 | } |
559 | 0 | } |
560 | 0 | } |
561 | 0 |
|
562 | 0 | // Reject owning pending responses. |
563 | 0 | (GetIPCChannel())->RejectPendingResponsesForActor(this); |
564 | 0 |
|
565 | 0 | // Finally, destroy "us". |
566 | 0 | ActorDestroy(why); |
567 | 0 | } |
568 | | |
569 | | auto PServiceWorkerManagerChild::DeallocSubtree() -> void |
570 | 0 | { |
571 | 0 | { |
572 | 0 | // Recursively deleting PServiceWorkerUpdater kids |
573 | 0 | for (auto iter = (mManagedPServiceWorkerUpdaterChild).Iter(); (!((iter).Done())); (iter).Next()) { |
574 | 0 | (((iter).Get())->GetKey())->DeallocSubtree(); |
575 | 0 | } |
576 | 0 |
|
577 | 0 | for (auto iter = (mManagedPServiceWorkerUpdaterChild).Iter(); (!((iter).Done())); (iter).Next()) { |
578 | 0 | DeallocPServiceWorkerUpdaterChild(((iter).Get())->GetKey()); |
579 | 0 | } |
580 | 0 | (mManagedPServiceWorkerUpdaterChild).Clear(); |
581 | 0 | } |
582 | 0 | } |
583 | | |
584 | | |
585 | | |
586 | | } // namespace dom |
587 | | } // namespace mozilla |
588 | | namespace mozilla { |
589 | | namespace ipc { |
590 | | auto IPDLParamTraits<mozilla::dom::PServiceWorkerManagerChild>::Write( |
591 | | IPC::Message* aMsg, |
592 | | mozilla::ipc::IProtocol* aActor, |
593 | | const paramType& aVar) -> void |
594 | 0 | { |
595 | 0 | int32_t id; |
596 | 0 | if ((!(aVar))) { |
597 | 0 | id = 0; |
598 | 0 | } |
599 | 0 | else { |
600 | 0 | id = (aVar)->Id(); |
601 | 0 | if ((1) == (id)) { |
602 | 0 | (aActor)->FatalError("actor has been |delete|d"); |
603 | 0 | } |
604 | 0 | } |
605 | 0 | WriteIPDLParam(aMsg, aActor, id); |
606 | 0 | } |
607 | | |
608 | | auto IPDLParamTraits<mozilla::dom::PServiceWorkerManagerChild>::Read( |
609 | | const IPC::Message* aMsg, |
610 | | PickleIterator* aIter, |
611 | | mozilla::ipc::IProtocol* aActor, |
612 | | paramType* aVar) -> bool |
613 | 0 | { |
614 | 0 | mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PServiceWorkerManager", PServiceWorkerManagerMsgStart); |
615 | 0 | if ((actor).isNothing()) { |
616 | 0 | return false; |
617 | 0 | } |
618 | 0 | |
619 | 0 | (*(aVar)) = static_cast<mozilla::dom::PServiceWorkerManagerChild*>((actor).value()); |
620 | 0 | return true; |
621 | 0 | } |
622 | | |
623 | | } // namespace ipc |
624 | | } // namespace mozilla |