Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/IPCStream.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/ipc/PChildToParentStreamParent.h"
8
#include "mozilla/ipc/PChildToParentStreamChild.h"
9
#include "mozilla/ipc/PParentToChildStreamParent.h"
10
#include "mozilla/ipc/PParentToChildStreamChild.h"
11
#include "mozilla/ipc/IPCStream.h"
12
13
14
//-----------------------------------------------------------------------------
15
// Method definitions for the IPDL type |struct InputStreamParamsWithFds|
16
//
17
namespace mozilla {
18
namespace ipc {
19
auto InputStreamParamsWithFds::operator==(const InputStreamParamsWithFds& _o) const -> bool
20
0
{
21
0
    if ((!((stream()) == ((_o).stream())))) {
22
0
        return false;
23
0
    }
24
0
    if ((!((optionalFds()) == ((_o).optionalFds())))) {
25
0
        return false;
26
0
    }
27
0
    return true;
28
0
}
29
30
auto InputStreamParamsWithFds::operator!=(const InputStreamParamsWithFds& _o) const -> bool
31
0
{
32
0
    return (!(operator==(_o)));
33
0
}
34
35
} // namespace ipc
36
} // namespace mozilla
37
38
namespace mozilla {
39
namespace ipc {
40
auto IPDLParamTraits<mozilla::ipc::InputStreamParamsWithFds>::Write(
41
        IPC::Message* aMsg,
42
        mozilla::ipc::IProtocol* aActor,
43
        const paramType& aVar) -> void
44
0
{
45
0
    WriteIPDLParam(aMsg, aActor, (aVar).stream());
46
0
    // Sentinel = 'stream'
47
0
    (aMsg)->WriteSentinel(4152748422);
48
0
    WriteIPDLParam(aMsg, aActor, (aVar).optionalFds());
49
0
    // Sentinel = 'optionalFds'
50
0
    (aMsg)->WriteSentinel(1021803302);
51
0
}
52
53
auto IPDLParamTraits<mozilla::ipc::InputStreamParamsWithFds>::Read(
54
        const IPC::Message* aMsg,
55
        PickleIterator* aIter,
56
        mozilla::ipc::IProtocol* aActor,
57
        paramType* aVar) -> bool
58
0
{
59
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->stream())))))) {
60
0
        (aActor)->FatalError("Error deserializing 'stream' (InputStreamParams) member of 'InputStreamParamsWithFds'");
61
0
        return false;
62
0
    }
63
0
    // Sentinel = 'stream'
64
0
    if ((!((aMsg)->ReadSentinel(aIter, 4152748422)))) {
65
0
        mozilla::ipc::SentinelReadError("Error deserializing 'stream' (InputStreamParams) member of 'InputStreamParamsWithFds'");
66
0
        return false;
67
0
    }
68
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->optionalFds())))))) {
69
0
        (aActor)->FatalError("Error deserializing 'optionalFds' (OptionalFileDescriptorSet) member of 'InputStreamParamsWithFds'");
70
0
        return false;
71
0
    }
72
0
    // Sentinel = 'optionalFds'
73
0
    if ((!((aMsg)->ReadSentinel(aIter, 1021803302)))) {
74
0
        mozilla::ipc::SentinelReadError("Error deserializing 'optionalFds' (OptionalFileDescriptorSet) member of 'InputStreamParamsWithFds'");
75
0
        return false;
76
0
    }
77
0
    return true;
78
0
}
79
80
} // namespace ipc
81
} // namespace mozilla
82
83
//-----------------------------------------------------------------------------
84
// Method definitions for the IPDL type |union IPCRemoteStreamType|
85
//
86
namespace mozilla {
87
namespace ipc {
88
auto IPCRemoteStreamType::MaybeDestroy(Type aNewType) -> bool
89
0
{
90
0
    if ((mType) == (T__None)) {
91
0
        return true;
92
0
    }
93
0
    if ((mType) == (aNewType)) {
94
0
        return false;
95
0
    }
96
0
    switch (mType) {
97
0
    case TPChildToParentStreamParent:
98
0
        {
99
0
            (ptr_PChildToParentStreamParent())->~PChildToParentStreamParent__tdef();
100
0
            break;
101
0
        }
102
0
    case TPChildToParentStreamChild:
103
0
        {
104
0
            (ptr_PChildToParentStreamChild())->~PChildToParentStreamChild__tdef();
105
0
            break;
106
0
        }
107
0
    case TPParentToChildStreamParent:
108
0
        {
109
0
            (ptr_PParentToChildStreamParent())->~PParentToChildStreamParent__tdef();
110
0
            break;
111
0
        }
112
0
    case TPParentToChildStreamChild:
113
0
        {
114
0
            (ptr_PParentToChildStreamChild())->~PParentToChildStreamChild__tdef();
115
0
            break;
116
0
        }
117
0
    default:
118
0
        {
119
0
            mozilla::ipc::LogicError("not reached");
120
0
            break;
121
0
        }
122
0
    }
123
0
    return true;
124
0
}
125
126
MOZ_IMPLICIT IPCRemoteStreamType::IPCRemoteStreamType(PChildToParentStreamParent* aOther)
127
0
{
128
0
    new (mozilla::KnownNotNull, ptr_PChildToParentStreamParent()) PChildToParentStreamParent*(const_cast<PChildToParentStreamParent*>(aOther));
129
0
    mType = TPChildToParentStreamParent;
130
0
}
131
132
MOZ_IMPLICIT IPCRemoteStreamType::IPCRemoteStreamType(PChildToParentStreamChild* aOther)
133
0
{
134
0
    new (mozilla::KnownNotNull, ptr_PChildToParentStreamChild()) PChildToParentStreamChild*(const_cast<PChildToParentStreamChild*>(aOther));
135
0
    mType = TPChildToParentStreamChild;
136
0
}
137
138
MOZ_IMPLICIT IPCRemoteStreamType::IPCRemoteStreamType(PParentToChildStreamParent* aOther)
139
0
{
140
0
    new (mozilla::KnownNotNull, ptr_PParentToChildStreamParent()) PParentToChildStreamParent*(const_cast<PParentToChildStreamParent*>(aOther));
141
0
    mType = TPParentToChildStreamParent;
142
0
}
143
144
MOZ_IMPLICIT IPCRemoteStreamType::IPCRemoteStreamType(PParentToChildStreamChild* aOther)
145
0
{
146
0
    new (mozilla::KnownNotNull, ptr_PParentToChildStreamChild()) PParentToChildStreamChild*(const_cast<PParentToChildStreamChild*>(aOther));
147
0
    mType = TPParentToChildStreamChild;
148
0
}
149
150
MOZ_IMPLICIT IPCRemoteStreamType::IPCRemoteStreamType(const IPCRemoteStreamType& aOther)
151
0
{
152
0
    (aOther).AssertSanity();
153
0
    switch ((aOther).type()) {
154
0
    case TPChildToParentStreamParent:
155
0
        {
156
0
            new (mozilla::KnownNotNull, ptr_PChildToParentStreamParent()) PChildToParentStreamParent*(const_cast<PChildToParentStreamParent*>((aOther).get_PChildToParentStreamParent()));
157
0
            break;
158
0
        }
159
0
    case TPChildToParentStreamChild:
160
0
        {
161
0
            new (mozilla::KnownNotNull, ptr_PChildToParentStreamChild()) PChildToParentStreamChild*(const_cast<PChildToParentStreamChild*>((aOther).get_PChildToParentStreamChild()));
162
0
            break;
163
0
        }
164
0
    case TPParentToChildStreamParent:
165
0
        {
166
0
            new (mozilla::KnownNotNull, ptr_PParentToChildStreamParent()) PParentToChildStreamParent*(const_cast<PParentToChildStreamParent*>((aOther).get_PParentToChildStreamParent()));
167
0
            break;
168
0
        }
169
0
    case TPParentToChildStreamChild:
170
0
        {
171
0
            new (mozilla::KnownNotNull, ptr_PParentToChildStreamChild()) PParentToChildStreamChild*(const_cast<PParentToChildStreamChild*>((aOther).get_PParentToChildStreamChild()));
172
0
            break;
173
0
        }
174
0
    case T__None:
175
0
        {
176
0
            break;
177
0
        }
178
0
    default:
179
0
        {
180
0
            mozilla::ipc::LogicError("unreached");
181
0
            return;
182
0
        }
183
0
    }
184
0
    mType = (aOther).type();
185
0
}
186
187
MOZ_IMPLICIT IPCRemoteStreamType::IPCRemoteStreamType(IPCRemoteStreamType&& aOther)
188
0
{
189
0
    (aOther).AssertSanity();
190
0
    Type t = (aOther).type();
191
0
    switch (t) {
192
0
    case TPChildToParentStreamParent:
193
0
        {
194
0
            new (mozilla::KnownNotNull, ptr_PChildToParentStreamParent()) PChildToParentStreamParent*(const_cast<PChildToParentStreamParent*>(std::move((aOther).get_PChildToParentStreamParent())));
195
0
            static_cast<void>((aOther).MaybeDestroy(T__None));
196
0
            break;
197
0
        }
198
0
    case TPChildToParentStreamChild:
199
0
        {
200
0
            new (mozilla::KnownNotNull, ptr_PChildToParentStreamChild()) PChildToParentStreamChild*(const_cast<PChildToParentStreamChild*>(std::move((aOther).get_PChildToParentStreamChild())));
201
0
            static_cast<void>((aOther).MaybeDestroy(T__None));
202
0
            break;
203
0
        }
204
0
    case TPParentToChildStreamParent:
205
0
        {
206
0
            new (mozilla::KnownNotNull, ptr_PParentToChildStreamParent()) PParentToChildStreamParent*(const_cast<PParentToChildStreamParent*>(std::move((aOther).get_PParentToChildStreamParent())));
207
0
            static_cast<void>((aOther).MaybeDestroy(T__None));
208
0
            break;
209
0
        }
210
0
    case TPParentToChildStreamChild:
211
0
        {
212
0
            new (mozilla::KnownNotNull, ptr_PParentToChildStreamChild()) PParentToChildStreamChild*(const_cast<PParentToChildStreamChild*>(std::move((aOther).get_PParentToChildStreamChild())));
213
0
            static_cast<void>((aOther).MaybeDestroy(T__None));
214
0
            break;
215
0
        }
216
0
    case T__None:
217
0
        {
218
0
            break;
219
0
        }
220
0
    default:
221
0
        {
222
0
            mozilla::ipc::LogicError("unreached");
223
0
            return;
224
0
        }
225
0
    }
226
0
    (aOther).mType = T__None;
227
0
    mType = t;
228
0
}
229
230
IPCRemoteStreamType::~IPCRemoteStreamType()
231
0
{
232
0
    static_cast<void>(MaybeDestroy(T__None));
233
0
}
234
235
auto IPCRemoteStreamType::operator=(PChildToParentStreamParent* aRhs) -> IPCRemoteStreamType&
236
0
{
237
0
    if (MaybeDestroy(TPChildToParentStreamParent)) {
238
0
        new (mozilla::KnownNotNull, ptr_PChildToParentStreamParent()) PChildToParentStreamParent*;
239
0
    }
240
0
    (*(ptr_PChildToParentStreamParent())) = const_cast<PChildToParentStreamParent*>(aRhs);
241
0
    mType = TPChildToParentStreamParent;
242
0
    return (*(this));
243
0
}
244
245
auto IPCRemoteStreamType::operator=(PChildToParentStreamChild* aRhs) -> IPCRemoteStreamType&
246
0
{
247
0
    if (MaybeDestroy(TPChildToParentStreamChild)) {
248
0
        new (mozilla::KnownNotNull, ptr_PChildToParentStreamChild()) PChildToParentStreamChild*;
249
0
    }
250
0
    (*(ptr_PChildToParentStreamChild())) = const_cast<PChildToParentStreamChild*>(aRhs);
251
0
    mType = TPChildToParentStreamChild;
252
0
    return (*(this));
253
0
}
254
255
auto IPCRemoteStreamType::operator=(PParentToChildStreamParent* aRhs) -> IPCRemoteStreamType&
256
0
{
257
0
    if (MaybeDestroy(TPParentToChildStreamParent)) {
258
0
        new (mozilla::KnownNotNull, ptr_PParentToChildStreamParent()) PParentToChildStreamParent*;
259
0
    }
260
0
    (*(ptr_PParentToChildStreamParent())) = const_cast<PParentToChildStreamParent*>(aRhs);
261
0
    mType = TPParentToChildStreamParent;
262
0
    return (*(this));
263
0
}
264
265
auto IPCRemoteStreamType::operator=(PParentToChildStreamChild* aRhs) -> IPCRemoteStreamType&
266
0
{
267
0
    if (MaybeDestroy(TPParentToChildStreamChild)) {
268
0
        new (mozilla::KnownNotNull, ptr_PParentToChildStreamChild()) PParentToChildStreamChild*;
269
0
    }
270
0
    (*(ptr_PParentToChildStreamChild())) = const_cast<PParentToChildStreamChild*>(aRhs);
271
0
    mType = TPParentToChildStreamChild;
272
0
    return (*(this));
273
0
}
274
275
auto IPCRemoteStreamType::operator=(const IPCRemoteStreamType& aRhs) -> IPCRemoteStreamType&
276
0
{
277
0
    (aRhs).AssertSanity();
278
0
    Type t = (aRhs).type();
279
0
    switch (t) {
280
0
    case TPChildToParentStreamParent:
281
0
        {
282
0
            if (MaybeDestroy(t)) {
283
0
                new (mozilla::KnownNotNull, ptr_PChildToParentStreamParent()) PChildToParentStreamParent*;
284
0
            }
285
0
            (*(ptr_PChildToParentStreamParent())) = const_cast<PChildToParentStreamParent*>((aRhs).get_PChildToParentStreamParent());
286
0
            break;
287
0
        }
288
0
    case TPChildToParentStreamChild:
289
0
        {
290
0
            if (MaybeDestroy(t)) {
291
0
                new (mozilla::KnownNotNull, ptr_PChildToParentStreamChild()) PChildToParentStreamChild*;
292
0
            }
293
0
            (*(ptr_PChildToParentStreamChild())) = const_cast<PChildToParentStreamChild*>((aRhs).get_PChildToParentStreamChild());
294
0
            break;
295
0
        }
296
0
    case TPParentToChildStreamParent:
297
0
        {
298
0
            if (MaybeDestroy(t)) {
299
0
                new (mozilla::KnownNotNull, ptr_PParentToChildStreamParent()) PParentToChildStreamParent*;
300
0
            }
301
0
            (*(ptr_PParentToChildStreamParent())) = const_cast<PParentToChildStreamParent*>((aRhs).get_PParentToChildStreamParent());
302
0
            break;
303
0
        }
304
0
    case TPParentToChildStreamChild:
305
0
        {
306
0
            if (MaybeDestroy(t)) {
307
0
                new (mozilla::KnownNotNull, ptr_PParentToChildStreamChild()) PParentToChildStreamChild*;
308
0
            }
309
0
            (*(ptr_PParentToChildStreamChild())) = const_cast<PParentToChildStreamChild*>((aRhs).get_PParentToChildStreamChild());
310
0
            break;
311
0
        }
312
0
    case T__None:
313
0
        {
314
0
            static_cast<void>(MaybeDestroy(t));
315
0
            break;
316
0
        }
317
0
    default:
318
0
        {
319
0
            mozilla::ipc::LogicError("unreached");
320
0
            break;
321
0
        }
322
0
    }
323
0
    mType = t;
324
0
    return (*(this));
325
0
}
326
327
auto IPCRemoteStreamType::operator=(IPCRemoteStreamType&& aRhs) -> IPCRemoteStreamType&
328
0
{
329
0
    (aRhs).AssertSanity();
330
0
    Type t = (aRhs).type();
331
0
    switch (t) {
332
0
    case TPChildToParentStreamParent:
333
0
        {
334
0
            if (MaybeDestroy(t)) {
335
0
                new (mozilla::KnownNotNull, ptr_PChildToParentStreamParent()) PChildToParentStreamParent*;
336
0
            }
337
0
            (*(ptr_PChildToParentStreamParent())) = const_cast<PChildToParentStreamParent*>(std::move((aRhs).get_PChildToParentStreamParent()));
338
0
            static_cast<void>((aRhs).MaybeDestroy(T__None));
339
0
            break;
340
0
        }
341
0
    case TPChildToParentStreamChild:
342
0
        {
343
0
            if (MaybeDestroy(t)) {
344
0
                new (mozilla::KnownNotNull, ptr_PChildToParentStreamChild()) PChildToParentStreamChild*;
345
0
            }
346
0
            (*(ptr_PChildToParentStreamChild())) = const_cast<PChildToParentStreamChild*>(std::move((aRhs).get_PChildToParentStreamChild()));
347
0
            static_cast<void>((aRhs).MaybeDestroy(T__None));
348
0
            break;
349
0
        }
350
0
    case TPParentToChildStreamParent:
351
0
        {
352
0
            if (MaybeDestroy(t)) {
353
0
                new (mozilla::KnownNotNull, ptr_PParentToChildStreamParent()) PParentToChildStreamParent*;
354
0
            }
355
0
            (*(ptr_PParentToChildStreamParent())) = const_cast<PParentToChildStreamParent*>(std::move((aRhs).get_PParentToChildStreamParent()));
356
0
            static_cast<void>((aRhs).MaybeDestroy(T__None));
357
0
            break;
358
0
        }
359
0
    case TPParentToChildStreamChild:
360
0
        {
361
0
            if (MaybeDestroy(t)) {
362
0
                new (mozilla::KnownNotNull, ptr_PParentToChildStreamChild()) PParentToChildStreamChild*;
363
0
            }
364
0
            (*(ptr_PParentToChildStreamChild())) = const_cast<PParentToChildStreamChild*>(std::move((aRhs).get_PParentToChildStreamChild()));
365
0
            static_cast<void>((aRhs).MaybeDestroy(T__None));
366
0
            break;
367
0
        }
368
0
    case T__None:
369
0
        {
370
0
            static_cast<void>(MaybeDestroy(t));
371
0
            break;
372
0
        }
373
0
    default:
374
0
        {
375
0
            mozilla::ipc::LogicError("unreached");
376
0
            break;
377
0
        }
378
0
    }
379
0
    (aRhs).mType = T__None;
380
0
    mType = t;
381
0
    return (*(this));
382
0
}
383
384
auto IPCRemoteStreamType::operator==(PChildToParentStreamParent* aRhs) const -> bool
385
0
{
386
0
    return (get_PChildToParentStreamParent()) == (aRhs);
387
0
}
388
389
auto IPCRemoteStreamType::operator==(PChildToParentStreamChild* aRhs) const -> bool
390
0
{
391
0
    return (get_PChildToParentStreamChild()) == (aRhs);
392
0
}
393
394
auto IPCRemoteStreamType::operator==(PParentToChildStreamParent* aRhs) const -> bool
395
0
{
396
0
    return (get_PParentToChildStreamParent()) == (aRhs);
397
0
}
398
399
auto IPCRemoteStreamType::operator==(PParentToChildStreamChild* aRhs) const -> bool
400
0
{
401
0
    return (get_PParentToChildStreamChild()) == (aRhs);
402
0
}
403
404
auto IPCRemoteStreamType::operator==(const IPCRemoteStreamType& aRhs) const -> bool
405
0
{
406
0
    if ((type()) != ((aRhs).type())) {
407
0
        return false;
408
0
    }
409
0
410
0
    switch (type()) {
411
0
    case TPChildToParentStreamParent:
412
0
        {
413
0
            return (get_PChildToParentStreamParent()) == ((aRhs).get_PChildToParentStreamParent());
414
0
        }
415
0
    case TPChildToParentStreamChild:
416
0
        {
417
0
            return (get_PChildToParentStreamChild()) == ((aRhs).get_PChildToParentStreamChild());
418
0
        }
419
0
    case TPParentToChildStreamParent:
420
0
        {
421
0
            return (get_PParentToChildStreamParent()) == ((aRhs).get_PParentToChildStreamParent());
422
0
        }
423
0
    case TPParentToChildStreamChild:
424
0
        {
425
0
            return (get_PParentToChildStreamChild()) == ((aRhs).get_PParentToChildStreamChild());
426
0
        }
427
0
    default:
428
0
        {
429
0
            mozilla::ipc::LogicError("unreached");
430
0
            return false;
431
0
        }
432
0
    }
433
0
}
434
435
auto IPCRemoteStreamType::get(PChildToParentStreamParent** aOutValue) const -> void
436
0
{
437
0
    (*(aOutValue)) = get_PChildToParentStreamParent();
438
0
}
439
440
auto IPCRemoteStreamType::get(PChildToParentStreamChild** aOutValue) const -> void
441
0
{
442
0
    (*(aOutValue)) = get_PChildToParentStreamChild();
443
0
}
444
445
auto IPCRemoteStreamType::get(PParentToChildStreamParent** aOutValue) const -> void
446
0
{
447
0
    (*(aOutValue)) = get_PParentToChildStreamParent();
448
0
}
449
450
auto IPCRemoteStreamType::get(PParentToChildStreamChild** aOutValue) const -> void
451
0
{
452
0
    (*(aOutValue)) = get_PParentToChildStreamChild();
453
0
}
454
455
} // namespace ipc
456
} // namespace mozilla
457
458
namespace mozilla {
459
namespace ipc {
460
auto IPDLParamTraits<mozilla::ipc::IPCRemoteStreamType>::Write(
461
        IPC::Message* aMsg,
462
        mozilla::ipc::IProtocol* aActor,
463
        const paramType& aVar) -> void
464
0
{
465
0
    typedef mozilla::ipc::IPCRemoteStreamType union__;
466
0
    int type;
467
0
    type = (aVar).type();
468
0
    WriteIPDLParam(aMsg, aActor, type);
469
0
    // Sentinel = 'IPCRemoteStreamType'
470
0
    (aMsg)->WriteSentinel(391674895);
471
0
472
0
    switch (type) {
473
0
    case union__::TPChildToParentStreamParent:
474
0
        {
475
0
            if ((mozilla::ipc::ParentSide) == ((aActor)->GetSide())) {
476
0
                MOZ_RELEASE_ASSERT((aVar).get_PChildToParentStreamParent(), "NULL actor value passed to non-nullable param");
477
0
                WriteIPDLParam(aMsg, aActor, (aVar).get_PChildToParentStreamParent());
478
0
                // Sentinel = 'TPChildToParentStreamParent'
479
0
                (aMsg)->WriteSentinel(2724777622);
480
0
            }
481
0
            else {
482
0
                (aActor)->FatalError("wrong side!");
483
0
            }
484
0
            return;
485
0
        }
486
0
    case union__::TPChildToParentStreamChild:
487
0
        {
488
0
            if ((mozilla::ipc::ChildSide) == ((aActor)->GetSide())) {
489
0
                MOZ_RELEASE_ASSERT((aVar).get_PChildToParentStreamChild(), "NULL actor value passed to non-nullable param");
490
0
                WriteIPDLParam(aMsg, aActor, (aVar).get_PChildToParentStreamChild());
491
0
                // Sentinel = 'TPChildToParentStreamChild'
492
0
                (aMsg)->WriteSentinel(1882094295);
493
0
            }
494
0
            else {
495
0
                (aActor)->FatalError("wrong side!");
496
0
            }
497
0
            return;
498
0
        }
499
0
    case union__::TPParentToChildStreamParent:
500
0
        {
501
0
            if ((mozilla::ipc::ParentSide) == ((aActor)->GetSide())) {
502
0
                MOZ_RELEASE_ASSERT((aVar).get_PParentToChildStreamParent(), "NULL actor value passed to non-nullable param");
503
0
                WriteIPDLParam(aMsg, aActor, (aVar).get_PParentToChildStreamParent());
504
0
                // Sentinel = 'TPParentToChildStreamParent'
505
0
                (aMsg)->WriteSentinel(3335986876);
506
0
            }
507
0
            else {
508
0
                (aActor)->FatalError("wrong side!");
509
0
            }
510
0
            return;
511
0
        }
512
0
    case union__::TPParentToChildStreamChild:
513
0
        {
514
0
            if ((mozilla::ipc::ChildSide) == ((aActor)->GetSide())) {
515
0
                MOZ_RELEASE_ASSERT((aVar).get_PParentToChildStreamChild(), "NULL actor value passed to non-nullable param");
516
0
                WriteIPDLParam(aMsg, aActor, (aVar).get_PParentToChildStreamChild());
517
0
                // Sentinel = 'TPParentToChildStreamChild'
518
0
                (aMsg)->WriteSentinel(190098493);
519
0
            }
520
0
            else {
521
0
                (aActor)->FatalError("wrong side!");
522
0
            }
523
0
            return;
524
0
        }
525
0
    default:
526
0
        {
527
0
            (aActor)->FatalError("unknown union type");
528
0
            return;
529
0
        }
530
0
    }
531
0
}
532
533
auto IPDLParamTraits<mozilla::ipc::IPCRemoteStreamType>::Read(
534
        const IPC::Message* aMsg,
535
        PickleIterator* aIter,
536
        mozilla::ipc::IProtocol* aActor,
537
        paramType* aVar) -> bool
538
0
{
539
0
    typedef mozilla::ipc::IPCRemoteStreamType union__;
540
0
    int type;
541
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&(type)))))) {
542
0
        (aActor)->FatalError("Error deserializing type of union IPCRemoteStreamType");
543
0
        return false;
544
0
    }
545
0
    // Sentinel = 'IPCRemoteStreamType'
546
0
    if ((!((aMsg)->ReadSentinel(aIter, 391674895)))) {
547
0
        mozilla::ipc::SentinelReadError("Error deserializing type of union IPCRemoteStreamType");
548
0
        return false;
549
0
    }
550
0
551
0
    switch (type) {
552
0
    case union__::TPChildToParentStreamParent:
553
0
        {
554
0
            if ((mozilla::ipc::ParentSide) == ((aActor)->GetSide())) {
555
0
                {
556
0
                    (aActor)->FatalError("wrong side!");
557
0
                    return false;
558
0
                }
559
0
            }
560
0
            mozilla::ipc::PChildToParentStreamChild* tmp = nullptr;
561
0
            (*(aVar)) = tmp;
562
0
            if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_PChildToParentStreamChild())))))) {
563
0
                (aActor)->FatalError("Error deserializing variant TPChildToParentStreamParent of union IPCRemoteStreamType");
564
0
                return false;
565
0
            }
566
0
            if ((!((*((&((aVar)->get_PChildToParentStreamChild()))))))) {
567
0
                (aActor)->FatalError("Error deserializing variant TPChildToParentStreamParent of union IPCRemoteStreamType");
568
0
                return false;
569
0
            }
570
0
            // Sentinel = 'TPChildToParentStreamParent'
571
0
            if ((!((aMsg)->ReadSentinel(aIter, 2724777622)))) {
572
0
                mozilla::ipc::SentinelReadError("Error deserializing variant TPChildToParentStreamParent of union IPCRemoteStreamType");
573
0
                return false;
574
0
            }
575
0
            return true;
576
0
        }
577
0
    case union__::TPChildToParentStreamChild:
578
0
        {
579
0
            if ((mozilla::ipc::ChildSide) == ((aActor)->GetSide())) {
580
0
                {
581
0
                    (aActor)->FatalError("wrong side!");
582
0
                    return false;
583
0
                }
584
0
            }
585
0
            mozilla::ipc::PChildToParentStreamParent* tmp = nullptr;
586
0
            (*(aVar)) = tmp;
587
0
            if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_PChildToParentStreamParent())))))) {
588
0
                (aActor)->FatalError("Error deserializing variant TPChildToParentStreamChild of union IPCRemoteStreamType");
589
0
                return false;
590
0
            }
591
0
            if ((!((*((&((aVar)->get_PChildToParentStreamParent()))))))) {
592
0
                (aActor)->FatalError("Error deserializing variant TPChildToParentStreamChild of union IPCRemoteStreamType");
593
0
                return false;
594
0
            }
595
0
            // Sentinel = 'TPChildToParentStreamChild'
596
0
            if ((!((aMsg)->ReadSentinel(aIter, 1882094295)))) {
597
0
                mozilla::ipc::SentinelReadError("Error deserializing variant TPChildToParentStreamChild of union IPCRemoteStreamType");
598
0
                return false;
599
0
            }
600
0
            return true;
601
0
        }
602
0
    case union__::TPParentToChildStreamParent:
603
0
        {
604
0
            if ((mozilla::ipc::ParentSide) == ((aActor)->GetSide())) {
605
0
                {
606
0
                    (aActor)->FatalError("wrong side!");
607
0
                    return false;
608
0
                }
609
0
            }
610
0
            mozilla::ipc::PParentToChildStreamChild* tmp = nullptr;
611
0
            (*(aVar)) = tmp;
612
0
            if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_PParentToChildStreamChild())))))) {
613
0
                (aActor)->FatalError("Error deserializing variant TPParentToChildStreamParent of union IPCRemoteStreamType");
614
0
                return false;
615
0
            }
616
0
            if ((!((*((&((aVar)->get_PParentToChildStreamChild()))))))) {
617
0
                (aActor)->FatalError("Error deserializing variant TPParentToChildStreamParent of union IPCRemoteStreamType");
618
0
                return false;
619
0
            }
620
0
            // Sentinel = 'TPParentToChildStreamParent'
621
0
            if ((!((aMsg)->ReadSentinel(aIter, 3335986876)))) {
622
0
                mozilla::ipc::SentinelReadError("Error deserializing variant TPParentToChildStreamParent of union IPCRemoteStreamType");
623
0
                return false;
624
0
            }
625
0
            return true;
626
0
        }
627
0
    case union__::TPParentToChildStreamChild:
628
0
        {
629
0
            if ((mozilla::ipc::ChildSide) == ((aActor)->GetSide())) {
630
0
                {
631
0
                    (aActor)->FatalError("wrong side!");
632
0
                    return false;
633
0
                }
634
0
            }
635
0
            mozilla::ipc::PParentToChildStreamParent* tmp = nullptr;
636
0
            (*(aVar)) = tmp;
637
0
            if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_PParentToChildStreamParent())))))) {
638
0
                (aActor)->FatalError("Error deserializing variant TPParentToChildStreamChild of union IPCRemoteStreamType");
639
0
                return false;
640
0
            }
641
0
            if ((!((*((&((aVar)->get_PParentToChildStreamParent()))))))) {
642
0
                (aActor)->FatalError("Error deserializing variant TPParentToChildStreamChild of union IPCRemoteStreamType");
643
0
                return false;
644
0
            }
645
0
            // Sentinel = 'TPParentToChildStreamChild'
646
0
            if ((!((aMsg)->ReadSentinel(aIter, 190098493)))) {
647
0
                mozilla::ipc::SentinelReadError("Error deserializing variant TPParentToChildStreamChild of union IPCRemoteStreamType");
648
0
                return false;
649
0
            }
650
0
            return true;
651
0
        }
652
0
    default:
653
0
        {
654
0
            (aActor)->FatalError("unknown union type");
655
0
            return false;
656
0
        }
657
0
    }
658
0
}
659
660
} // namespace ipc
661
} // namespace mozilla
662
663
//-----------------------------------------------------------------------------
664
// Method definitions for the IPDL type |struct IPCRemoteStream|
665
//
666
namespace mozilla {
667
namespace ipc {
668
auto IPCRemoteStream::operator==(const IPCRemoteStream& _o) const -> bool
669
0
{
670
0
    if ((!((delayedStart()) == ((_o).delayedStart())))) {
671
0
        return false;
672
0
    }
673
0
    if ((!((stream()) == ((_o).stream())))) {
674
0
        return false;
675
0
    }
676
0
    if ((!((length()) == ((_o).length())))) {
677
0
        return false;
678
0
    }
679
0
    return true;
680
0
}
681
682
auto IPCRemoteStream::operator!=(const IPCRemoteStream& _o) const -> bool
683
0
{
684
0
    return (!(operator==(_o)));
685
0
}
686
687
} // namespace ipc
688
} // namespace mozilla
689
690
namespace mozilla {
691
namespace ipc {
692
auto IPDLParamTraits<mozilla::ipc::IPCRemoteStream>::Write(
693
        IPC::Message* aMsg,
694
        mozilla::ipc::IProtocol* aActor,
695
        const paramType& aVar) -> void
696
0
{
697
0
    WriteIPDLParam(aMsg, aActor, (aVar).delayedStart());
698
0
    // Sentinel = 'delayedStart'
699
0
    (aMsg)->WriteSentinel(1491822294);
700
0
    WriteIPDLParam(aMsg, aActor, (aVar).stream());
701
0
    // Sentinel = 'stream'
702
0
    (aMsg)->WriteSentinel(4152748422);
703
0
    WriteIPDLParam(aMsg, aActor, (aVar).length());
704
0
    // Sentinel = 'length'
705
0
    (aMsg)->WriteSentinel(1726618354);
706
0
}
707
708
auto IPDLParamTraits<mozilla::ipc::IPCRemoteStream>::Read(
709
        const IPC::Message* aMsg,
710
        PickleIterator* aIter,
711
        mozilla::ipc::IProtocol* aActor,
712
        paramType* aVar) -> bool
713
0
{
714
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->delayedStart())))))) {
715
0
        (aActor)->FatalError("Error deserializing 'delayedStart' (bool) member of 'IPCRemoteStream'");
716
0
        return false;
717
0
    }
718
0
    // Sentinel = 'delayedStart'
719
0
    if ((!((aMsg)->ReadSentinel(aIter, 1491822294)))) {
720
0
        mozilla::ipc::SentinelReadError("Error deserializing 'delayedStart' (bool) member of 'IPCRemoteStream'");
721
0
        return false;
722
0
    }
723
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->stream())))))) {
724
0
        (aActor)->FatalError("Error deserializing 'stream' (IPCRemoteStreamType) member of 'IPCRemoteStream'");
725
0
        return false;
726
0
    }
727
0
    // Sentinel = 'stream'
728
0
    if ((!((aMsg)->ReadSentinel(aIter, 4152748422)))) {
729
0
        mozilla::ipc::SentinelReadError("Error deserializing 'stream' (IPCRemoteStreamType) member of 'IPCRemoteStream'");
730
0
        return false;
731
0
    }
732
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->length())))))) {
733
0
        (aActor)->FatalError("Error deserializing 'length' (int64_t) member of 'IPCRemoteStream'");
734
0
        return false;
735
0
    }
736
0
    // Sentinel = 'length'
737
0
    if ((!((aMsg)->ReadSentinel(aIter, 1726618354)))) {
738
0
        mozilla::ipc::SentinelReadError("Error deserializing 'length' (int64_t) member of 'IPCRemoteStream'");
739
0
        return false;
740
0
    }
741
0
    return true;
742
0
}
743
744
} // namespace ipc
745
} // namespace mozilla
746
747
//-----------------------------------------------------------------------------
748
// Method definitions for the IPDL type |union IPCStream|
749
//
750
namespace mozilla {
751
namespace ipc {
752
auto IPCStream::MaybeDestroy(Type aNewType) -> bool
753
0
{
754
0
    if ((mType) == (T__None)) {
755
0
        return true;
756
0
    }
757
0
    if ((mType) == (aNewType)) {
758
0
        return false;
759
0
    }
760
0
    switch (mType) {
761
0
    case TInputStreamParamsWithFds:
762
0
        {
763
0
            (ptr_InputStreamParamsWithFds())->~InputStreamParamsWithFds__tdef();
764
0
            break;
765
0
        }
766
0
    case TIPCRemoteStream:
767
0
        {
768
0
            (ptr_IPCRemoteStream())->~IPCRemoteStream__tdef();
769
0
            break;
770
0
        }
771
0
    default:
772
0
        {
773
0
            mozilla::ipc::LogicError("not reached");
774
0
            break;
775
0
        }
776
0
    }
777
0
    return true;
778
0
}
779
780
MOZ_IMPLICIT IPCStream::IPCStream(const InputStreamParamsWithFds& aOther)
781
0
{
782
0
    new (mozilla::KnownNotNull, ptr_InputStreamParamsWithFds()) InputStreamParamsWithFds(aOther);
783
0
    mType = TInputStreamParamsWithFds;
784
0
}
785
786
MOZ_IMPLICIT IPCStream::IPCStream(InputStreamParamsWithFds&& aOther)
787
0
{
788
0
    new (mozilla::KnownNotNull, ptr_InputStreamParamsWithFds()) InputStreamParamsWithFds(std::move(aOther));
789
0
    mType = TInputStreamParamsWithFds;
790
0
}
791
792
MOZ_IMPLICIT IPCStream::IPCStream(const IPCRemoteStream& aOther)
793
0
{
794
0
    new (mozilla::KnownNotNull, ptr_IPCRemoteStream()) IPCRemoteStream(aOther);
795
0
    mType = TIPCRemoteStream;
796
0
}
797
798
MOZ_IMPLICIT IPCStream::IPCStream(IPCRemoteStream&& aOther)
799
0
{
800
0
    new (mozilla::KnownNotNull, ptr_IPCRemoteStream()) IPCRemoteStream(std::move(aOther));
801
0
    mType = TIPCRemoteStream;
802
0
}
803
804
MOZ_IMPLICIT IPCStream::IPCStream(const IPCStream& aOther)
805
0
{
806
0
    (aOther).AssertSanity();
807
0
    switch ((aOther).type()) {
808
0
    case TInputStreamParamsWithFds:
809
0
        {
810
0
            new (mozilla::KnownNotNull, ptr_InputStreamParamsWithFds()) InputStreamParamsWithFds((aOther).get_InputStreamParamsWithFds());
811
0
            break;
812
0
        }
813
0
    case TIPCRemoteStream:
814
0
        {
815
0
            new (mozilla::KnownNotNull, ptr_IPCRemoteStream()) IPCRemoteStream((aOther).get_IPCRemoteStream());
816
0
            break;
817
0
        }
818
0
    case T__None:
819
0
        {
820
0
            break;
821
0
        }
822
0
    default:
823
0
        {
824
0
            mozilla::ipc::LogicError("unreached");
825
0
            return;
826
0
        }
827
0
    }
828
0
    mType = (aOther).type();
829
0
}
830
831
MOZ_IMPLICIT IPCStream::IPCStream(IPCStream&& aOther)
832
0
{
833
0
    (aOther).AssertSanity();
834
0
    Type t = (aOther).type();
835
0
    switch (t) {
836
0
    case TInputStreamParamsWithFds:
837
0
        {
838
0
            new (mozilla::KnownNotNull, ptr_InputStreamParamsWithFds()) InputStreamParamsWithFds(std::move((aOther).get_InputStreamParamsWithFds()));
839
0
            static_cast<void>((aOther).MaybeDestroy(T__None));
840
0
            break;
841
0
        }
842
0
    case TIPCRemoteStream:
843
0
        {
844
0
            new (mozilla::KnownNotNull, ptr_IPCRemoteStream()) IPCRemoteStream(std::move((aOther).get_IPCRemoteStream()));
845
0
            static_cast<void>((aOther).MaybeDestroy(T__None));
846
0
            break;
847
0
        }
848
0
    case T__None:
849
0
        {
850
0
            break;
851
0
        }
852
0
    default:
853
0
        {
854
0
            mozilla::ipc::LogicError("unreached");
855
0
            return;
856
0
        }
857
0
    }
858
0
    (aOther).mType = T__None;
859
0
    mType = t;
860
0
}
861
862
IPCStream::~IPCStream()
863
0
{
864
0
    static_cast<void>(MaybeDestroy(T__None));
865
0
}
866
867
auto IPCStream::operator=(const InputStreamParamsWithFds& aRhs) -> IPCStream&
868
0
{
869
0
    if (MaybeDestroy(TInputStreamParamsWithFds)) {
870
0
        new (mozilla::KnownNotNull, ptr_InputStreamParamsWithFds()) InputStreamParamsWithFds;
871
0
    }
872
0
    (*(ptr_InputStreamParamsWithFds())) = aRhs;
873
0
    mType = TInputStreamParamsWithFds;
874
0
    return (*(this));
875
0
}
876
877
auto IPCStream::operator=(InputStreamParamsWithFds&& aRhs) -> IPCStream&
878
0
{
879
0
    if (MaybeDestroy(TInputStreamParamsWithFds)) {
880
0
        new (mozilla::KnownNotNull, ptr_InputStreamParamsWithFds()) InputStreamParamsWithFds;
881
0
    }
882
0
    (*(ptr_InputStreamParamsWithFds())) = std::move(aRhs);
883
0
    mType = TInputStreamParamsWithFds;
884
0
    return (*(this));
885
0
}
886
887
auto IPCStream::operator=(const IPCRemoteStream& aRhs) -> IPCStream&
888
0
{
889
0
    if (MaybeDestroy(TIPCRemoteStream)) {
890
0
        new (mozilla::KnownNotNull, ptr_IPCRemoteStream()) IPCRemoteStream;
891
0
    }
892
0
    (*(ptr_IPCRemoteStream())) = aRhs;
893
0
    mType = TIPCRemoteStream;
894
0
    return (*(this));
895
0
}
896
897
auto IPCStream::operator=(IPCRemoteStream&& aRhs) -> IPCStream&
898
0
{
899
0
    if (MaybeDestroy(TIPCRemoteStream)) {
900
0
        new (mozilla::KnownNotNull, ptr_IPCRemoteStream()) IPCRemoteStream;
901
0
    }
902
0
    (*(ptr_IPCRemoteStream())) = std::move(aRhs);
903
0
    mType = TIPCRemoteStream;
904
0
    return (*(this));
905
0
}
906
907
auto IPCStream::operator=(const IPCStream& aRhs) -> IPCStream&
908
0
{
909
0
    (aRhs).AssertSanity();
910
0
    Type t = (aRhs).type();
911
0
    switch (t) {
912
0
    case TInputStreamParamsWithFds:
913
0
        {
914
0
            if (MaybeDestroy(t)) {
915
0
                new (mozilla::KnownNotNull, ptr_InputStreamParamsWithFds()) InputStreamParamsWithFds;
916
0
            }
917
0
            (*(ptr_InputStreamParamsWithFds())) = (aRhs).get_InputStreamParamsWithFds();
918
0
            break;
919
0
        }
920
0
    case TIPCRemoteStream:
921
0
        {
922
0
            if (MaybeDestroy(t)) {
923
0
                new (mozilla::KnownNotNull, ptr_IPCRemoteStream()) IPCRemoteStream;
924
0
            }
925
0
            (*(ptr_IPCRemoteStream())) = (aRhs).get_IPCRemoteStream();
926
0
            break;
927
0
        }
928
0
    case T__None:
929
0
        {
930
0
            static_cast<void>(MaybeDestroy(t));
931
0
            break;
932
0
        }
933
0
    default:
934
0
        {
935
0
            mozilla::ipc::LogicError("unreached");
936
0
            break;
937
0
        }
938
0
    }
939
0
    mType = t;
940
0
    return (*(this));
941
0
}
942
943
auto IPCStream::operator=(IPCStream&& aRhs) -> IPCStream&
944
0
{
945
0
    (aRhs).AssertSanity();
946
0
    Type t = (aRhs).type();
947
0
    switch (t) {
948
0
    case TInputStreamParamsWithFds:
949
0
        {
950
0
            if (MaybeDestroy(t)) {
951
0
                new (mozilla::KnownNotNull, ptr_InputStreamParamsWithFds()) InputStreamParamsWithFds;
952
0
            }
953
0
            (*(ptr_InputStreamParamsWithFds())) = std::move((aRhs).get_InputStreamParamsWithFds());
954
0
            static_cast<void>((aRhs).MaybeDestroy(T__None));
955
0
            break;
956
0
        }
957
0
    case TIPCRemoteStream:
958
0
        {
959
0
            if (MaybeDestroy(t)) {
960
0
                new (mozilla::KnownNotNull, ptr_IPCRemoteStream()) IPCRemoteStream;
961
0
            }
962
0
            (*(ptr_IPCRemoteStream())) = std::move((aRhs).get_IPCRemoteStream());
963
0
            static_cast<void>((aRhs).MaybeDestroy(T__None));
964
0
            break;
965
0
        }
966
0
    case T__None:
967
0
        {
968
0
            static_cast<void>(MaybeDestroy(t));
969
0
            break;
970
0
        }
971
0
    default:
972
0
        {
973
0
            mozilla::ipc::LogicError("unreached");
974
0
            break;
975
0
        }
976
0
    }
977
0
    (aRhs).mType = T__None;
978
0
    mType = t;
979
0
    return (*(this));
980
0
}
981
982
auto IPCStream::operator==(const InputStreamParamsWithFds& aRhs) const -> bool
983
0
{
984
0
    return (get_InputStreamParamsWithFds()) == (aRhs);
985
0
}
986
987
auto IPCStream::operator==(const IPCRemoteStream& aRhs) const -> bool
988
0
{
989
0
    return (get_IPCRemoteStream()) == (aRhs);
990
0
}
991
992
auto IPCStream::operator==(const IPCStream& aRhs) const -> bool
993
0
{
994
0
    if ((type()) != ((aRhs).type())) {
995
0
        return false;
996
0
    }
997
0
998
0
    switch (type()) {
999
0
    case TInputStreamParamsWithFds:
1000
0
        {
1001
0
            return (get_InputStreamParamsWithFds()) == ((aRhs).get_InputStreamParamsWithFds());
1002
0
        }
1003
0
    case TIPCRemoteStream:
1004
0
        {
1005
0
            return (get_IPCRemoteStream()) == ((aRhs).get_IPCRemoteStream());
1006
0
        }
1007
0
    default:
1008
0
        {
1009
0
            mozilla::ipc::LogicError("unreached");
1010
0
            return false;
1011
0
        }
1012
0
    }
1013
0
}
1014
1015
auto IPCStream::get(InputStreamParamsWithFds* aOutValue) const -> void
1016
0
{
1017
0
    (*(aOutValue)) = get_InputStreamParamsWithFds();
1018
0
}
1019
1020
auto IPCStream::get(IPCRemoteStream* aOutValue) const -> void
1021
0
{
1022
0
    (*(aOutValue)) = get_IPCRemoteStream();
1023
0
}
1024
1025
} // namespace ipc
1026
} // namespace mozilla
1027
1028
namespace mozilla {
1029
namespace ipc {
1030
auto IPDLParamTraits<mozilla::ipc::IPCStream>::Write(
1031
        IPC::Message* aMsg,
1032
        mozilla::ipc::IProtocol* aActor,
1033
        const paramType& aVar) -> void
1034
{
1035
    typedef mozilla::ipc::IPCStream union__;
1036
    int type;
1037
    type = (aVar).type();
1038
    WriteIPDLParam(aMsg, aActor, type);
1039
    // Sentinel = 'IPCStream'
1040
    (aMsg)->WriteSentinel(442610715);
1041
1042
    switch (type) {
1043
    case union__::TInputStreamParamsWithFds:
1044
        {
1045
            WriteIPDLParam(aMsg, aActor, (aVar).get_InputStreamParamsWithFds());
1046
            // Sentinel = 'TInputStreamParamsWithFds'
1047
            (aMsg)->WriteSentinel(2170706066);
1048
            return;
1049
        }
1050
    case union__::TIPCRemoteStream:
1051
        {
1052
            WriteIPDLParam(aMsg, aActor, (aVar).get_IPCRemoteStream());
1053
            // Sentinel = 'TIPCRemoteStream'
1054
            (aMsg)->WriteSentinel(2978132448);
1055
            return;
1056
        }
1057
    default:
1058
        {
1059
            (aActor)->FatalError("unknown union type");
1060
            return;
1061
        }
1062
    }
1063
}
1064
1065
auto IPDLParamTraits<mozilla::ipc::IPCStream>::Read(
1066
        const IPC::Message* aMsg,
1067
        PickleIterator* aIter,
1068
        mozilla::ipc::IProtocol* aActor,
1069
        paramType* aVar) -> bool
1070
0
{
1071
0
    typedef mozilla::ipc::IPCStream union__;
1072
0
    int type;
1073
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&(type)))))) {
1074
0
        (aActor)->FatalError("Error deserializing type of union IPCStream");
1075
0
        return false;
1076
0
    }
1077
0
    // Sentinel = 'IPCStream'
1078
0
    if ((!((aMsg)->ReadSentinel(aIter, 442610715)))) {
1079
0
        mozilla::ipc::SentinelReadError("Error deserializing type of union IPCStream");
1080
0
        return false;
1081
0
    }
1082
0
1083
0
    switch (type) {
1084
0
    case union__::TInputStreamParamsWithFds:
1085
0
        {
1086
0
            mozilla::ipc::InputStreamParamsWithFds tmp = mozilla::ipc::InputStreamParamsWithFds();
1087
0
            (*(aVar)) = tmp;
1088
0
            if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_InputStreamParamsWithFds())))))) {
1089
0
                (aActor)->FatalError("Error deserializing variant TInputStreamParamsWithFds of union IPCStream");
1090
0
                return false;
1091
0
            }
1092
0
            // Sentinel = 'TInputStreamParamsWithFds'
1093
0
            if ((!((aMsg)->ReadSentinel(aIter, 2170706066)))) {
1094
0
                mozilla::ipc::SentinelReadError("Error deserializing variant TInputStreamParamsWithFds of union IPCStream");
1095
0
                return false;
1096
0
            }
1097
0
            return true;
1098
0
        }
1099
0
    case union__::TIPCRemoteStream:
1100
0
        {
1101
0
            mozilla::ipc::IPCRemoteStream tmp = mozilla::ipc::IPCRemoteStream();
1102
0
            (*(aVar)) = tmp;
1103
0
            if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_IPCRemoteStream())))))) {
1104
0
                (aActor)->FatalError("Error deserializing variant TIPCRemoteStream of union IPCStream");
1105
0
                return false;
1106
0
            }
1107
0
            // Sentinel = 'TIPCRemoteStream'
1108
0
            if ((!((aMsg)->ReadSentinel(aIter, 2978132448)))) {
1109
0
                mozilla::ipc::SentinelReadError("Error deserializing variant TIPCRemoteStream of union IPCStream");
1110
0
                return false;
1111
0
            }
1112
0
            return true;
1113
0
        }
1114
0
    default:
1115
0
        {
1116
0
            (aActor)->FatalError("unknown union type");
1117
0
            return false;
1118
0
        }
1119
0
    }
1120
0
}
1121
1122
} // namespace ipc
1123
} // namespace mozilla
1124
1125
//-----------------------------------------------------------------------------
1126
// Method definitions for the IPDL type |union OptionalIPCStream|
1127
//
1128
namespace mozilla {
1129
namespace ipc {
1130
auto OptionalIPCStream::MaybeDestroy(Type aNewType) -> bool
1131
0
{
1132
0
    if ((mType) == (T__None)) {
1133
0
        return true;
1134
0
    }
1135
0
    if ((mType) == (aNewType)) {
1136
0
        return false;
1137
0
    }
1138
0
    switch (mType) {
1139
0
    case TIPCStream:
1140
0
        {
1141
0
            (ptr_IPCStream())->~IPCStream__tdef();
1142
0
            break;
1143
0
        }
1144
0
    case Tvoid_t:
1145
0
        {
1146
0
            (ptr_void_t())->~void_t__tdef();
1147
0
            break;
1148
0
        }
1149
0
    default:
1150
0
        {
1151
0
            mozilla::ipc::LogicError("not reached");
1152
0
            break;
1153
0
        }
1154
0
    }
1155
0
    return true;
1156
0
}
1157
1158
MOZ_IMPLICIT OptionalIPCStream::OptionalIPCStream(const IPCStream& aOther)
1159
0
{
1160
0
    new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream(aOther);
1161
0
    mType = TIPCStream;
1162
0
}
1163
1164
MOZ_IMPLICIT OptionalIPCStream::OptionalIPCStream(IPCStream&& aOther)
1165
0
{
1166
0
    new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream(std::move(aOther));
1167
0
    mType = TIPCStream;
1168
0
}
1169
1170
MOZ_IMPLICIT OptionalIPCStream::OptionalIPCStream(const void_t& aOther)
1171
0
{
1172
0
    new (mozilla::KnownNotNull, ptr_void_t()) void_t(aOther);
1173
0
    mType = Tvoid_t;
1174
0
}
1175
1176
MOZ_IMPLICIT OptionalIPCStream::OptionalIPCStream(void_t&& aOther)
1177
0
{
1178
0
    new (mozilla::KnownNotNull, ptr_void_t()) void_t(std::move(aOther));
1179
0
    mType = Tvoid_t;
1180
0
}
1181
1182
MOZ_IMPLICIT OptionalIPCStream::OptionalIPCStream(const OptionalIPCStream& aOther)
1183
0
{
1184
0
    (aOther).AssertSanity();
1185
0
    switch ((aOther).type()) {
1186
0
    case TIPCStream:
1187
0
        {
1188
0
            new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream((aOther).get_IPCStream());
1189
0
            break;
1190
0
        }
1191
0
    case Tvoid_t:
1192
0
        {
1193
0
            new (mozilla::KnownNotNull, ptr_void_t()) void_t((aOther).get_void_t());
1194
0
            break;
1195
0
        }
1196
0
    case T__None:
1197
0
        {
1198
0
            break;
1199
0
        }
1200
0
    default:
1201
0
        {
1202
0
            mozilla::ipc::LogicError("unreached");
1203
0
            return;
1204
0
        }
1205
0
    }
1206
0
    mType = (aOther).type();
1207
0
}
1208
1209
MOZ_IMPLICIT OptionalIPCStream::OptionalIPCStream(OptionalIPCStream&& aOther)
1210
0
{
1211
0
    (aOther).AssertSanity();
1212
0
    Type t = (aOther).type();
1213
0
    switch (t) {
1214
0
    case TIPCStream:
1215
0
        {
1216
0
            new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream(std::move((aOther).get_IPCStream()));
1217
0
            static_cast<void>((aOther).MaybeDestroy(T__None));
1218
0
            break;
1219
0
        }
1220
0
    case Tvoid_t:
1221
0
        {
1222
0
            new (mozilla::KnownNotNull, ptr_void_t()) void_t(std::move((aOther).get_void_t()));
1223
0
            static_cast<void>((aOther).MaybeDestroy(T__None));
1224
0
            break;
1225
0
        }
1226
0
    case T__None:
1227
0
        {
1228
0
            break;
1229
0
        }
1230
0
    default:
1231
0
        {
1232
0
            mozilla::ipc::LogicError("unreached");
1233
0
            return;
1234
0
        }
1235
0
    }
1236
0
    (aOther).mType = T__None;
1237
0
    mType = t;
1238
0
}
1239
1240
OptionalIPCStream::~OptionalIPCStream()
1241
0
{
1242
0
    static_cast<void>(MaybeDestroy(T__None));
1243
0
}
1244
1245
auto OptionalIPCStream::operator=(const IPCStream& aRhs) -> OptionalIPCStream&
1246
0
{
1247
0
    if (MaybeDestroy(TIPCStream)) {
1248
0
        new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream;
1249
0
    }
1250
0
    (*(ptr_IPCStream())) = aRhs;
1251
0
    mType = TIPCStream;
1252
0
    return (*(this));
1253
0
}
1254
1255
auto OptionalIPCStream::operator=(IPCStream&& aRhs) -> OptionalIPCStream&
1256
0
{
1257
0
    if (MaybeDestroy(TIPCStream)) {
1258
0
        new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream;
1259
0
    }
1260
0
    (*(ptr_IPCStream())) = std::move(aRhs);
1261
0
    mType = TIPCStream;
1262
0
    return (*(this));
1263
0
}
1264
1265
auto OptionalIPCStream::operator=(const void_t& aRhs) -> OptionalIPCStream&
1266
0
{
1267
0
    if (MaybeDestroy(Tvoid_t)) {
1268
0
        new (mozilla::KnownNotNull, ptr_void_t()) void_t;
1269
0
    }
1270
0
    (*(ptr_void_t())) = aRhs;
1271
0
    mType = Tvoid_t;
1272
0
    return (*(this));
1273
0
}
1274
1275
auto OptionalIPCStream::operator=(void_t&& aRhs) -> OptionalIPCStream&
1276
0
{
1277
0
    if (MaybeDestroy(Tvoid_t)) {
1278
0
        new (mozilla::KnownNotNull, ptr_void_t()) void_t;
1279
0
    }
1280
0
    (*(ptr_void_t())) = std::move(aRhs);
1281
0
    mType = Tvoid_t;
1282
0
    return (*(this));
1283
0
}
1284
1285
auto OptionalIPCStream::operator=(const OptionalIPCStream& aRhs) -> OptionalIPCStream&
1286
0
{
1287
0
    (aRhs).AssertSanity();
1288
0
    Type t = (aRhs).type();
1289
0
    switch (t) {
1290
0
    case TIPCStream:
1291
0
        {
1292
0
            if (MaybeDestroy(t)) {
1293
0
                new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream;
1294
0
            }
1295
0
            (*(ptr_IPCStream())) = (aRhs).get_IPCStream();
1296
0
            break;
1297
0
        }
1298
0
    case Tvoid_t:
1299
0
        {
1300
0
            if (MaybeDestroy(t)) {
1301
0
                new (mozilla::KnownNotNull, ptr_void_t()) void_t;
1302
0
            }
1303
0
            (*(ptr_void_t())) = (aRhs).get_void_t();
1304
0
            break;
1305
0
        }
1306
0
    case T__None:
1307
0
        {
1308
0
            static_cast<void>(MaybeDestroy(t));
1309
0
            break;
1310
0
        }
1311
0
    default:
1312
0
        {
1313
0
            mozilla::ipc::LogicError("unreached");
1314
0
            break;
1315
0
        }
1316
0
    }
1317
0
    mType = t;
1318
0
    return (*(this));
1319
0
}
1320
1321
auto OptionalIPCStream::operator=(OptionalIPCStream&& aRhs) -> OptionalIPCStream&
1322
0
{
1323
0
    (aRhs).AssertSanity();
1324
0
    Type t = (aRhs).type();
1325
0
    switch (t) {
1326
0
    case TIPCStream:
1327
0
        {
1328
0
            if (MaybeDestroy(t)) {
1329
0
                new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream;
1330
0
            }
1331
0
            (*(ptr_IPCStream())) = std::move((aRhs).get_IPCStream());
1332
0
            static_cast<void>((aRhs).MaybeDestroy(T__None));
1333
0
            break;
1334
0
        }
1335
0
    case Tvoid_t:
1336
0
        {
1337
0
            if (MaybeDestroy(t)) {
1338
0
                new (mozilla::KnownNotNull, ptr_void_t()) void_t;
1339
0
            }
1340
0
            (*(ptr_void_t())) = std::move((aRhs).get_void_t());
1341
0
            static_cast<void>((aRhs).MaybeDestroy(T__None));
1342
0
            break;
1343
0
        }
1344
0
    case T__None:
1345
0
        {
1346
0
            static_cast<void>(MaybeDestroy(t));
1347
0
            break;
1348
0
        }
1349
0
    default:
1350
0
        {
1351
0
            mozilla::ipc::LogicError("unreached");
1352
0
            break;
1353
0
        }
1354
0
    }
1355
0
    (aRhs).mType = T__None;
1356
0
    mType = t;
1357
0
    return (*(this));
1358
0
}
1359
1360
auto OptionalIPCStream::operator==(const IPCStream& aRhs) const -> bool
1361
0
{
1362
0
    return (get_IPCStream()) == (aRhs);
1363
0
}
1364
1365
auto OptionalIPCStream::operator==(const void_t& aRhs) const -> bool
1366
0
{
1367
0
    return (get_void_t()) == (aRhs);
1368
0
}
1369
1370
auto OptionalIPCStream::operator==(const OptionalIPCStream& aRhs) const -> bool
1371
0
{
1372
0
    if ((type()) != ((aRhs).type())) {
1373
0
        return false;
1374
0
    }
1375
0
1376
0
    switch (type()) {
1377
0
    case TIPCStream:
1378
0
        {
1379
0
            return (get_IPCStream()) == ((aRhs).get_IPCStream());
1380
0
        }
1381
0
    case Tvoid_t:
1382
0
        {
1383
0
            return (get_void_t()) == ((aRhs).get_void_t());
1384
0
        }
1385
0
    default:
1386
0
        {
1387
0
            mozilla::ipc::LogicError("unreached");
1388
0
            return false;
1389
0
        }
1390
0
    }
1391
0
}
1392
1393
auto OptionalIPCStream::get(IPCStream* aOutValue) const -> void
1394
0
{
1395
0
    (*(aOutValue)) = get_IPCStream();
1396
0
}
1397
1398
auto OptionalIPCStream::get(void_t* aOutValue) const -> void
1399
0
{
1400
0
    (*(aOutValue)) = get_void_t();
1401
0
}
1402
1403
} // namespace ipc
1404
} // namespace mozilla
1405
1406
namespace mozilla {
1407
namespace ipc {
1408
auto IPDLParamTraits<mozilla::ipc::OptionalIPCStream>::Write(
1409
        IPC::Message* aMsg,
1410
        mozilla::ipc::IProtocol* aActor,
1411
        const paramType& aVar) -> void
1412
{
1413
    typedef mozilla::ipc::OptionalIPCStream union__;
1414
    int type;
1415
    type = (aVar).type();
1416
    WriteIPDLParam(aMsg, aActor, type);
1417
    // Sentinel = 'OptionalIPCStream'
1418
    (aMsg)->WriteSentinel(3815982647);
1419
1420
    switch (type) {
1421
    case union__::TIPCStream:
1422
        {
1423
            WriteIPDLParam(aMsg, aActor, (aVar).get_IPCStream());
1424
            // Sentinel = 'TIPCStream'
1425
            (aMsg)->WriteSentinel(40701900);
1426
            return;
1427
        }
1428
    case union__::Tvoid_t:
1429
        {
1430
            WriteIPDLParam(aMsg, aActor, (aVar).get_void_t());
1431
            // Sentinel = 'Tvoid_t'
1432
            (aMsg)->WriteSentinel(3041273328);
1433
            return;
1434
        }
1435
    default:
1436
        {
1437
            (aActor)->FatalError("unknown union type");
1438
            return;
1439
        }
1440
    }
1441
}
1442
1443
auto IPDLParamTraits<mozilla::ipc::OptionalIPCStream>::Read(
1444
        const IPC::Message* aMsg,
1445
        PickleIterator* aIter,
1446
        mozilla::ipc::IProtocol* aActor,
1447
        paramType* aVar) -> bool
1448
0
{
1449
0
    typedef mozilla::ipc::OptionalIPCStream union__;
1450
0
    int type;
1451
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&(type)))))) {
1452
0
        (aActor)->FatalError("Error deserializing type of union OptionalIPCStream");
1453
0
        return false;
1454
0
    }
1455
0
    // Sentinel = 'OptionalIPCStream'
1456
0
    if ((!((aMsg)->ReadSentinel(aIter, 3815982647)))) {
1457
0
        mozilla::ipc::SentinelReadError("Error deserializing type of union OptionalIPCStream");
1458
0
        return false;
1459
0
    }
1460
0
1461
0
    switch (type) {
1462
0
    case union__::TIPCStream:
1463
0
        {
1464
0
            mozilla::ipc::IPCStream tmp = mozilla::ipc::IPCStream();
1465
0
            (*(aVar)) = tmp;
1466
0
            if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_IPCStream())))))) {
1467
0
                (aActor)->FatalError("Error deserializing variant TIPCStream of union OptionalIPCStream");
1468
0
                return false;
1469
0
            }
1470
0
            // Sentinel = 'TIPCStream'
1471
0
            if ((!((aMsg)->ReadSentinel(aIter, 40701900)))) {
1472
0
                mozilla::ipc::SentinelReadError("Error deserializing variant TIPCStream of union OptionalIPCStream");
1473
0
                return false;
1474
0
            }
1475
0
            return true;
1476
0
        }
1477
0
    case union__::Tvoid_t:
1478
0
        {
1479
0
            mozilla::void_t tmp = mozilla::void_t();
1480
0
            (*(aVar)) = tmp;
1481
0
            if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_void_t())))))) {
1482
0
                (aActor)->FatalError("Error deserializing variant Tvoid_t of union OptionalIPCStream");
1483
0
                return false;
1484
0
            }
1485
0
            // Sentinel = 'Tvoid_t'
1486
0
            if ((!((aMsg)->ReadSentinel(aIter, 3041273328)))) {
1487
0
                mozilla::ipc::SentinelReadError("Error deserializing variant Tvoid_t of union OptionalIPCStream");
1488
0
                return false;
1489
0
            }
1490
0
            return true;
1491
0
        }
1492
0
    default:
1493
0
        {
1494
0
            (aActor)->FatalError("unknown union type");
1495
0
            return false;
1496
0
        }
1497
0
    }
1498
0
}
1499
1500
} // namespace ipc
1501
} // namespace mozilla