Coverage Report

Created: 2018-09-25 14:53

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