Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PPresentationChild.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/PPresentationChild.h"
8
#include "mozilla/dom/PermissionMessageUtils.h"
9
10
#include "mozilla/dom/PContentChild.h"
11
#include "mozilla/dom/PPresentationRequestChild.h"
12
#include "mozilla/dom/PPresentationBuilderChild.h"
13
14
#include "nsIFile.h"
15
#include "GeckoProfiler.h"
16
17
namespace mozilla {
18
namespace dom {
19
20
21
auto PPresentationChild::RecvPPresentationBuilderConstructor(
22
        PPresentationBuilderChild* actor,
23
        const nsString& aSessionId,
24
        const uint8_t& aRole) -> mozilla::ipc::IPCResult
25
0
{
26
0
    return IPC_OK();
27
0
}
28
29
auto PPresentationChild::ActorDestroy(ActorDestroyReason aWhy) -> void
30
0
{
31
0
}
32
33
MOZ_IMPLICIT PPresentationChild::PPresentationChild() :
34
    mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
35
    mLivenessState(mozilla::ipc::LivenessState::Dead)
36
0
{
37
0
    MOZ_COUNT_CTOR(PPresentationChild);
38
0
}
39
40
PPresentationChild::~PPresentationChild()
41
0
{
42
0
    MOZ_COUNT_DTOR(PPresentationChild);
43
0
}
44
45
auto PPresentationChild::Manager() const -> PContentChild*
46
0
{
47
0
    return static_cast<PContentChild*>(IProtocol::Manager());
48
0
}
49
50
auto PPresentationChild::ManagedPPresentationBuilderChild(nsTArray<PPresentationBuilderChild*>& aArr) const -> void
51
0
{
52
0
    (mManagedPPresentationBuilderChild).ToArray(aArr);
53
0
}
54
55
auto PPresentationChild::ManagedPPresentationBuilderChild() const -> const ManagedContainer<PPresentationBuilderChild>&
56
0
{
57
0
    return mManagedPPresentationBuilderChild;
58
0
}
59
60
auto PPresentationChild::ManagedPPresentationRequestChild(nsTArray<PPresentationRequestChild*>& aArr) const -> void
61
0
{
62
0
    (mManagedPPresentationRequestChild).ToArray(aArr);
63
0
}
64
65
auto PPresentationChild::ManagedPPresentationRequestChild() const -> const ManagedContainer<PPresentationRequestChild>&
66
0
{
67
0
    return mManagedPPresentationRequestChild;
68
0
}
69
70
auto PPresentationChild::Send__delete__(PPresentationChild* actor) -> bool
71
0
{
72
0
    if ((!(actor))) {
73
0
        return false;
74
0
    }
75
0
76
0
    IPC::Message* msg__ = PPresentation::Msg___delete__((actor)->Id());
77
0
78
0
    MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param");
79
0
    WriteIPDLParam(msg__, actor, actor);
80
0
    // Sentinel = 'actor'
81
0
    (msg__)->WriteSentinel(875202478);
82
0
83
0
84
0
85
0
    if (mozilla::ipc::LoggingEnabledFor("PPresentationChild")) {
86
0
        mozilla::ipc::LogMessageForProtocol("PPresentationChild", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
87
0
    }
88
0
    AUTO_PROFILER_LABEL("PPresentation::Msg___delete__", OTHER);
89
0
    if ((!(StateTransition(true, (&((actor)->mLivenessState)))))) {
90
0
        mozilla::ipc::LogicError("Transition error");
91
0
    }
92
0
93
0
    bool sendok__ = ((actor)->GetIPCChannel())->Send(msg__);
94
0
95
0
    IProtocol* mgr = (actor)->Manager();
96
0
    (actor)->DestroySubtree(Deletion);
97
0
    (actor)->DeallocSubtree();
98
0
    (mgr)->RemoveManagee(PPresentationMsgStart, actor);
99
0
    return sendok__;
100
0
}
101
102
auto PPresentationChild::SendRegisterAvailabilityHandler(const nsTArray<nsString>& aAvailabilityUrls) -> bool
103
0
{
104
0
    IPC::Message* msg__ = PPresentation::Msg_RegisterAvailabilityHandler(Id());
105
0
106
0
    WriteIPDLParam(msg__, this, aAvailabilityUrls);
107
0
    // Sentinel = 'aAvailabilityUrls'
108
0
    (msg__)->WriteSentinel(4288475919);
109
0
110
0
111
0
112
0
113
0
    if (mozilla::ipc::LoggingEnabledFor("PPresentationChild")) {
114
0
        mozilla::ipc::LogMessageForProtocol("PPresentationChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
115
0
    }
116
0
    AUTO_PROFILER_LABEL("PPresentation::Msg_RegisterAvailabilityHandler", OTHER);
117
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
118
0
        mozilla::ipc::LogicError("Transition error");
119
0
    }
120
0
121
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
122
0
    return sendok__;
123
0
}
124
125
auto PPresentationChild::SendUnregisterAvailabilityHandler(const nsTArray<nsString>& aAvailabilityUrls) -> bool
126
0
{
127
0
    IPC::Message* msg__ = PPresentation::Msg_UnregisterAvailabilityHandler(Id());
128
0
129
0
    WriteIPDLParam(msg__, this, aAvailabilityUrls);
130
0
    // Sentinel = 'aAvailabilityUrls'
131
0
    (msg__)->WriteSentinel(4288475919);
132
0
133
0
134
0
135
0
136
0
    if (mozilla::ipc::LoggingEnabledFor("PPresentationChild")) {
137
0
        mozilla::ipc::LogMessageForProtocol("PPresentationChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
138
0
    }
139
0
    AUTO_PROFILER_LABEL("PPresentation::Msg_UnregisterAvailabilityHandler", OTHER);
140
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
141
0
        mozilla::ipc::LogicError("Transition error");
142
0
    }
143
0
144
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
145
0
    return sendok__;
146
0
}
147
148
auto PPresentationChild::SendRegisterSessionHandler(
149
        const nsString& aSessionId,
150
        const uint8_t& aRole) -> bool
151
0
{
152
0
    IPC::Message* msg__ = PPresentation::Msg_RegisterSessionHandler(Id());
153
0
154
0
    WriteIPDLParam(msg__, this, aSessionId);
155
0
    // Sentinel = 'aSessionId'
156
0
    (msg__)->WriteSentinel(725794242);
157
0
    WriteIPDLParam(msg__, this, aRole);
158
0
    // Sentinel = 'aRole'
159
0
    (msg__)->WriteSentinel(985916136);
160
0
161
0
162
0
163
0
164
0
    if (mozilla::ipc::LoggingEnabledFor("PPresentationChild")) {
165
0
        mozilla::ipc::LogMessageForProtocol("PPresentationChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
166
0
    }
167
0
    AUTO_PROFILER_LABEL("PPresentation::Msg_RegisterSessionHandler", OTHER);
168
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
169
0
        mozilla::ipc::LogicError("Transition error");
170
0
    }
171
0
172
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
173
0
    return sendok__;
174
0
}
175
176
auto PPresentationChild::SendUnregisterSessionHandler(
177
        const nsString& aSessionId,
178
        const uint8_t& aRole) -> bool
179
0
{
180
0
    IPC::Message* msg__ = PPresentation::Msg_UnregisterSessionHandler(Id());
181
0
182
0
    WriteIPDLParam(msg__, this, aSessionId);
183
0
    // Sentinel = 'aSessionId'
184
0
    (msg__)->WriteSentinel(725794242);
185
0
    WriteIPDLParam(msg__, this, aRole);
186
0
    // Sentinel = 'aRole'
187
0
    (msg__)->WriteSentinel(985916136);
188
0
189
0
190
0
191
0
192
0
    if (mozilla::ipc::LoggingEnabledFor("PPresentationChild")) {
193
0
        mozilla::ipc::LogMessageForProtocol("PPresentationChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
194
0
    }
195
0
    AUTO_PROFILER_LABEL("PPresentation::Msg_UnregisterSessionHandler", OTHER);
196
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
197
0
        mozilla::ipc::LogicError("Transition error");
198
0
    }
199
0
200
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
201
0
    return sendok__;
202
0
}
203
204
auto PPresentationChild::SendRegisterRespondingHandler(const uint64_t& aWindowId) -> bool
205
0
{
206
0
    IPC::Message* msg__ = PPresentation::Msg_RegisterRespondingHandler(Id());
207
0
208
0
    WriteIPDLParam(msg__, this, aWindowId);
209
0
    // Sentinel = 'aWindowId'
210
0
    (msg__)->WriteSentinel(3844940347);
211
0
212
0
213
0
214
0
215
0
    if (mozilla::ipc::LoggingEnabledFor("PPresentationChild")) {
216
0
        mozilla::ipc::LogMessageForProtocol("PPresentationChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
217
0
    }
218
0
    AUTO_PROFILER_LABEL("PPresentation::Msg_RegisterRespondingHandler", OTHER);
219
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
220
0
        mozilla::ipc::LogicError("Transition error");
221
0
    }
222
0
223
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
224
0
    return sendok__;
225
0
}
226
227
auto PPresentationChild::SendUnregisterRespondingHandler(const uint64_t& aWindowId) -> bool
228
0
{
229
0
    IPC::Message* msg__ = PPresentation::Msg_UnregisterRespondingHandler(Id());
230
0
231
0
    WriteIPDLParam(msg__, this, aWindowId);
232
0
    // Sentinel = 'aWindowId'
233
0
    (msg__)->WriteSentinel(3844940347);
234
0
235
0
236
0
237
0
238
0
    if (mozilla::ipc::LoggingEnabledFor("PPresentationChild")) {
239
0
        mozilla::ipc::LogMessageForProtocol("PPresentationChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
240
0
    }
241
0
    AUTO_PROFILER_LABEL("PPresentation::Msg_UnregisterRespondingHandler", OTHER);
242
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
243
0
        mozilla::ipc::LogicError("Transition error");
244
0
    }
245
0
246
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
247
0
    return sendok__;
248
0
}
249
250
auto PPresentationChild::SendPPresentationRequestConstructor(const PresentationIPCRequest& aRequest) -> PPresentationRequestChild*
251
0
{
252
0
    return SendPPresentationRequestConstructor(AllocPPresentationRequestChild(aRequest), aRequest);
253
0
}
254
255
auto PPresentationChild::SendPPresentationRequestConstructor(
256
        PPresentationRequestChild* actor,
257
        const PresentationIPCRequest& aRequest) -> PPresentationRequestChild*
258
0
{
259
0
    if ((!(actor))) {
260
0
        NS_WARNING("Error constructing actor PPresentationRequestChild");
261
0
        return nullptr;
262
0
    }
263
0
    (actor)->SetManagerAndRegister(this);
264
0
    (mManagedPPresentationRequestChild).PutEntry(actor);
265
0
    (actor)->mLivenessState = mozilla::ipc::LivenessState::Start;
266
0
267
0
    IPC::Message* msg__ = PPresentation::Msg_PPresentationRequestConstructor(Id());
268
0
269
0
    MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param");
270
0
    WriteIPDLParam(msg__, this, actor);
271
0
    // Sentinel = 'actor'
272
0
    (msg__)->WriteSentinel(875202478);
273
0
    WriteIPDLParam(msg__, this, aRequest);
274
0
    // Sentinel = 'aRequest'
275
0
    (msg__)->WriteSentinel(1227940332);
276
0
277
0
278
0
279
0
    if (mozilla::ipc::LoggingEnabledFor("PPresentationChild")) {
280
0
        mozilla::ipc::LogMessageForProtocol("PPresentationChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
281
0
    }
282
0
    AUTO_PROFILER_LABEL("PPresentation::Msg_PPresentationRequestConstructor", OTHER);
283
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
284
0
        mozilla::ipc::LogicError("Transition error");
285
0
    }
286
0
287
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
288
0
    if ((!(sendok__))) {
289
0
        FatalError("constructor for actor failed");
290
0
        return nullptr;
291
0
    }
292
0
    return actor;
293
0
}
294
295
auto PPresentationChild::SendNotifyReceiverReady(
296
        const nsString& aSessionId,
297
        const uint64_t& aWindowId,
298
        const bool& aIsLoading) -> bool
299
0
{
300
0
    IPC::Message* msg__ = PPresentation::Msg_NotifyReceiverReady(Id());
301
0
302
0
    WriteIPDLParam(msg__, this, aSessionId);
303
0
    // Sentinel = 'aSessionId'
304
0
    (msg__)->WriteSentinel(725794242);
305
0
    WriteIPDLParam(msg__, this, aWindowId);
306
0
    // Sentinel = 'aWindowId'
307
0
    (msg__)->WriteSentinel(3844940347);
308
0
    WriteIPDLParam(msg__, this, aIsLoading);
309
0
    // Sentinel = 'aIsLoading'
310
0
    (msg__)->WriteSentinel(3674007961);
311
0
312
0
313
0
314
0
315
0
    if (mozilla::ipc::LoggingEnabledFor("PPresentationChild")) {
316
0
        mozilla::ipc::LogMessageForProtocol("PPresentationChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
317
0
    }
318
0
    AUTO_PROFILER_LABEL("PPresentation::Msg_NotifyReceiverReady", OTHER);
319
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
320
0
        mozilla::ipc::LogicError("Transition error");
321
0
    }
322
0
323
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
324
0
    return sendok__;
325
0
}
326
327
auto PPresentationChild::SendNotifyTransportClosed(
328
        const nsString& aSessionId,
329
        const uint8_t& aRole,
330
        const nsresult& aReason) -> bool
331
0
{
332
0
    IPC::Message* msg__ = PPresentation::Msg_NotifyTransportClosed(Id());
333
0
334
0
    WriteIPDLParam(msg__, this, aSessionId);
335
0
    // Sentinel = 'aSessionId'
336
0
    (msg__)->WriteSentinel(725794242);
337
0
    WriteIPDLParam(msg__, this, aRole);
338
0
    // Sentinel = 'aRole'
339
0
    (msg__)->WriteSentinel(985916136);
340
0
    WriteIPDLParam(msg__, this, aReason);
341
0
    // Sentinel = 'aReason'
342
0
    (msg__)->WriteSentinel(829905706);
343
0
344
0
345
0
346
0
347
0
    if (mozilla::ipc::LoggingEnabledFor("PPresentationChild")) {
348
0
        mozilla::ipc::LogMessageForProtocol("PPresentationChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
349
0
    }
350
0
    AUTO_PROFILER_LABEL("PPresentation::Msg_NotifyTransportClosed", OTHER);
351
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
352
0
        mozilla::ipc::LogicError("Transition error");
353
0
    }
354
0
355
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
356
0
    return sendok__;
357
0
}
358
359
auto PPresentationChild::RemoveManagee(
360
        int32_t aProtocolId,
361
        IProtocol* aListener) -> void
362
0
{
363
0
    switch (aProtocolId) {
364
0
    case PPresentationBuilderMsgStart:
365
0
        {
366
0
            PPresentationBuilderChild* actor = static_cast<PPresentationBuilderChild*>(aListener);
367
0
            auto& container = mManagedPPresentationBuilderChild;
368
0
            MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!");
369
0
370
0
            (container).RemoveEntry(actor);
371
0
            DeallocPPresentationBuilderChild(actor);
372
0
            return;
373
0
        }
374
0
    case PPresentationRequestMsgStart:
375
0
        {
376
0
            PPresentationRequestChild* actor = static_cast<PPresentationRequestChild*>(aListener);
377
0
            auto& container = mManagedPPresentationRequestChild;
378
0
            MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!");
379
0
380
0
            (container).RemoveEntry(actor);
381
0
            DeallocPPresentationRequestChild(actor);
382
0
            return;
383
0
        }
384
0
    default:
385
0
        {
386
0
            FatalError("unreached");
387
0
            return;
388
0
        }
389
0
    }
390
0
}
391
392
auto PPresentationChild::OnMessageReceived(const Message& msg__) -> PPresentationChild::Result
393
0
{
394
0
    switch ((msg__).type()) {
395
0
    case PPresentation::Msg_NotifyAvailableChange__ID:
396
0
        {
397
0
            if (mozilla::ipc::LoggingEnabledFor("PPresentationChild")) {
398
0
                mozilla::ipc::LogMessageForProtocol("PPresentationChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
399
0
            }
400
0
            AUTO_PROFILER_LABEL("PPresentation::Msg_NotifyAvailableChange", OTHER);
401
0
402
0
            PickleIterator iter__(msg__);
403
0
            nsTArray<nsString> aAvailabilityUrls;
404
0
            bool aAvailable;
405
0
406
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aAvailabilityUrls)))))) {
407
0
                FatalError("Error deserializing 'nsTArray'");
408
0
                return MsgValueError;
409
0
            }
410
0
            // Sentinel = 'aAvailabilityUrls'
411
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4288475919)))) {
412
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsTArray'");
413
0
                return MsgValueError;
414
0
            }
415
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aAvailable)))))) {
416
0
                FatalError("Error deserializing 'bool'");
417
0
                return MsgValueError;
418
0
            }
419
0
            // Sentinel = 'aAvailable'
420
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1825731316)))) {
421
0
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
422
0
                return MsgValueError;
423
0
            }
424
0
            (msg__).EndRead(iter__, (msg__).type());
425
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
426
0
                FatalError("Transition error");
427
0
                return MsgValueError;
428
0
            }
429
0
            if ((!(RecvNotifyAvailableChange(std::move(aAvailabilityUrls), aAvailable)))) {
430
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
431
0
                // Error handled in mozilla::ipc::IPCResult
432
0
                return MsgProcessingError;
433
0
            }
434
0
435
0
            return MsgProcessed;
436
0
        }
437
0
    case PPresentation::Msg_NotifySessionStateChange__ID:
438
0
        {
439
0
            if (mozilla::ipc::LoggingEnabledFor("PPresentationChild")) {
440
0
                mozilla::ipc::LogMessageForProtocol("PPresentationChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
441
0
            }
442
0
            AUTO_PROFILER_LABEL("PPresentation::Msg_NotifySessionStateChange", OTHER);
443
0
444
0
            PickleIterator iter__(msg__);
445
0
            nsString aSessionId;
446
0
            uint16_t aState;
447
0
            nsresult aReason;
448
0
449
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aSessionId)))))) {
450
0
                FatalError("Error deserializing 'nsString'");
451
0
                return MsgValueError;
452
0
            }
453
0
            // Sentinel = 'aSessionId'
454
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 725794242)))) {
455
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
456
0
                return MsgValueError;
457
0
            }
458
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aState)))))) {
459
0
                FatalError("Error deserializing 'uint16_t'");
460
0
                return MsgValueError;
461
0
            }
462
0
            // Sentinel = 'aState'
463
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3694751962)))) {
464
0
                mozilla::ipc::SentinelReadError("Error deserializing 'uint16_t'");
465
0
                return MsgValueError;
466
0
            }
467
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aReason)))))) {
468
0
                FatalError("Error deserializing 'nsresult'");
469
0
                return MsgValueError;
470
0
            }
471
0
            // Sentinel = 'aReason'
472
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 829905706)))) {
473
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
474
0
                return MsgValueError;
475
0
            }
476
0
            (msg__).EndRead(iter__, (msg__).type());
477
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
478
0
                FatalError("Transition error");
479
0
                return MsgValueError;
480
0
            }
481
0
            if ((!(RecvNotifySessionStateChange(aSessionId, aState, aReason)))) {
482
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
483
0
                // Error handled in mozilla::ipc::IPCResult
484
0
                return MsgProcessingError;
485
0
            }
486
0
487
0
            return MsgProcessed;
488
0
        }
489
0
    case PPresentation::Msg_NotifyMessage__ID:
490
0
        {
491
0
            if (mozilla::ipc::LoggingEnabledFor("PPresentationChild")) {
492
0
                mozilla::ipc::LogMessageForProtocol("PPresentationChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
493
0
            }
494
0
            AUTO_PROFILER_LABEL("PPresentation::Msg_NotifyMessage", OTHER);
495
0
496
0
            PickleIterator iter__(msg__);
497
0
            nsString aSessionId;
498
0
            nsCString aData;
499
0
            bool aIsBinary;
500
0
501
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aSessionId)))))) {
502
0
                FatalError("Error deserializing 'nsString'");
503
0
                return MsgValueError;
504
0
            }
505
0
            // Sentinel = 'aSessionId'
506
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 725794242)))) {
507
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
508
0
                return MsgValueError;
509
0
            }
510
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aData)))))) {
511
0
                FatalError("Error deserializing 'nsCString'");
512
0
                return MsgValueError;
513
0
            }
514
0
            // Sentinel = 'aData'
515
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3285075324)))) {
516
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
517
0
                return MsgValueError;
518
0
            }
519
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aIsBinary)))))) {
520
0
                FatalError("Error deserializing 'bool'");
521
0
                return MsgValueError;
522
0
            }
523
0
            // Sentinel = 'aIsBinary'
524
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2416980823)))) {
525
0
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
526
0
                return MsgValueError;
527
0
            }
528
0
            (msg__).EndRead(iter__, (msg__).type());
529
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
530
0
                FatalError("Transition error");
531
0
                return MsgValueError;
532
0
            }
533
0
            if ((!(RecvNotifyMessage(aSessionId, aData, aIsBinary)))) {
534
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
535
0
                // Error handled in mozilla::ipc::IPCResult
536
0
                return MsgProcessingError;
537
0
            }
538
0
539
0
            return MsgProcessed;
540
0
        }
541
0
    case PPresentation::Msg_NotifySessionConnect__ID:
542
0
        {
543
0
            if (mozilla::ipc::LoggingEnabledFor("PPresentationChild")) {
544
0
                mozilla::ipc::LogMessageForProtocol("PPresentationChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
545
0
            }
546
0
            AUTO_PROFILER_LABEL("PPresentation::Msg_NotifySessionConnect", OTHER);
547
0
548
0
            PickleIterator iter__(msg__);
549
0
            uint64_t aWindowId;
550
0
            nsString aSessionId;
551
0
552
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aWindowId)))))) {
553
0
                FatalError("Error deserializing 'uint64_t'");
554
0
                return MsgValueError;
555
0
            }
556
0
            // Sentinel = 'aWindowId'
557
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3844940347)))) {
558
0
                mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
559
0
                return MsgValueError;
560
0
            }
561
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aSessionId)))))) {
562
0
                FatalError("Error deserializing 'nsString'");
563
0
                return MsgValueError;
564
0
            }
565
0
            // Sentinel = 'aSessionId'
566
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 725794242)))) {
567
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
568
0
                return MsgValueError;
569
0
            }
570
0
            (msg__).EndRead(iter__, (msg__).type());
571
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
572
0
                FatalError("Transition error");
573
0
                return MsgValueError;
574
0
            }
575
0
            if ((!(RecvNotifySessionConnect(aWindowId, aSessionId)))) {
576
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
577
0
                // Error handled in mozilla::ipc::IPCResult
578
0
                return MsgProcessingError;
579
0
            }
580
0
581
0
            return MsgProcessed;
582
0
        }
583
0
    case PPresentation::Msg_NotifyCloseSessionTransport__ID:
584
0
        {
585
0
            if (mozilla::ipc::LoggingEnabledFor("PPresentationChild")) {
586
0
                mozilla::ipc::LogMessageForProtocol("PPresentationChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
587
0
            }
588
0
            AUTO_PROFILER_LABEL("PPresentation::Msg_NotifyCloseSessionTransport", OTHER);
589
0
590
0
            PickleIterator iter__(msg__);
591
0
            nsString aSessionId;
592
0
            uint8_t aRole;
593
0
            nsresult aReason;
594
0
595
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aSessionId)))))) {
596
0
                FatalError("Error deserializing 'nsString'");
597
0
                return MsgValueError;
598
0
            }
599
0
            // Sentinel = 'aSessionId'
600
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 725794242)))) {
601
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
602
0
                return MsgValueError;
603
0
            }
604
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aRole)))))) {
605
0
                FatalError("Error deserializing 'uint8_t'");
606
0
                return MsgValueError;
607
0
            }
608
0
            // Sentinel = 'aRole'
609
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 985916136)))) {
610
0
                mozilla::ipc::SentinelReadError("Error deserializing 'uint8_t'");
611
0
                return MsgValueError;
612
0
            }
613
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aReason)))))) {
614
0
                FatalError("Error deserializing 'nsresult'");
615
0
                return MsgValueError;
616
0
            }
617
0
            // Sentinel = 'aReason'
618
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 829905706)))) {
619
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
620
0
                return MsgValueError;
621
0
            }
622
0
            (msg__).EndRead(iter__, (msg__).type());
623
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
624
0
                FatalError("Transition error");
625
0
                return MsgValueError;
626
0
            }
627
0
            if ((!(RecvNotifyCloseSessionTransport(aSessionId, aRole, aReason)))) {
628
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
629
0
                // Error handled in mozilla::ipc::IPCResult
630
0
                return MsgProcessingError;
631
0
            }
632
0
633
0
            return MsgProcessed;
634
0
        }
635
0
    case PPresentation::Msg_PPresentationBuilderConstructor__ID:
636
0
        {
637
0
            if (mozilla::ipc::LoggingEnabledFor("PPresentationChild")) {
638
0
                mozilla::ipc::LogMessageForProtocol("PPresentationChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
639
0
            }
640
0
            AUTO_PROFILER_LABEL("PPresentation::Msg_PPresentationBuilderConstructor", OTHER);
641
0
642
0
            PickleIterator iter__(msg__);
643
0
            ActorHandle handle__;
644
0
            PPresentationBuilderChild* actor;
645
0
            nsString aSessionId;
646
0
            uint8_t aRole;
647
0
648
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(handle__)))))) {
649
0
                FatalError("Error deserializing 'ActorHandle'");
650
0
                return MsgValueError;
651
0
            }
652
0
            // Sentinel = 'actor'
653
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
654
0
                mozilla::ipc::SentinelReadError("Error deserializing 'ActorHandle'");
655
0
                return MsgValueError;
656
0
            }
657
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aSessionId)))))) {
658
0
                FatalError("Error deserializing 'nsString'");
659
0
                return MsgValueError;
660
0
            }
661
0
            // Sentinel = 'aSessionId'
662
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 725794242)))) {
663
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
664
0
                return MsgValueError;
665
0
            }
666
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aRole)))))) {
667
0
                FatalError("Error deserializing 'uint8_t'");
668
0
                return MsgValueError;
669
0
            }
670
0
            // Sentinel = 'aRole'
671
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 985916136)))) {
672
0
                mozilla::ipc::SentinelReadError("Error deserializing 'uint8_t'");
673
0
                return MsgValueError;
674
0
            }
675
0
            (msg__).EndRead(iter__, (msg__).type());
676
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
677
0
                FatalError("Transition error");
678
0
                return MsgValueError;
679
0
            }
680
0
            actor = AllocPPresentationBuilderChild(aSessionId, aRole);
681
0
            if ((!(actor))) {
682
0
                NS_WARNING("Error constructing actor PPresentationBuilderChild");
683
0
                return MsgValueError;
684
0
            }
685
0
            (actor)->SetManagerAndRegister(this, (handle__).mId);
686
0
            (mManagedPPresentationBuilderChild).PutEntry(actor);
687
0
            (actor)->mLivenessState = mozilla::ipc::LivenessState::Start;
688
0
689
0
            if ((!(RecvPPresentationBuilderConstructor(actor, aSessionId, aRole)))) {
690
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
691
0
                // Error handled in mozilla::ipc::IPCResult
692
0
                return MsgProcessingError;
693
0
            }
694
0
695
0
            return MsgProcessed;
696
0
        }
697
0
    case PPresentation::Reply___delete____ID:
698
0
        {
699
0
            return MsgProcessed;
700
0
        }
701
0
    case PPresentation::Reply_PPresentationRequestConstructor__ID:
702
0
        {
703
0
            return MsgProcessed;
704
0
        }
705
0
    default:
706
0
        {
707
0
            return MsgNotKnown;
708
0
        }
709
0
    }
710
0
}
711
712
auto PPresentationChild::OnMessageReceived(
713
        const Message& msg__,
714
        Message*& reply__) -> PPresentationChild::Result
715
0
{
716
0
    return MsgNotKnown;
717
0
}
718
719
auto PPresentationChild::OnCallReceived(
720
        const Message& msg__,
721
        Message*& reply__) -> PPresentationChild::Result
722
0
{
723
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
724
0
    return MsgNotKnown;
725
0
}
726
727
auto PPresentationChild::GetProtocolTypeId() -> int32_t
728
0
{
729
0
    return PPresentationMsgStart;
730
0
}
731
732
auto PPresentationChild::DestroySubtree(ActorDestroyReason why) -> void
733
0
{
734
0
    // Unregister from our manager.
735
0
    Unregister(Id());
736
0
737
0
    ActorDestroyReason subtreewhy = (((why) == (Deletion)) || ((why) == (FailedConstructor)) ? AncestorDeletion : why);
738
0
739
0
    {
740
0
        // Recursively shutting down PPresentationBuilder kids
741
0
        nsTArray<PPresentationBuilderChild*> kids;
742
0
        // Accumulate kids into a stable structure to iterate over
743
0
        ManagedPPresentationBuilderChild(kids);
744
0
        for (auto& kid : kids) {
745
0
            // Guarding against a child removing a sibling from the list during the iteration.
746
0
            if ((mManagedPPresentationBuilderChild).Contains(kid)) {
747
0
                (kid)->DestroySubtree(subtreewhy);
748
0
            }
749
0
        }
750
0
    }
751
0
    {
752
0
        // Recursively shutting down PPresentationRequest kids
753
0
        nsTArray<PPresentationRequestChild*> kids;
754
0
        // Accumulate kids into a stable structure to iterate over
755
0
        ManagedPPresentationRequestChild(kids);
756
0
        for (auto& kid : kids) {
757
0
            // Guarding against a child removing a sibling from the list during the iteration.
758
0
            if ((mManagedPPresentationRequestChild).Contains(kid)) {
759
0
                (kid)->DestroySubtree(subtreewhy);
760
0
            }
761
0
        }
762
0
    }
763
0
764
0
    // Reject owning pending responses.
765
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
766
0
767
0
    // Finally, destroy "us".
768
0
    ActorDestroy(why);
769
0
}
770
771
auto PPresentationChild::DeallocSubtree() -> void
772
0
{
773
0
    {
774
0
        // Recursively deleting PPresentationBuilder kids
775
0
        for (auto iter = (mManagedPPresentationBuilderChild).Iter(); (!((iter).Done())); (iter).Next()) {
776
0
            (((iter).Get())->GetKey())->DeallocSubtree();
777
0
        }
778
0
779
0
        for (auto iter = (mManagedPPresentationBuilderChild).Iter(); (!((iter).Done())); (iter).Next()) {
780
0
            DeallocPPresentationBuilderChild(((iter).Get())->GetKey());
781
0
        }
782
0
        (mManagedPPresentationBuilderChild).Clear();
783
0
    }
784
0
    {
785
0
        // Recursively deleting PPresentationRequest kids
786
0
        for (auto iter = (mManagedPPresentationRequestChild).Iter(); (!((iter).Done())); (iter).Next()) {
787
0
            (((iter).Get())->GetKey())->DeallocSubtree();
788
0
        }
789
0
790
0
        for (auto iter = (mManagedPPresentationRequestChild).Iter(); (!((iter).Done())); (iter).Next()) {
791
0
            DeallocPPresentationRequestChild(((iter).Get())->GetKey());
792
0
        }
793
0
        (mManagedPPresentationRequestChild).Clear();
794
0
    }
795
0
}
796
797
798
799
} // namespace dom
800
} // namespace mozilla
801
namespace mozilla {
802
namespace ipc {
803
auto IPDLParamTraits<mozilla::dom::PPresentationChild>::Write(
804
        IPC::Message* aMsg,
805
        mozilla::ipc::IProtocol* aActor,
806
        const paramType& aVar) -> void
807
0
{
808
0
    int32_t id;
809
0
    if ((!(aVar))) {
810
0
        id = 0;
811
0
    }
812
0
    else {
813
0
        id = (aVar)->Id();
814
0
        if ((1) == (id)) {
815
0
            (aActor)->FatalError("actor has been |delete|d");
816
0
        }
817
0
    }
818
0
    WriteIPDLParam(aMsg, aActor, id);
819
0
}
820
821
auto IPDLParamTraits<mozilla::dom::PPresentationChild>::Read(
822
        const IPC::Message* aMsg,
823
        PickleIterator* aIter,
824
        mozilla::ipc::IProtocol* aActor,
825
        paramType* aVar) -> bool
826
0
{
827
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PPresentation", PPresentationMsgStart);
828
0
    if ((actor).isNothing()) {
829
0
        return false;
830
0
    }
831
0
832
0
    (*(aVar)) = static_cast<mozilla::dom::PPresentationChild*>((actor).value());
833
0
    return true;
834
0
}
835
836
} // namespace ipc
837
} // namespace mozilla