Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/IPCBlob.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/PIPCBlobInputStreamParent.h"
12
#include "mozilla/ipc/PIPCBlobInputStreamChild.h"
13
#include "mozilla/dom/IPCBlob.h"
14
15
16
//-----------------------------------------------------------------------------
17
// Method definitions for the IPDL type |struct IPCFile|
18
//
19
namespace mozilla {
20
namespace dom {
21
auto IPCFile::operator==(const IPCFile& _o) const -> bool
22
0
{
23
0
    if ((!((name()) == ((_o).name())))) {
24
0
        return false;
25
0
    }
26
0
    if ((!((lastModified()) == ((_o).lastModified())))) {
27
0
        return false;
28
0
    }
29
0
    if ((!((DOMPath()) == ((_o).DOMPath())))) {
30
0
        return false;
31
0
    }
32
0
    if ((!((fullPath()) == ((_o).fullPath())))) {
33
0
        return false;
34
0
    }
35
0
    if ((!((isDirectory()) == ((_o).isDirectory())))) {
36
0
        return false;
37
0
    }
38
0
    return true;
39
0
}
40
41
auto IPCFile::operator!=(const IPCFile& _o) const -> bool
42
0
{
43
0
    return (!(operator==(_o)));
44
0
}
45
46
} // namespace dom
47
} // namespace mozilla
48
49
namespace mozilla {
50
namespace ipc {
51
auto IPDLParamTraits<mozilla::dom::IPCFile>::Write(
52
        IPC::Message* aMsg,
53
        mozilla::ipc::IProtocol* aActor,
54
        const paramType& aVar) -> void
55
0
{
56
0
    WriteIPDLParam(aMsg, aActor, (aVar).name());
57
0
    // Sentinel = 'name'
58
0
    (aMsg)->WriteSentinel(15034981);
59
0
    WriteIPDLParam(aMsg, aActor, (aVar).lastModified());
60
0
    // Sentinel = 'lastModified'
61
0
    (aMsg)->WriteSentinel(3456113257);
62
0
    WriteIPDLParam(aMsg, aActor, (aVar).DOMPath());
63
0
    // Sentinel = 'DOMPath'
64
0
    (aMsg)->WriteSentinel(1724352494);
65
0
    WriteIPDLParam(aMsg, aActor, (aVar).fullPath());
66
0
    // Sentinel = 'fullPath'
67
0
    (aMsg)->WriteSentinel(385652698);
68
0
    WriteIPDLParam(aMsg, aActor, (aVar).isDirectory());
69
0
    // Sentinel = 'isDirectory'
70
0
    (aMsg)->WriteSentinel(2309743506);
71
0
}
72
73
auto IPDLParamTraits<mozilla::dom::IPCFile>::Read(
74
        const IPC::Message* aMsg,
75
        PickleIterator* aIter,
76
        mozilla::ipc::IProtocol* aActor,
77
        paramType* aVar) -> bool
78
0
{
79
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->name())))))) {
80
0
        (aActor)->FatalError("Error deserializing 'name' (nsString) member of 'IPCFile'");
81
0
        return false;
82
0
    }
83
0
    // Sentinel = 'name'
84
0
    if ((!((aMsg)->ReadSentinel(aIter, 15034981)))) {
85
0
        mozilla::ipc::SentinelReadError("Error deserializing 'name' (nsString) member of 'IPCFile'");
86
0
        return false;
87
0
    }
88
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->lastModified())))))) {
89
0
        (aActor)->FatalError("Error deserializing 'lastModified' (int64_t) member of 'IPCFile'");
90
0
        return false;
91
0
    }
92
0
    // Sentinel = 'lastModified'
93
0
    if ((!((aMsg)->ReadSentinel(aIter, 3456113257)))) {
94
0
        mozilla::ipc::SentinelReadError("Error deserializing 'lastModified' (int64_t) member of 'IPCFile'");
95
0
        return false;
96
0
    }
97
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->DOMPath())))))) {
98
0
        (aActor)->FatalError("Error deserializing 'DOMPath' (nsString) member of 'IPCFile'");
99
0
        return false;
100
0
    }
101
0
    // Sentinel = 'DOMPath'
102
0
    if ((!((aMsg)->ReadSentinel(aIter, 1724352494)))) {
103
0
        mozilla::ipc::SentinelReadError("Error deserializing 'DOMPath' (nsString) member of 'IPCFile'");
104
0
        return false;
105
0
    }
106
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->fullPath())))))) {
107
0
        (aActor)->FatalError("Error deserializing 'fullPath' (nsString) member of 'IPCFile'");
108
0
        return false;
109
0
    }
110
0
    // Sentinel = 'fullPath'
111
0
    if ((!((aMsg)->ReadSentinel(aIter, 385652698)))) {
112
0
        mozilla::ipc::SentinelReadError("Error deserializing 'fullPath' (nsString) member of 'IPCFile'");
113
0
        return false;
114
0
    }
115
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->isDirectory())))))) {
116
0
        (aActor)->FatalError("Error deserializing 'isDirectory' (bool) member of 'IPCFile'");
117
0
        return false;
118
0
    }
119
0
    // Sentinel = 'isDirectory'
120
0
    if ((!((aMsg)->ReadSentinel(aIter, 2309743506)))) {
121
0
        mozilla::ipc::SentinelReadError("Error deserializing 'isDirectory' (bool) member of 'IPCFile'");
122
0
        return false;
123
0
    }
124
0
    return true;
125
0
}
126
127
} // namespace ipc
128
} // namespace mozilla
129
130
//-----------------------------------------------------------------------------
131
// Method definitions for the IPDL type |union IPCFileUnion|
132
//
133
namespace mozilla {
134
namespace dom {
135
auto IPCFileUnion::MaybeDestroy(Type aNewType) -> bool
136
0
{
137
0
    if ((mType) == (T__None)) {
138
0
        return true;
139
0
    }
140
0
    if ((mType) == (aNewType)) {
141
0
        return false;
142
0
    }
143
0
    switch (mType) {
144
0
    case Tvoid_t:
145
0
        {
146
0
            (ptr_void_t())->~void_t__tdef();
147
0
            break;
148
0
        }
149
0
    case TIPCFile:
150
0
        {
151
0
            (ptr_IPCFile())->~IPCFile__tdef();
152
0
            break;
153
0
        }
154
0
    default:
155
0
        {
156
0
            mozilla::ipc::LogicError("not reached");
157
0
            break;
158
0
        }
159
0
    }
160
0
    return true;
161
0
}
162
163
MOZ_IMPLICIT IPCFileUnion::IPCFileUnion(const void_t& aOther)
164
0
{
165
0
    new (mozilla::KnownNotNull, ptr_void_t()) void_t(aOther);
166
0
    mType = Tvoid_t;
167
0
}
168
169
MOZ_IMPLICIT IPCFileUnion::IPCFileUnion(void_t&& aOther)
170
0
{
171
0
    new (mozilla::KnownNotNull, ptr_void_t()) void_t(std::move(aOther));
172
0
    mType = Tvoid_t;
173
0
}
174
175
MOZ_IMPLICIT IPCFileUnion::IPCFileUnion(const IPCFile& aOther)
176
0
{
177
0
    new (mozilla::KnownNotNull, ptr_IPCFile()) IPCFile(aOther);
178
0
    mType = TIPCFile;
179
0
}
180
181
MOZ_IMPLICIT IPCFileUnion::IPCFileUnion(IPCFile&& aOther)
182
0
{
183
0
    new (mozilla::KnownNotNull, ptr_IPCFile()) IPCFile(std::move(aOther));
184
0
    mType = TIPCFile;
185
0
}
186
187
MOZ_IMPLICIT IPCFileUnion::IPCFileUnion(const IPCFileUnion& aOther)
188
0
{
189
0
    (aOther).AssertSanity();
190
0
    switch ((aOther).type()) {
191
0
    case Tvoid_t:
192
0
        {
193
0
            new (mozilla::KnownNotNull, ptr_void_t()) void_t((aOther).get_void_t());
194
0
            break;
195
0
        }
196
0
    case TIPCFile:
197
0
        {
198
0
            new (mozilla::KnownNotNull, ptr_IPCFile()) IPCFile((aOther).get_IPCFile());
199
0
            break;
200
0
        }
201
0
    case T__None:
202
0
        {
203
0
            break;
204
0
        }
205
0
    default:
206
0
        {
207
0
            mozilla::ipc::LogicError("unreached");
208
0
            return;
209
0
        }
210
0
    }
211
0
    mType = (aOther).type();
212
0
}
213
214
MOZ_IMPLICIT IPCFileUnion::IPCFileUnion(IPCFileUnion&& aOther)
215
0
{
216
0
    (aOther).AssertSanity();
217
0
    Type t = (aOther).type();
218
0
    switch (t) {
219
0
    case Tvoid_t:
220
0
        {
221
0
            new (mozilla::KnownNotNull, ptr_void_t()) void_t(std::move((aOther).get_void_t()));
222
0
            static_cast<void>((aOther).MaybeDestroy(T__None));
223
0
            break;
224
0
        }
225
0
    case TIPCFile:
226
0
        {
227
0
            new (mozilla::KnownNotNull, ptr_IPCFile()) IPCFile(std::move((aOther).get_IPCFile()));
228
0
            static_cast<void>((aOther).MaybeDestroy(T__None));
229
0
            break;
230
0
        }
231
0
    case T__None:
232
0
        {
233
0
            break;
234
0
        }
235
0
    default:
236
0
        {
237
0
            mozilla::ipc::LogicError("unreached");
238
0
            return;
239
0
        }
240
0
    }
241
0
    (aOther).mType = T__None;
242
0
    mType = t;
243
0
}
244
245
IPCFileUnion::~IPCFileUnion()
246
0
{
247
0
    static_cast<void>(MaybeDestroy(T__None));
248
0
}
249
250
auto IPCFileUnion::operator=(const void_t& aRhs) -> IPCFileUnion&
251
0
{
252
0
    if (MaybeDestroy(Tvoid_t)) {
253
0
        new (mozilla::KnownNotNull, ptr_void_t()) void_t;
254
0
    }
255
0
    (*(ptr_void_t())) = aRhs;
256
0
    mType = Tvoid_t;
257
0
    return (*(this));
258
0
}
259
260
auto IPCFileUnion::operator=(void_t&& aRhs) -> IPCFileUnion&
261
0
{
262
0
    if (MaybeDestroy(Tvoid_t)) {
263
0
        new (mozilla::KnownNotNull, ptr_void_t()) void_t;
264
0
    }
265
0
    (*(ptr_void_t())) = std::move(aRhs);
266
0
    mType = Tvoid_t;
267
0
    return (*(this));
268
0
}
269
270
auto IPCFileUnion::operator=(const IPCFile& aRhs) -> IPCFileUnion&
271
0
{
272
0
    if (MaybeDestroy(TIPCFile)) {
273
0
        new (mozilla::KnownNotNull, ptr_IPCFile()) IPCFile;
274
0
    }
275
0
    (*(ptr_IPCFile())) = aRhs;
276
0
    mType = TIPCFile;
277
0
    return (*(this));
278
0
}
279
280
auto IPCFileUnion::operator=(IPCFile&& aRhs) -> IPCFileUnion&
281
0
{
282
0
    if (MaybeDestroy(TIPCFile)) {
283
0
        new (mozilla::KnownNotNull, ptr_IPCFile()) IPCFile;
284
0
    }
285
0
    (*(ptr_IPCFile())) = std::move(aRhs);
286
0
    mType = TIPCFile;
287
0
    return (*(this));
288
0
}
289
290
auto IPCFileUnion::operator=(const IPCFileUnion& aRhs) -> IPCFileUnion&
291
0
{
292
0
    (aRhs).AssertSanity();
293
0
    Type t = (aRhs).type();
294
0
    switch (t) {
295
0
    case Tvoid_t:
296
0
        {
297
0
            if (MaybeDestroy(t)) {
298
0
                new (mozilla::KnownNotNull, ptr_void_t()) void_t;
299
0
            }
300
0
            (*(ptr_void_t())) = (aRhs).get_void_t();
301
0
            break;
302
0
        }
303
0
    case TIPCFile:
304
0
        {
305
0
            if (MaybeDestroy(t)) {
306
0
                new (mozilla::KnownNotNull, ptr_IPCFile()) IPCFile;
307
0
            }
308
0
            (*(ptr_IPCFile())) = (aRhs).get_IPCFile();
309
0
            break;
310
0
        }
311
0
    case T__None:
312
0
        {
313
0
            static_cast<void>(MaybeDestroy(t));
314
0
            break;
315
0
        }
316
0
    default:
317
0
        {
318
0
            mozilla::ipc::LogicError("unreached");
319
0
            break;
320
0
        }
321
0
    }
322
0
    mType = t;
323
0
    return (*(this));
324
0
}
325
326
auto IPCFileUnion::operator=(IPCFileUnion&& aRhs) -> IPCFileUnion&
327
0
{
328
0
    (aRhs).AssertSanity();
329
0
    Type t = (aRhs).type();
330
0
    switch (t) {
331
0
    case Tvoid_t:
332
0
        {
333
0
            if (MaybeDestroy(t)) {
334
0
                new (mozilla::KnownNotNull, ptr_void_t()) void_t;
335
0
            }
336
0
            (*(ptr_void_t())) = std::move((aRhs).get_void_t());
337
0
            static_cast<void>((aRhs).MaybeDestroy(T__None));
338
0
            break;
339
0
        }
340
0
    case TIPCFile:
341
0
        {
342
0
            if (MaybeDestroy(t)) {
343
0
                new (mozilla::KnownNotNull, ptr_IPCFile()) IPCFile;
344
0
            }
345
0
            (*(ptr_IPCFile())) = std::move((aRhs).get_IPCFile());
346
0
            static_cast<void>((aRhs).MaybeDestroy(T__None));
347
0
            break;
348
0
        }
349
0
    case T__None:
350
0
        {
351
0
            static_cast<void>(MaybeDestroy(t));
352
0
            break;
353
0
        }
354
0
    default:
355
0
        {
356
0
            mozilla::ipc::LogicError("unreached");
357
0
            break;
358
0
        }
359
0
    }
360
0
    (aRhs).mType = T__None;
361
0
    mType = t;
362
0
    return (*(this));
363
0
}
364
365
auto IPCFileUnion::operator==(const void_t& aRhs) const -> bool
366
0
{
367
0
    return (get_void_t()) == (aRhs);
368
0
}
369
370
auto IPCFileUnion::operator==(const IPCFile& aRhs) const -> bool
371
0
{
372
0
    return (get_IPCFile()) == (aRhs);
373
0
}
374
375
auto IPCFileUnion::operator==(const IPCFileUnion& aRhs) const -> bool
376
0
{
377
0
    if ((type()) != ((aRhs).type())) {
378
0
        return false;
379
0
    }
380
0
381
0
    switch (type()) {
382
0
    case Tvoid_t:
383
0
        {
384
0
            return (get_void_t()) == ((aRhs).get_void_t());
385
0
        }
386
0
    case TIPCFile:
387
0
        {
388
0
            return (get_IPCFile()) == ((aRhs).get_IPCFile());
389
0
        }
390
0
    default:
391
0
        {
392
0
            mozilla::ipc::LogicError("unreached");
393
0
            return false;
394
0
        }
395
0
    }
396
0
}
397
398
auto IPCFileUnion::get(void_t* aOutValue) const -> void
399
0
{
400
0
    (*(aOutValue)) = get_void_t();
401
0
}
402
403
auto IPCFileUnion::get(IPCFile* aOutValue) const -> void
404
0
{
405
0
    (*(aOutValue)) = get_IPCFile();
406
0
}
407
408
} // namespace dom
409
} // namespace mozilla
410
411
namespace mozilla {
412
namespace ipc {
413
auto IPDLParamTraits<mozilla::dom::IPCFileUnion>::Write(
414
        IPC::Message* aMsg,
415
        mozilla::ipc::IProtocol* aActor,
416
        const paramType& aVar) -> void
417
{
418
    typedef mozilla::dom::IPCFileUnion union__;
419
    int type;
420
    type = (aVar).type();
421
    WriteIPDLParam(aMsg, aActor, type);
422
    // Sentinel = 'IPCFileUnion'
423
    (aMsg)->WriteSentinel(1913022529);
424
425
    switch (type) {
426
    case union__::Tvoid_t:
427
        {
428
            WriteIPDLParam(aMsg, aActor, (aVar).get_void_t());
429
            // Sentinel = 'Tvoid_t'
430
            (aMsg)->WriteSentinel(3041273328);
431
            return;
432
        }
433
    case union__::TIPCFile:
434
        {
435
            WriteIPDLParam(aMsg, aActor, (aVar).get_IPCFile());
436
            // Sentinel = 'TIPCFile'
437
            (aMsg)->WriteSentinel(3562676876);
438
            return;
439
        }
440
    default:
441
        {
442
            (aActor)->FatalError("unknown union type");
443
            return;
444
        }
445
    }
446
}
447
448
auto IPDLParamTraits<mozilla::dom::IPCFileUnion>::Read(
449
        const IPC::Message* aMsg,
450
        PickleIterator* aIter,
451
        mozilla::ipc::IProtocol* aActor,
452
        paramType* aVar) -> bool
453
0
{
454
0
    typedef mozilla::dom::IPCFileUnion union__;
455
0
    int type;
456
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&(type)))))) {
457
0
        (aActor)->FatalError("Error deserializing type of union IPCFileUnion");
458
0
        return false;
459
0
    }
460
0
    // Sentinel = 'IPCFileUnion'
461
0
    if ((!((aMsg)->ReadSentinel(aIter, 1913022529)))) {
462
0
        mozilla::ipc::SentinelReadError("Error deserializing type of union IPCFileUnion");
463
0
        return false;
464
0
    }
465
0
466
0
    switch (type) {
467
0
    case union__::Tvoid_t:
468
0
        {
469
0
            mozilla::void_t tmp = mozilla::void_t();
470
0
            (*(aVar)) = tmp;
471
0
            if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_void_t())))))) {
472
0
                (aActor)->FatalError("Error deserializing variant Tvoid_t of union IPCFileUnion");
473
0
                return false;
474
0
            }
475
0
            // Sentinel = 'Tvoid_t'
476
0
            if ((!((aMsg)->ReadSentinel(aIter, 3041273328)))) {
477
0
                mozilla::ipc::SentinelReadError("Error deserializing variant Tvoid_t of union IPCFileUnion");
478
0
                return false;
479
0
            }
480
0
            return true;
481
0
        }
482
0
    case union__::TIPCFile:
483
0
        {
484
0
            mozilla::dom::IPCFile tmp = mozilla::dom::IPCFile();
485
0
            (*(aVar)) = tmp;
486
0
            if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_IPCFile())))))) {
487
0
                (aActor)->FatalError("Error deserializing variant TIPCFile of union IPCFileUnion");
488
0
                return false;
489
0
            }
490
0
            // Sentinel = 'TIPCFile'
491
0
            if ((!((aMsg)->ReadSentinel(aIter, 3562676876)))) {
492
0
                mozilla::ipc::SentinelReadError("Error deserializing variant TIPCFile of union IPCFileUnion");
493
0
                return false;
494
0
            }
495
0
            return true;
496
0
        }
497
0
    default:
498
0
        {
499
0
            (aActor)->FatalError("unknown union type");
500
0
            return false;
501
0
        }
502
0
    }
503
0
}
504
505
} // namespace ipc
506
} // namespace mozilla
507
508
//-----------------------------------------------------------------------------
509
// Method definitions for the IPDL type |union IPCBlobStream|
510
//
511
namespace mozilla {
512
namespace dom {
513
auto IPCBlobStream::MaybeDestroy(Type aNewType) -> bool
514
0
{
515
0
    if ((mType) == (T__None)) {
516
0
        return true;
517
0
    }
518
0
    if ((mType) == (aNewType)) {
519
0
        return false;
520
0
    }
521
0
    switch (mType) {
522
0
    case TPIPCBlobInputStreamParent:
523
0
        {
524
0
            (ptr_PIPCBlobInputStreamParent())->~PIPCBlobInputStreamParent__tdef();
525
0
            break;
526
0
        }
527
0
    case TPIPCBlobInputStreamChild:
528
0
        {
529
0
            (ptr_PIPCBlobInputStreamChild())->~PIPCBlobInputStreamChild__tdef();
530
0
            break;
531
0
        }
532
0
    case TIPCStream:
533
0
        {
534
0
            (ptr_IPCStream())->~IPCStream__tdef();
535
0
            break;
536
0
        }
537
0
    default:
538
0
        {
539
0
            mozilla::ipc::LogicError("not reached");
540
0
            break;
541
0
        }
542
0
    }
543
0
    return true;
544
0
}
545
546
MOZ_IMPLICIT IPCBlobStream::IPCBlobStream(PIPCBlobInputStreamParent* aOther)
547
0
{
548
0
    new (mozilla::KnownNotNull, ptr_PIPCBlobInputStreamParent()) PIPCBlobInputStreamParent*(const_cast<PIPCBlobInputStreamParent*>(aOther));
549
0
    mType = TPIPCBlobInputStreamParent;
550
0
}
551
552
MOZ_IMPLICIT IPCBlobStream::IPCBlobStream(PIPCBlobInputStreamChild* aOther)
553
0
{
554
0
    new (mozilla::KnownNotNull, ptr_PIPCBlobInputStreamChild()) PIPCBlobInputStreamChild*(const_cast<PIPCBlobInputStreamChild*>(aOther));
555
0
    mType = TPIPCBlobInputStreamChild;
556
0
}
557
558
MOZ_IMPLICIT IPCBlobStream::IPCBlobStream(const IPCStream& aOther)
559
0
{
560
0
    new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream(aOther);
561
0
    mType = TIPCStream;
562
0
}
563
564
MOZ_IMPLICIT IPCBlobStream::IPCBlobStream(IPCStream&& aOther)
565
0
{
566
0
    new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream(std::move(aOther));
567
0
    mType = TIPCStream;
568
0
}
569
570
MOZ_IMPLICIT IPCBlobStream::IPCBlobStream(const IPCBlobStream& aOther)
571
0
{
572
0
    (aOther).AssertSanity();
573
0
    switch ((aOther).type()) {
574
0
    case TPIPCBlobInputStreamParent:
575
0
        {
576
0
            new (mozilla::KnownNotNull, ptr_PIPCBlobInputStreamParent()) PIPCBlobInputStreamParent*(const_cast<PIPCBlobInputStreamParent*>((aOther).get_PIPCBlobInputStreamParent()));
577
0
            break;
578
0
        }
579
0
    case TPIPCBlobInputStreamChild:
580
0
        {
581
0
            new (mozilla::KnownNotNull, ptr_PIPCBlobInputStreamChild()) PIPCBlobInputStreamChild*(const_cast<PIPCBlobInputStreamChild*>((aOther).get_PIPCBlobInputStreamChild()));
582
0
            break;
583
0
        }
584
0
    case TIPCStream:
585
0
        {
586
0
            new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream((aOther).get_IPCStream());
587
0
            break;
588
0
        }
589
0
    case T__None:
590
0
        {
591
0
            break;
592
0
        }
593
0
    default:
594
0
        {
595
0
            mozilla::ipc::LogicError("unreached");
596
0
            return;
597
0
        }
598
0
    }
599
0
    mType = (aOther).type();
600
0
}
601
602
MOZ_IMPLICIT IPCBlobStream::IPCBlobStream(IPCBlobStream&& aOther)
603
0
{
604
0
    (aOther).AssertSanity();
605
0
    Type t = (aOther).type();
606
0
    switch (t) {
607
0
    case TPIPCBlobInputStreamParent:
608
0
        {
609
0
            new (mozilla::KnownNotNull, ptr_PIPCBlobInputStreamParent()) PIPCBlobInputStreamParent*(const_cast<PIPCBlobInputStreamParent*>(std::move((aOther).get_PIPCBlobInputStreamParent())));
610
0
            static_cast<void>((aOther).MaybeDestroy(T__None));
611
0
            break;
612
0
        }
613
0
    case TPIPCBlobInputStreamChild:
614
0
        {
615
0
            new (mozilla::KnownNotNull, ptr_PIPCBlobInputStreamChild()) PIPCBlobInputStreamChild*(const_cast<PIPCBlobInputStreamChild*>(std::move((aOther).get_PIPCBlobInputStreamChild())));
616
0
            static_cast<void>((aOther).MaybeDestroy(T__None));
617
0
            break;
618
0
        }
619
0
    case TIPCStream:
620
0
        {
621
0
            new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream(std::move((aOther).get_IPCStream()));
622
0
            static_cast<void>((aOther).MaybeDestroy(T__None));
623
0
            break;
624
0
        }
625
0
    case T__None:
626
0
        {
627
0
            break;
628
0
        }
629
0
    default:
630
0
        {
631
0
            mozilla::ipc::LogicError("unreached");
632
0
            return;
633
0
        }
634
0
    }
635
0
    (aOther).mType = T__None;
636
0
    mType = t;
637
0
}
638
639
IPCBlobStream::~IPCBlobStream()
640
0
{
641
0
    static_cast<void>(MaybeDestroy(T__None));
642
0
}
643
644
auto IPCBlobStream::operator=(PIPCBlobInputStreamParent* aRhs) -> IPCBlobStream&
645
0
{
646
0
    if (MaybeDestroy(TPIPCBlobInputStreamParent)) {
647
0
        new (mozilla::KnownNotNull, ptr_PIPCBlobInputStreamParent()) PIPCBlobInputStreamParent*;
648
0
    }
649
0
    (*(ptr_PIPCBlobInputStreamParent())) = const_cast<PIPCBlobInputStreamParent*>(aRhs);
650
0
    mType = TPIPCBlobInputStreamParent;
651
0
    return (*(this));
652
0
}
653
654
auto IPCBlobStream::operator=(PIPCBlobInputStreamChild* aRhs) -> IPCBlobStream&
655
0
{
656
0
    if (MaybeDestroy(TPIPCBlobInputStreamChild)) {
657
0
        new (mozilla::KnownNotNull, ptr_PIPCBlobInputStreamChild()) PIPCBlobInputStreamChild*;
658
0
    }
659
0
    (*(ptr_PIPCBlobInputStreamChild())) = const_cast<PIPCBlobInputStreamChild*>(aRhs);
660
0
    mType = TPIPCBlobInputStreamChild;
661
0
    return (*(this));
662
0
}
663
664
auto IPCBlobStream::operator=(const IPCStream& aRhs) -> IPCBlobStream&
665
0
{
666
0
    if (MaybeDestroy(TIPCStream)) {
667
0
        new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream;
668
0
    }
669
0
    (*(ptr_IPCStream())) = aRhs;
670
0
    mType = TIPCStream;
671
0
    return (*(this));
672
0
}
673
674
auto IPCBlobStream::operator=(IPCStream&& aRhs) -> IPCBlobStream&
675
0
{
676
0
    if (MaybeDestroy(TIPCStream)) {
677
0
        new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream;
678
0
    }
679
0
    (*(ptr_IPCStream())) = std::move(aRhs);
680
0
    mType = TIPCStream;
681
0
    return (*(this));
682
0
}
683
684
auto IPCBlobStream::operator=(const IPCBlobStream& aRhs) -> IPCBlobStream&
685
0
{
686
0
    (aRhs).AssertSanity();
687
0
    Type t = (aRhs).type();
688
0
    switch (t) {
689
0
    case TPIPCBlobInputStreamParent:
690
0
        {
691
0
            if (MaybeDestroy(t)) {
692
0
                new (mozilla::KnownNotNull, ptr_PIPCBlobInputStreamParent()) PIPCBlobInputStreamParent*;
693
0
            }
694
0
            (*(ptr_PIPCBlobInputStreamParent())) = const_cast<PIPCBlobInputStreamParent*>((aRhs).get_PIPCBlobInputStreamParent());
695
0
            break;
696
0
        }
697
0
    case TPIPCBlobInputStreamChild:
698
0
        {
699
0
            if (MaybeDestroy(t)) {
700
0
                new (mozilla::KnownNotNull, ptr_PIPCBlobInputStreamChild()) PIPCBlobInputStreamChild*;
701
0
            }
702
0
            (*(ptr_PIPCBlobInputStreamChild())) = const_cast<PIPCBlobInputStreamChild*>((aRhs).get_PIPCBlobInputStreamChild());
703
0
            break;
704
0
        }
705
0
    case TIPCStream:
706
0
        {
707
0
            if (MaybeDestroy(t)) {
708
0
                new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream;
709
0
            }
710
0
            (*(ptr_IPCStream())) = (aRhs).get_IPCStream();
711
0
            break;
712
0
        }
713
0
    case T__None:
714
0
        {
715
0
            static_cast<void>(MaybeDestroy(t));
716
0
            break;
717
0
        }
718
0
    default:
719
0
        {
720
0
            mozilla::ipc::LogicError("unreached");
721
0
            break;
722
0
        }
723
0
    }
724
0
    mType = t;
725
0
    return (*(this));
726
0
}
727
728
auto IPCBlobStream::operator=(IPCBlobStream&& aRhs) -> IPCBlobStream&
729
0
{
730
0
    (aRhs).AssertSanity();
731
0
    Type t = (aRhs).type();
732
0
    switch (t) {
733
0
    case TPIPCBlobInputStreamParent:
734
0
        {
735
0
            if (MaybeDestroy(t)) {
736
0
                new (mozilla::KnownNotNull, ptr_PIPCBlobInputStreamParent()) PIPCBlobInputStreamParent*;
737
0
            }
738
0
            (*(ptr_PIPCBlobInputStreamParent())) = const_cast<PIPCBlobInputStreamParent*>(std::move((aRhs).get_PIPCBlobInputStreamParent()));
739
0
            static_cast<void>((aRhs).MaybeDestroy(T__None));
740
0
            break;
741
0
        }
742
0
    case TPIPCBlobInputStreamChild:
743
0
        {
744
0
            if (MaybeDestroy(t)) {
745
0
                new (mozilla::KnownNotNull, ptr_PIPCBlobInputStreamChild()) PIPCBlobInputStreamChild*;
746
0
            }
747
0
            (*(ptr_PIPCBlobInputStreamChild())) = const_cast<PIPCBlobInputStreamChild*>(std::move((aRhs).get_PIPCBlobInputStreamChild()));
748
0
            static_cast<void>((aRhs).MaybeDestroy(T__None));
749
0
            break;
750
0
        }
751
0
    case TIPCStream:
752
0
        {
753
0
            if (MaybeDestroy(t)) {
754
0
                new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream;
755
0
            }
756
0
            (*(ptr_IPCStream())) = std::move((aRhs).get_IPCStream());
757
0
            static_cast<void>((aRhs).MaybeDestroy(T__None));
758
0
            break;
759
0
        }
760
0
    case T__None:
761
0
        {
762
0
            static_cast<void>(MaybeDestroy(t));
763
0
            break;
764
0
        }
765
0
    default:
766
0
        {
767
0
            mozilla::ipc::LogicError("unreached");
768
0
            break;
769
0
        }
770
0
    }
771
0
    (aRhs).mType = T__None;
772
0
    mType = t;
773
0
    return (*(this));
774
0
}
775
776
auto IPCBlobStream::operator==(PIPCBlobInputStreamParent* aRhs) const -> bool
777
0
{
778
0
    return (get_PIPCBlobInputStreamParent()) == (aRhs);
779
0
}
780
781
auto IPCBlobStream::operator==(PIPCBlobInputStreamChild* aRhs) const -> bool
782
0
{
783
0
    return (get_PIPCBlobInputStreamChild()) == (aRhs);
784
0
}
785
786
auto IPCBlobStream::operator==(const IPCStream& aRhs) const -> bool
787
0
{
788
0
    return (get_IPCStream()) == (aRhs);
789
0
}
790
791
auto IPCBlobStream::operator==(const IPCBlobStream& aRhs) const -> bool
792
0
{
793
0
    if ((type()) != ((aRhs).type())) {
794
0
        return false;
795
0
    }
796
0
797
0
    switch (type()) {
798
0
    case TPIPCBlobInputStreamParent:
799
0
        {
800
0
            return (get_PIPCBlobInputStreamParent()) == ((aRhs).get_PIPCBlobInputStreamParent());
801
0
        }
802
0
    case TPIPCBlobInputStreamChild:
803
0
        {
804
0
            return (get_PIPCBlobInputStreamChild()) == ((aRhs).get_PIPCBlobInputStreamChild());
805
0
        }
806
0
    case TIPCStream:
807
0
        {
808
0
            return (get_IPCStream()) == ((aRhs).get_IPCStream());
809
0
        }
810
0
    default:
811
0
        {
812
0
            mozilla::ipc::LogicError("unreached");
813
0
            return false;
814
0
        }
815
0
    }
816
0
}
817
818
auto IPCBlobStream::get(PIPCBlobInputStreamParent** aOutValue) const -> void
819
0
{
820
0
    (*(aOutValue)) = get_PIPCBlobInputStreamParent();
821
0
}
822
823
auto IPCBlobStream::get(PIPCBlobInputStreamChild** aOutValue) const -> void
824
0
{
825
0
    (*(aOutValue)) = get_PIPCBlobInputStreamChild();
826
0
}
827
828
auto IPCBlobStream::get(IPCStream* aOutValue) const -> void
829
0
{
830
0
    (*(aOutValue)) = get_IPCStream();
831
0
}
832
833
} // namespace dom
834
} // namespace mozilla
835
836
namespace mozilla {
837
namespace ipc {
838
auto IPDLParamTraits<mozilla::dom::IPCBlobStream>::Write(
839
        IPC::Message* aMsg,
840
        mozilla::ipc::IProtocol* aActor,
841
        const paramType& aVar) -> void
842
0
{
843
0
    typedef mozilla::dom::IPCBlobStream union__;
844
0
    int type;
845
0
    type = (aVar).type();
846
0
    WriteIPDLParam(aMsg, aActor, type);
847
0
    // Sentinel = 'IPCBlobStream'
848
0
    (aMsg)->WriteSentinel(2926762354);
849
0
850
0
    switch (type) {
851
0
    case union__::TPIPCBlobInputStreamParent:
852
0
        {
853
0
            if ((mozilla::ipc::ParentSide) == ((aActor)->GetSide())) {
854
0
                MOZ_RELEASE_ASSERT((aVar).get_PIPCBlobInputStreamParent(), "NULL actor value passed to non-nullable param");
855
0
                WriteIPDLParam(aMsg, aActor, (aVar).get_PIPCBlobInputStreamParent());
856
0
                // Sentinel = 'TPIPCBlobInputStreamParent'
857
0
                (aMsg)->WriteSentinel(2944059743);
858
0
            }
859
0
            else {
860
0
                (aActor)->FatalError("wrong side!");
861
0
            }
862
0
            return;
863
0
        }
864
0
    case union__::TPIPCBlobInputStreamChild:
865
0
        {
866
0
            if ((mozilla::ipc::ChildSide) == ((aActor)->GetSide())) {
867
0
                MOZ_RELEASE_ASSERT((aVar).get_PIPCBlobInputStreamChild(), "NULL actor value passed to non-nullable param");
868
0
                WriteIPDLParam(aMsg, aActor, (aVar).get_PIPCBlobInputStreamChild());
869
0
                // Sentinel = 'TPIPCBlobInputStreamChild'
870
0
                (aMsg)->WriteSentinel(3349556844);
871
0
            }
872
0
            else {
873
0
                (aActor)->FatalError("wrong side!");
874
0
            }
875
0
            return;
876
0
        }
877
0
    case union__::TIPCStream:
878
0
        {
879
0
            WriteIPDLParam(aMsg, aActor, (aVar).get_IPCStream());
880
0
            // Sentinel = 'TIPCStream'
881
0
            (aMsg)->WriteSentinel(40701900);
882
0
            return;
883
0
        }
884
0
    default:
885
0
        {
886
0
            (aActor)->FatalError("unknown union type");
887
0
            return;
888
0
        }
889
0
    }
890
0
}
891
892
auto IPDLParamTraits<mozilla::dom::IPCBlobStream>::Read(
893
        const IPC::Message* aMsg,
894
        PickleIterator* aIter,
895
        mozilla::ipc::IProtocol* aActor,
896
        paramType* aVar) -> bool
897
0
{
898
0
    typedef mozilla::dom::IPCBlobStream union__;
899
0
    int type;
900
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&(type)))))) {
901
0
        (aActor)->FatalError("Error deserializing type of union IPCBlobStream");
902
0
        return false;
903
0
    }
904
0
    // Sentinel = 'IPCBlobStream'
905
0
    if ((!((aMsg)->ReadSentinel(aIter, 2926762354)))) {
906
0
        mozilla::ipc::SentinelReadError("Error deserializing type of union IPCBlobStream");
907
0
        return false;
908
0
    }
909
0
910
0
    switch (type) {
911
0
    case union__::TPIPCBlobInputStreamParent:
912
0
        {
913
0
            if ((mozilla::ipc::ParentSide) == ((aActor)->GetSide())) {
914
0
                {
915
0
                    (aActor)->FatalError("wrong side!");
916
0
                    return false;
917
0
                }
918
0
            }
919
0
            mozilla::ipc::PIPCBlobInputStreamChild* tmp = nullptr;
920
0
            (*(aVar)) = tmp;
921
0
            if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_PIPCBlobInputStreamChild())))))) {
922
0
                (aActor)->FatalError("Error deserializing variant TPIPCBlobInputStreamParent of union IPCBlobStream");
923
0
                return false;
924
0
            }
925
0
            if ((!((*((&((aVar)->get_PIPCBlobInputStreamChild()))))))) {
926
0
                (aActor)->FatalError("Error deserializing variant TPIPCBlobInputStreamParent of union IPCBlobStream");
927
0
                return false;
928
0
            }
929
0
            // Sentinel = 'TPIPCBlobInputStreamParent'
930
0
            if ((!((aMsg)->ReadSentinel(aIter, 2944059743)))) {
931
0
                mozilla::ipc::SentinelReadError("Error deserializing variant TPIPCBlobInputStreamParent of union IPCBlobStream");
932
0
                return false;
933
0
            }
934
0
            return true;
935
0
        }
936
0
    case union__::TPIPCBlobInputStreamChild:
937
0
        {
938
0
            if ((mozilla::ipc::ChildSide) == ((aActor)->GetSide())) {
939
0
                {
940
0
                    (aActor)->FatalError("wrong side!");
941
0
                    return false;
942
0
                }
943
0
            }
944
0
            mozilla::ipc::PIPCBlobInputStreamParent* tmp = nullptr;
945
0
            (*(aVar)) = tmp;
946
0
            if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_PIPCBlobInputStreamParent())))))) {
947
0
                (aActor)->FatalError("Error deserializing variant TPIPCBlobInputStreamChild of union IPCBlobStream");
948
0
                return false;
949
0
            }
950
0
            if ((!((*((&((aVar)->get_PIPCBlobInputStreamParent()))))))) {
951
0
                (aActor)->FatalError("Error deserializing variant TPIPCBlobInputStreamChild of union IPCBlobStream");
952
0
                return false;
953
0
            }
954
0
            // Sentinel = 'TPIPCBlobInputStreamChild'
955
0
            if ((!((aMsg)->ReadSentinel(aIter, 3349556844)))) {
956
0
                mozilla::ipc::SentinelReadError("Error deserializing variant TPIPCBlobInputStreamChild of union IPCBlobStream");
957
0
                return false;
958
0
            }
959
0
            return true;
960
0
        }
961
0
    case union__::TIPCStream:
962
0
        {
963
0
            mozilla::ipc::IPCStream tmp = mozilla::ipc::IPCStream();
964
0
            (*(aVar)) = tmp;
965
0
            if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_IPCStream())))))) {
966
0
                (aActor)->FatalError("Error deserializing variant TIPCStream of union IPCBlobStream");
967
0
                return false;
968
0
            }
969
0
            // Sentinel = 'TIPCStream'
970
0
            if ((!((aMsg)->ReadSentinel(aIter, 40701900)))) {
971
0
                mozilla::ipc::SentinelReadError("Error deserializing variant TIPCStream of union IPCBlobStream");
972
0
                return false;
973
0
            }
974
0
            return true;
975
0
        }
976
0
    default:
977
0
        {
978
0
            (aActor)->FatalError("unknown union type");
979
0
            return false;
980
0
        }
981
0
    }
982
0
}
983
984
} // namespace ipc
985
} // namespace mozilla
986
987
//-----------------------------------------------------------------------------
988
// Method definitions for the IPDL type |struct IPCBlob|
989
//
990
namespace mozilla {
991
namespace dom {
992
auto IPCBlob::operator==(const IPCBlob& _o) const -> bool
993
0
{
994
0
    if ((!((type()) == ((_o).type())))) {
995
0
        return false;
996
0
    }
997
0
    if ((!((size()) == ((_o).size())))) {
998
0
        return false;
999
0
    }
1000
0
    if ((!((inputStream()) == ((_o).inputStream())))) {
1001
0
        return false;
1002
0
    }
1003
0
    if ((!((file()) == ((_o).file())))) {
1004
0
        return false;
1005
0
    }
1006
0
    if ((!((fileId()) == ((_o).fileId())))) {
1007
0
        return false;
1008
0
    }
1009
0
    return true;
1010
0
}
1011
1012
auto IPCBlob::operator!=(const IPCBlob& _o) const -> bool
1013
0
{
1014
0
    return (!(operator==(_o)));
1015
0
}
1016
1017
} // namespace dom
1018
} // namespace mozilla
1019
1020
namespace mozilla {
1021
namespace ipc {
1022
auto IPDLParamTraits<mozilla::dom::IPCBlob>::Write(
1023
        IPC::Message* aMsg,
1024
        mozilla::ipc::IProtocol* aActor,
1025
        const paramType& aVar) -> void
1026
0
{
1027
0
    WriteIPDLParam(aMsg, aActor, (aVar).type());
1028
0
    // Sentinel = 'type'
1029
0
    (aMsg)->WriteSentinel(2982068540);
1030
0
    WriteIPDLParam(aMsg, aActor, (aVar).size());
1031
0
    // Sentinel = 'size'
1032
0
    (aMsg)->WriteSentinel(931048223);
1033
0
    WriteIPDLParam(aMsg, aActor, (aVar).inputStream());
1034
0
    // Sentinel = 'inputStream'
1035
0
    (aMsg)->WriteSentinel(2684883823);
1036
0
    WriteIPDLParam(aMsg, aActor, (aVar).file());
1037
0
    // Sentinel = 'file'
1038
0
    (aMsg)->WriteSentinel(224874390);
1039
0
    WriteIPDLParam(aMsg, aActor, (aVar).fileId());
1040
0
    // Sentinel = 'fileId'
1041
0
    (aMsg)->WriteSentinel(108004447);
1042
0
}
1043
1044
auto IPDLParamTraits<mozilla::dom::IPCBlob>::Read(
1045
        const IPC::Message* aMsg,
1046
        PickleIterator* aIter,
1047
        mozilla::ipc::IProtocol* aActor,
1048
        paramType* aVar) -> bool
1049
0
{
1050
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->type())))))) {
1051
0
        (aActor)->FatalError("Error deserializing 'type' (nsString) member of 'IPCBlob'");
1052
0
        return false;
1053
0
    }
1054
0
    // Sentinel = 'type'
1055
0
    if ((!((aMsg)->ReadSentinel(aIter, 2982068540)))) {
1056
0
        mozilla::ipc::SentinelReadError("Error deserializing 'type' (nsString) member of 'IPCBlob'");
1057
0
        return false;
1058
0
    }
1059
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->size())))))) {
1060
0
        (aActor)->FatalError("Error deserializing 'size' (uint64_t) member of 'IPCBlob'");
1061
0
        return false;
1062
0
    }
1063
0
    // Sentinel = 'size'
1064
0
    if ((!((aMsg)->ReadSentinel(aIter, 931048223)))) {
1065
0
        mozilla::ipc::SentinelReadError("Error deserializing 'size' (uint64_t) member of 'IPCBlob'");
1066
0
        return false;
1067
0
    }
1068
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->inputStream())))))) {
1069
0
        (aActor)->FatalError("Error deserializing 'inputStream' (IPCBlobStream) member of 'IPCBlob'");
1070
0
        return false;
1071
0
    }
1072
0
    // Sentinel = 'inputStream'
1073
0
    if ((!((aMsg)->ReadSentinel(aIter, 2684883823)))) {
1074
0
        mozilla::ipc::SentinelReadError("Error deserializing 'inputStream' (IPCBlobStream) member of 'IPCBlob'");
1075
0
        return false;
1076
0
    }
1077
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->file())))))) {
1078
0
        (aActor)->FatalError("Error deserializing 'file' (IPCFileUnion) member of 'IPCBlob'");
1079
0
        return false;
1080
0
    }
1081
0
    // Sentinel = 'file'
1082
0
    if ((!((aMsg)->ReadSentinel(aIter, 224874390)))) {
1083
0
        mozilla::ipc::SentinelReadError("Error deserializing 'file' (IPCFileUnion) member of 'IPCBlob'");
1084
0
        return false;
1085
0
    }
1086
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->fileId())))))) {
1087
0
        (aActor)->FatalError("Error deserializing 'fileId' (int64_t) member of 'IPCBlob'");
1088
0
        return false;
1089
0
    }
1090
0
    // Sentinel = 'fileId'
1091
0
    if ((!((aMsg)->ReadSentinel(aIter, 108004447)))) {
1092
0
        mozilla::ipc::SentinelReadError("Error deserializing 'fileId' (int64_t) member of 'IPCBlob'");
1093
0
        return false;
1094
0
    }
1095
0
    return true;
1096
0
}
1097
1098
} // namespace ipc
1099
} // namespace mozilla