Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PQuotaUsageRequest.cpp
Line
Count
Source (jump to first uncovered line)
1
//
2
// Automatically generated by ipdlc.
3
// Edit at your own risk
4
//
5
6
7
#include "mozilla/dom/quota/PQuotaParent.h"
8
#include "mozilla/dom/quota/PQuotaChild.h"
9
#include "mozilla/dom/quota/PQuotaUsageRequest.h"
10
11
namespace mozilla {
12
namespace dom {
13
namespace quota {
14
namespace PQuotaUsageRequest {
15
16
nsresult
17
CreateEndpoints(
18
        base::ProcessId aParentDestPid,
19
        base::ProcessId aChildDestPid,
20
        mozilla::ipc::Endpoint<mozilla::dom::quota::PQuotaUsageRequestParent>* aParent,
21
        mozilla::ipc::Endpoint<mozilla::dom::quota::PQuotaUsageRequestChild>* aChild)
22
0
{
23
0
    return mozilla::ipc::CreateEndpoints(mozilla::ipc::PrivateIPDLInterface(), aParentDestPid, aChildDestPid, aParent, aChild);
24
0
}
25
IPC::Message*
26
Msg_Cancel(int32_t routingId)
27
0
{
28
0
    return IPC::Message::IPDLMessage(routingId, Msg_Cancel__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::NOT_REPLY));
29
0
}
30
IPC::Message*
31
Msg___delete__(int32_t routingId)
32
0
{
33
0
    return IPC::Message::IPDLMessage(routingId, Msg___delete____ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::NOT_REPLY));
34
0
}
35
IPC::Message*
36
Reply___delete__(int32_t routingId)
37
0
{
38
0
    return IPC::Message::IPDLMessage(routingId, Reply___delete____ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::REPLY));
39
0
}
40
41
} // namespace PQuotaUsageRequest
42
} // namespace quota
43
} // namespace dom
44
} // namespace mozilla
45
46
//-----------------------------------------------------------------------------
47
// Method definitions for the IPDL type |struct OriginUsage|
48
//
49
namespace mozilla {
50
namespace dom {
51
namespace quota {
52
auto OriginUsage::operator==(const OriginUsage& _o) const -> bool
53
0
{
54
0
    if ((!((origin()) == ((_o).origin())))) {
55
0
        return false;
56
0
    }
57
0
    if ((!((persisted()) == ((_o).persisted())))) {
58
0
        return false;
59
0
    }
60
0
    if ((!((usage()) == ((_o).usage())))) {
61
0
        return false;
62
0
    }
63
0
    if ((!((lastAccessed()) == ((_o).lastAccessed())))) {
64
0
        return false;
65
0
    }
66
0
    return true;
67
0
}
68
69
auto OriginUsage::operator!=(const OriginUsage& _o) const -> bool
70
0
{
71
0
    return (!(operator==(_o)));
72
0
}
73
74
} // namespace quota
75
} // namespace dom
76
} // namespace mozilla
77
78
namespace mozilla {
79
namespace ipc {
80
auto IPDLParamTraits<mozilla::dom::quota::OriginUsage>::Write(
81
        IPC::Message* aMsg,
82
        mozilla::ipc::IProtocol* aActor,
83
        const paramType& aVar) -> void
84
0
{
85
0
    WriteIPDLParam(aMsg, aActor, (aVar).origin());
86
0
    // Sentinel = 'origin'
87
0
    (aMsg)->WriteSentinel(1429924608);
88
0
    WriteIPDLParam(aMsg, aActor, (aVar).persisted());
89
0
    // Sentinel = 'persisted'
90
0
    (aMsg)->WriteSentinel(3547791474);
91
0
    WriteIPDLParam(aMsg, aActor, (aVar).usage());
92
0
    // Sentinel = 'usage'
93
0
    (aMsg)->WriteSentinel(3419176504);
94
0
    WriteIPDLParam(aMsg, aActor, (aVar).lastAccessed());
95
0
    // Sentinel = 'lastAccessed'
96
0
    (aMsg)->WriteSentinel(806855293);
97
0
}
98
99
auto IPDLParamTraits<mozilla::dom::quota::OriginUsage>::Read(
100
        const IPC::Message* aMsg,
101
        PickleIterator* aIter,
102
        mozilla::ipc::IProtocol* aActor,
103
        paramType* aVar) -> bool
104
0
{
105
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->origin())))))) {
106
0
        (aActor)->FatalError("Error deserializing 'origin' (nsCString) member of 'OriginUsage'");
107
0
        return false;
108
0
    }
109
0
    // Sentinel = 'origin'
110
0
    if ((!((aMsg)->ReadSentinel(aIter, 1429924608)))) {
111
0
        mozilla::ipc::SentinelReadError("Error deserializing 'origin' (nsCString) member of 'OriginUsage'");
112
0
        return false;
113
0
    }
114
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->persisted())))))) {
115
0
        (aActor)->FatalError("Error deserializing 'persisted' (bool) member of 'OriginUsage'");
116
0
        return false;
117
0
    }
118
0
    // Sentinel = 'persisted'
119
0
    if ((!((aMsg)->ReadSentinel(aIter, 3547791474)))) {
120
0
        mozilla::ipc::SentinelReadError("Error deserializing 'persisted' (bool) member of 'OriginUsage'");
121
0
        return false;
122
0
    }
123
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->usage())))))) {
124
0
        (aActor)->FatalError("Error deserializing 'usage' (uint64_t) member of 'OriginUsage'");
125
0
        return false;
126
0
    }
127
0
    // Sentinel = 'usage'
128
0
    if ((!((aMsg)->ReadSentinel(aIter, 3419176504)))) {
129
0
        mozilla::ipc::SentinelReadError("Error deserializing 'usage' (uint64_t) member of 'OriginUsage'");
130
0
        return false;
131
0
    }
132
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->lastAccessed())))))) {
133
0
        (aActor)->FatalError("Error deserializing 'lastAccessed' (uint64_t) member of 'OriginUsage'");
134
0
        return false;
135
0
    }
136
0
    // Sentinel = 'lastAccessed'
137
0
    if ((!((aMsg)->ReadSentinel(aIter, 806855293)))) {
138
0
        mozilla::ipc::SentinelReadError("Error deserializing 'lastAccessed' (uint64_t) member of 'OriginUsage'");
139
0
        return false;
140
0
    }
141
0
    return true;
142
0
}
143
144
} // namespace ipc
145
} // namespace mozilla
146
147
//-----------------------------------------------------------------------------
148
// Method definitions for the IPDL type |struct AllUsageResponse|
149
//
150
namespace mozilla {
151
namespace dom {
152
namespace quota {
153
auto AllUsageResponse::operator==(const AllUsageResponse& _o) const -> bool
154
0
{
155
0
    if ((!((originUsages()) == ((_o).originUsages())))) {
156
0
        return false;
157
0
    }
158
0
    return true;
159
0
}
160
161
auto AllUsageResponse::operator!=(const AllUsageResponse& _o) const -> bool
162
0
{
163
0
    return (!(operator==(_o)));
164
0
}
165
166
} // namespace quota
167
} // namespace dom
168
} // namespace mozilla
169
170
namespace mozilla {
171
namespace ipc {
172
auto IPDLParamTraits<mozilla::dom::quota::AllUsageResponse>::Write(
173
        IPC::Message* aMsg,
174
        mozilla::ipc::IProtocol* aActor,
175
        const paramType& aVar) -> void
176
0
{
177
0
    WriteIPDLParam(aMsg, aActor, (aVar).originUsages());
178
0
    // Sentinel = 'originUsages'
179
0
    (aMsg)->WriteSentinel(483864514);
180
0
}
181
182
auto IPDLParamTraits<mozilla::dom::quota::AllUsageResponse>::Read(
183
        const IPC::Message* aMsg,
184
        PickleIterator* aIter,
185
        mozilla::ipc::IProtocol* aActor,
186
        paramType* aVar) -> bool
187
0
{
188
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->originUsages())))))) {
189
0
        (aActor)->FatalError("Error deserializing 'originUsages' (OriginUsage[]) member of 'AllUsageResponse'");
190
0
        return false;
191
0
    }
192
0
    // Sentinel = 'originUsages'
193
0
    if ((!((aMsg)->ReadSentinel(aIter, 483864514)))) {
194
0
        mozilla::ipc::SentinelReadError("Error deserializing 'originUsages' (OriginUsage[]) member of 'AllUsageResponse'");
195
0
        return false;
196
0
    }
197
0
    return true;
198
0
}
199
200
} // namespace ipc
201
} // namespace mozilla
202
203
//-----------------------------------------------------------------------------
204
// Method definitions for the IPDL type |struct OriginUsageResponse|
205
//
206
namespace mozilla {
207
namespace dom {
208
namespace quota {
209
auto OriginUsageResponse::operator==(const OriginUsageResponse& _o) const -> bool
210
0
{
211
0
    if ((!((usage()) == ((_o).usage())))) {
212
0
        return false;
213
0
    }
214
0
    if ((!((fileUsage()) == ((_o).fileUsage())))) {
215
0
        return false;
216
0
    }
217
0
    if ((!((limit()) == ((_o).limit())))) {
218
0
        return false;
219
0
    }
220
0
    return true;
221
0
}
222
223
auto OriginUsageResponse::operator!=(const OriginUsageResponse& _o) const -> bool
224
0
{
225
0
    return (!(operator==(_o)));
226
0
}
227
228
} // namespace quota
229
} // namespace dom
230
} // namespace mozilla
231
232
namespace mozilla {
233
namespace ipc {
234
auto IPDLParamTraits<mozilla::dom::quota::OriginUsageResponse>::Write(
235
        IPC::Message* aMsg,
236
        mozilla::ipc::IProtocol* aActor,
237
        const paramType& aVar) -> void
238
0
{
239
0
    WriteIPDLParam(aMsg, aActor, (aVar).usage());
240
0
    // Sentinel = 'usage'
241
0
    (aMsg)->WriteSentinel(3419176504);
242
0
    WriteIPDLParam(aMsg, aActor, (aVar).fileUsage());
243
0
    // Sentinel = 'fileUsage'
244
0
    (aMsg)->WriteSentinel(3321971858);
245
0
    WriteIPDLParam(aMsg, aActor, (aVar).limit());
246
0
    // Sentinel = 'limit'
247
0
    (aMsg)->WriteSentinel(3880566644);
248
0
}
249
250
auto IPDLParamTraits<mozilla::dom::quota::OriginUsageResponse>::Read(
251
        const IPC::Message* aMsg,
252
        PickleIterator* aIter,
253
        mozilla::ipc::IProtocol* aActor,
254
        paramType* aVar) -> bool
255
0
{
256
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->usage())))))) {
257
0
        (aActor)->FatalError("Error deserializing 'usage' (uint64_t) member of 'OriginUsageResponse'");
258
0
        return false;
259
0
    }
260
0
    // Sentinel = 'usage'
261
0
    if ((!((aMsg)->ReadSentinel(aIter, 3419176504)))) {
262
0
        mozilla::ipc::SentinelReadError("Error deserializing 'usage' (uint64_t) member of 'OriginUsageResponse'");
263
0
        return false;
264
0
    }
265
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->fileUsage())))))) {
266
0
        (aActor)->FatalError("Error deserializing 'fileUsage' (uint64_t) member of 'OriginUsageResponse'");
267
0
        return false;
268
0
    }
269
0
    // Sentinel = 'fileUsage'
270
0
    if ((!((aMsg)->ReadSentinel(aIter, 3321971858)))) {
271
0
        mozilla::ipc::SentinelReadError("Error deserializing 'fileUsage' (uint64_t) member of 'OriginUsageResponse'");
272
0
        return false;
273
0
    }
274
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->limit())))))) {
275
0
        (aActor)->FatalError("Error deserializing 'limit' (uint64_t) member of 'OriginUsageResponse'");
276
0
        return false;
277
0
    }
278
0
    // Sentinel = 'limit'
279
0
    if ((!((aMsg)->ReadSentinel(aIter, 3880566644)))) {
280
0
        mozilla::ipc::SentinelReadError("Error deserializing 'limit' (uint64_t) member of 'OriginUsageResponse'");
281
0
        return false;
282
0
    }
283
0
    return true;
284
0
}
285
286
} // namespace ipc
287
} // namespace mozilla
288
289
//-----------------------------------------------------------------------------
290
// Method definitions for the IPDL type |union UsageRequestResponse|
291
//
292
namespace mozilla {
293
namespace dom {
294
namespace quota {
295
auto UsageRequestResponse::MaybeDestroy(Type aNewType) -> bool
296
0
{
297
0
    if ((mType) == (T__None)) {
298
0
        return true;
299
0
    }
300
0
    if ((mType) == (aNewType)) {
301
0
        return false;
302
0
    }
303
0
    switch (mType) {
304
0
    case Tnsresult:
305
0
        {
306
0
            (ptr_nsresult())->~nsresult__tdef();
307
0
            break;
308
0
        }
309
0
    case TAllUsageResponse:
310
0
        {
311
0
            (ptr_AllUsageResponse())->~AllUsageResponse__tdef();
312
0
            break;
313
0
        }
314
0
    case TOriginUsageResponse:
315
0
        {
316
0
            (ptr_OriginUsageResponse())->~OriginUsageResponse__tdef();
317
0
            break;
318
0
        }
319
0
    default:
320
0
        {
321
0
            mozilla::ipc::LogicError("not reached");
322
0
            break;
323
0
        }
324
0
    }
325
0
    return true;
326
0
}
327
328
MOZ_IMPLICIT UsageRequestResponse::UsageRequestResponse(const nsresult& aOther)
329
0
{
330
0
    new (mozilla::KnownNotNull, ptr_nsresult()) nsresult(aOther);
331
0
    mType = Tnsresult;
332
0
}
333
334
MOZ_IMPLICIT UsageRequestResponse::UsageRequestResponse(nsresult&& aOther)
335
0
{
336
0
    new (mozilla::KnownNotNull, ptr_nsresult()) nsresult(std::move(aOther));
337
0
    mType = Tnsresult;
338
0
}
339
340
MOZ_IMPLICIT UsageRequestResponse::UsageRequestResponse(const AllUsageResponse& aOther)
341
0
{
342
0
    new (mozilla::KnownNotNull, ptr_AllUsageResponse()) AllUsageResponse(aOther);
343
0
    mType = TAllUsageResponse;
344
0
}
345
346
MOZ_IMPLICIT UsageRequestResponse::UsageRequestResponse(AllUsageResponse&& aOther)
347
0
{
348
0
    new (mozilla::KnownNotNull, ptr_AllUsageResponse()) AllUsageResponse(std::move(aOther));
349
0
    mType = TAllUsageResponse;
350
0
}
351
352
MOZ_IMPLICIT UsageRequestResponse::UsageRequestResponse(const OriginUsageResponse& aOther)
353
0
{
354
0
    new (mozilla::KnownNotNull, ptr_OriginUsageResponse()) OriginUsageResponse(aOther);
355
0
    mType = TOriginUsageResponse;
356
0
}
357
358
MOZ_IMPLICIT UsageRequestResponse::UsageRequestResponse(OriginUsageResponse&& aOther)
359
0
{
360
0
    new (mozilla::KnownNotNull, ptr_OriginUsageResponse()) OriginUsageResponse(std::move(aOther));
361
0
    mType = TOriginUsageResponse;
362
0
}
363
364
MOZ_IMPLICIT UsageRequestResponse::UsageRequestResponse(const UsageRequestResponse& aOther)
365
0
{
366
0
    (aOther).AssertSanity();
367
0
    switch ((aOther).type()) {
368
0
    case Tnsresult:
369
0
        {
370
0
            new (mozilla::KnownNotNull, ptr_nsresult()) nsresult((aOther).get_nsresult());
371
0
            break;
372
0
        }
373
0
    case TAllUsageResponse:
374
0
        {
375
0
            new (mozilla::KnownNotNull, ptr_AllUsageResponse()) AllUsageResponse((aOther).get_AllUsageResponse());
376
0
            break;
377
0
        }
378
0
    case TOriginUsageResponse:
379
0
        {
380
0
            new (mozilla::KnownNotNull, ptr_OriginUsageResponse()) OriginUsageResponse((aOther).get_OriginUsageResponse());
381
0
            break;
382
0
        }
383
0
    case T__None:
384
0
        {
385
0
            break;
386
0
        }
387
0
    default:
388
0
        {
389
0
            mozilla::ipc::LogicError("unreached");
390
0
            return;
391
0
        }
392
0
    }
393
0
    mType = (aOther).type();
394
0
}
395
396
MOZ_IMPLICIT UsageRequestResponse::UsageRequestResponse(UsageRequestResponse&& aOther)
397
0
{
398
0
    (aOther).AssertSanity();
399
0
    Type t = (aOther).type();
400
0
    switch (t) {
401
0
    case Tnsresult:
402
0
        {
403
0
            new (mozilla::KnownNotNull, ptr_nsresult()) nsresult(std::move((aOther).get_nsresult()));
404
0
            static_cast<void>((aOther).MaybeDestroy(T__None));
405
0
            break;
406
0
        }
407
0
    case TAllUsageResponse:
408
0
        {
409
0
            new (mozilla::KnownNotNull, ptr_AllUsageResponse()) AllUsageResponse(std::move((aOther).get_AllUsageResponse()));
410
0
            static_cast<void>((aOther).MaybeDestroy(T__None));
411
0
            break;
412
0
        }
413
0
    case TOriginUsageResponse:
414
0
        {
415
0
            new (mozilla::KnownNotNull, ptr_OriginUsageResponse()) OriginUsageResponse(std::move((aOther).get_OriginUsageResponse()));
416
0
            static_cast<void>((aOther).MaybeDestroy(T__None));
417
0
            break;
418
0
        }
419
0
    case T__None:
420
0
        {
421
0
            break;
422
0
        }
423
0
    default:
424
0
        {
425
0
            mozilla::ipc::LogicError("unreached");
426
0
            return;
427
0
        }
428
0
    }
429
0
    (aOther).mType = T__None;
430
0
    mType = t;
431
0
}
432
433
UsageRequestResponse::~UsageRequestResponse()
434
0
{
435
0
    static_cast<void>(MaybeDestroy(T__None));
436
0
}
437
438
auto UsageRequestResponse::operator=(const nsresult& aRhs) -> UsageRequestResponse&
439
0
{
440
0
    if (MaybeDestroy(Tnsresult)) {
441
0
        new (mozilla::KnownNotNull, ptr_nsresult()) nsresult;
442
0
    }
443
0
    (*(ptr_nsresult())) = aRhs;
444
0
    mType = Tnsresult;
445
0
    return (*(this));
446
0
}
447
448
auto UsageRequestResponse::operator=(nsresult&& aRhs) -> UsageRequestResponse&
449
0
{
450
0
    if (MaybeDestroy(Tnsresult)) {
451
0
        new (mozilla::KnownNotNull, ptr_nsresult()) nsresult;
452
0
    }
453
0
    (*(ptr_nsresult())) = std::move(aRhs);
454
0
    mType = Tnsresult;
455
0
    return (*(this));
456
0
}
457
458
auto UsageRequestResponse::operator=(const AllUsageResponse& aRhs) -> UsageRequestResponse&
459
0
{
460
0
    if (MaybeDestroy(TAllUsageResponse)) {
461
0
        new (mozilla::KnownNotNull, ptr_AllUsageResponse()) AllUsageResponse;
462
0
    }
463
0
    (*(ptr_AllUsageResponse())) = aRhs;
464
0
    mType = TAllUsageResponse;
465
0
    return (*(this));
466
0
}
467
468
auto UsageRequestResponse::operator=(AllUsageResponse&& aRhs) -> UsageRequestResponse&
469
0
{
470
0
    if (MaybeDestroy(TAllUsageResponse)) {
471
0
        new (mozilla::KnownNotNull, ptr_AllUsageResponse()) AllUsageResponse;
472
0
    }
473
0
    (*(ptr_AllUsageResponse())) = std::move(aRhs);
474
0
    mType = TAllUsageResponse;
475
0
    return (*(this));
476
0
}
477
478
auto UsageRequestResponse::operator=(const OriginUsageResponse& aRhs) -> UsageRequestResponse&
479
0
{
480
0
    if (MaybeDestroy(TOriginUsageResponse)) {
481
0
        new (mozilla::KnownNotNull, ptr_OriginUsageResponse()) OriginUsageResponse;
482
0
    }
483
0
    (*(ptr_OriginUsageResponse())) = aRhs;
484
0
    mType = TOriginUsageResponse;
485
0
    return (*(this));
486
0
}
487
488
auto UsageRequestResponse::operator=(OriginUsageResponse&& aRhs) -> UsageRequestResponse&
489
0
{
490
0
    if (MaybeDestroy(TOriginUsageResponse)) {
491
0
        new (mozilla::KnownNotNull, ptr_OriginUsageResponse()) OriginUsageResponse;
492
0
    }
493
0
    (*(ptr_OriginUsageResponse())) = std::move(aRhs);
494
0
    mType = TOriginUsageResponse;
495
0
    return (*(this));
496
0
}
497
498
auto UsageRequestResponse::operator=(const UsageRequestResponse& aRhs) -> UsageRequestResponse&
499
0
{
500
0
    (aRhs).AssertSanity();
501
0
    Type t = (aRhs).type();
502
0
    switch (t) {
503
0
    case Tnsresult:
504
0
        {
505
0
            if (MaybeDestroy(t)) {
506
0
                new (mozilla::KnownNotNull, ptr_nsresult()) nsresult;
507
0
            }
508
0
            (*(ptr_nsresult())) = (aRhs).get_nsresult();
509
0
            break;
510
0
        }
511
0
    case TAllUsageResponse:
512
0
        {
513
0
            if (MaybeDestroy(t)) {
514
0
                new (mozilla::KnownNotNull, ptr_AllUsageResponse()) AllUsageResponse;
515
0
            }
516
0
            (*(ptr_AllUsageResponse())) = (aRhs).get_AllUsageResponse();
517
0
            break;
518
0
        }
519
0
    case TOriginUsageResponse:
520
0
        {
521
0
            if (MaybeDestroy(t)) {
522
0
                new (mozilla::KnownNotNull, ptr_OriginUsageResponse()) OriginUsageResponse;
523
0
            }
524
0
            (*(ptr_OriginUsageResponse())) = (aRhs).get_OriginUsageResponse();
525
0
            break;
526
0
        }
527
0
    case T__None:
528
0
        {
529
0
            static_cast<void>(MaybeDestroy(t));
530
0
            break;
531
0
        }
532
0
    default:
533
0
        {
534
0
            mozilla::ipc::LogicError("unreached");
535
0
            break;
536
0
        }
537
0
    }
538
0
    mType = t;
539
0
    return (*(this));
540
0
}
541
542
auto UsageRequestResponse::operator=(UsageRequestResponse&& aRhs) -> UsageRequestResponse&
543
0
{
544
0
    (aRhs).AssertSanity();
545
0
    Type t = (aRhs).type();
546
0
    switch (t) {
547
0
    case Tnsresult:
548
0
        {
549
0
            if (MaybeDestroy(t)) {
550
0
                new (mozilla::KnownNotNull, ptr_nsresult()) nsresult;
551
0
            }
552
0
            (*(ptr_nsresult())) = std::move((aRhs).get_nsresult());
553
0
            static_cast<void>((aRhs).MaybeDestroy(T__None));
554
0
            break;
555
0
        }
556
0
    case TAllUsageResponse:
557
0
        {
558
0
            if (MaybeDestroy(t)) {
559
0
                new (mozilla::KnownNotNull, ptr_AllUsageResponse()) AllUsageResponse;
560
0
            }
561
0
            (*(ptr_AllUsageResponse())) = std::move((aRhs).get_AllUsageResponse());
562
0
            static_cast<void>((aRhs).MaybeDestroy(T__None));
563
0
            break;
564
0
        }
565
0
    case TOriginUsageResponse:
566
0
        {
567
0
            if (MaybeDestroy(t)) {
568
0
                new (mozilla::KnownNotNull, ptr_OriginUsageResponse()) OriginUsageResponse;
569
0
            }
570
0
            (*(ptr_OriginUsageResponse())) = std::move((aRhs).get_OriginUsageResponse());
571
0
            static_cast<void>((aRhs).MaybeDestroy(T__None));
572
0
            break;
573
0
        }
574
0
    case T__None:
575
0
        {
576
0
            static_cast<void>(MaybeDestroy(t));
577
0
            break;
578
0
        }
579
0
    default:
580
0
        {
581
0
            mozilla::ipc::LogicError("unreached");
582
0
            break;
583
0
        }
584
0
    }
585
0
    (aRhs).mType = T__None;
586
0
    mType = t;
587
0
    return (*(this));
588
0
}
589
590
auto UsageRequestResponse::operator==(const nsresult& aRhs) const -> bool
591
0
{
592
0
    return (get_nsresult()) == (aRhs);
593
0
}
594
595
auto UsageRequestResponse::operator==(const AllUsageResponse& aRhs) const -> bool
596
0
{
597
0
    return (get_AllUsageResponse()) == (aRhs);
598
0
}
599
600
auto UsageRequestResponse::operator==(const OriginUsageResponse& aRhs) const -> bool
601
0
{
602
0
    return (get_OriginUsageResponse()) == (aRhs);
603
0
}
604
605
auto UsageRequestResponse::operator==(const UsageRequestResponse& aRhs) const -> bool
606
0
{
607
0
    if ((type()) != ((aRhs).type())) {
608
0
        return false;
609
0
    }
610
0
611
0
    switch (type()) {
612
0
    case Tnsresult:
613
0
        {
614
0
            return (get_nsresult()) == ((aRhs).get_nsresult());
615
0
        }
616
0
    case TAllUsageResponse:
617
0
        {
618
0
            return (get_AllUsageResponse()) == ((aRhs).get_AllUsageResponse());
619
0
        }
620
0
    case TOriginUsageResponse:
621
0
        {
622
0
            return (get_OriginUsageResponse()) == ((aRhs).get_OriginUsageResponse());
623
0
        }
624
0
    default:
625
0
        {
626
0
            mozilla::ipc::LogicError("unreached");
627
0
            return false;
628
0
        }
629
0
    }
630
0
}
631
632
auto UsageRequestResponse::get(nsresult* aOutValue) const -> void
633
0
{
634
0
    (*(aOutValue)) = get_nsresult();
635
0
}
636
637
auto UsageRequestResponse::get(AllUsageResponse* aOutValue) const -> void
638
0
{
639
0
    (*(aOutValue)) = get_AllUsageResponse();
640
0
}
641
642
auto UsageRequestResponse::get(OriginUsageResponse* aOutValue) const -> void
643
0
{
644
0
    (*(aOutValue)) = get_OriginUsageResponse();
645
0
}
646
647
} // namespace quota
648
} // namespace dom
649
} // namespace mozilla
650
651
namespace mozilla {
652
namespace ipc {
653
auto IPDLParamTraits<mozilla::dom::quota::UsageRequestResponse>::Write(
654
        IPC::Message* aMsg,
655
        mozilla::ipc::IProtocol* aActor,
656
        const paramType& aVar) -> void
657
{
658
    typedef mozilla::dom::quota::UsageRequestResponse union__;
659
    int type;
660
    type = (aVar).type();
661
    WriteIPDLParam(aMsg, aActor, type);
662
    // Sentinel = 'UsageRequestResponse'
663
    (aMsg)->WriteSentinel(3872348009);
664
665
    switch (type) {
666
    case union__::Tnsresult:
667
        {
668
            WriteIPDLParam(aMsg, aActor, (aVar).get_nsresult());
669
            // Sentinel = 'Tnsresult'
670
            (aMsg)->WriteSentinel(2293764539);
671
            return;
672
        }
673
    case union__::TAllUsageResponse:
674
        {
675
            WriteIPDLParam(aMsg, aActor, (aVar).get_AllUsageResponse());
676
            // Sentinel = 'TAllUsageResponse'
677
            (aMsg)->WriteSentinel(3226243202);
678
            return;
679
        }
680
    case union__::TOriginUsageResponse:
681
        {
682
            WriteIPDLParam(aMsg, aActor, (aVar).get_OriginUsageResponse());
683
            // Sentinel = 'TOriginUsageResponse'
684
            (aMsg)->WriteSentinel(1702568234);
685
            return;
686
        }
687
    default:
688
        {
689
            (aActor)->FatalError("unknown union type");
690
            return;
691
        }
692
    }
693
}
694
695
auto IPDLParamTraits<mozilla::dom::quota::UsageRequestResponse>::Read(
696
        const IPC::Message* aMsg,
697
        PickleIterator* aIter,
698
        mozilla::ipc::IProtocol* aActor,
699
        paramType* aVar) -> bool
700
0
{
701
0
    typedef mozilla::dom::quota::UsageRequestResponse union__;
702
0
    int type;
703
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&(type)))))) {
704
0
        (aActor)->FatalError("Error deserializing type of union UsageRequestResponse");
705
0
        return false;
706
0
    }
707
0
    // Sentinel = 'UsageRequestResponse'
708
0
    if ((!((aMsg)->ReadSentinel(aIter, 3872348009)))) {
709
0
        mozilla::ipc::SentinelReadError("Error deserializing type of union UsageRequestResponse");
710
0
        return false;
711
0
    }
712
0
713
0
    switch (type) {
714
0
    case union__::Tnsresult:
715
0
        {
716
0
            nsresult tmp = nsresult();
717
0
            (*(aVar)) = tmp;
718
0
            if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_nsresult())))))) {
719
0
                (aActor)->FatalError("Error deserializing variant Tnsresult of union UsageRequestResponse");
720
0
                return false;
721
0
            }
722
0
            // Sentinel = 'Tnsresult'
723
0
            if ((!((aMsg)->ReadSentinel(aIter, 2293764539)))) {
724
0
                mozilla::ipc::SentinelReadError("Error deserializing variant Tnsresult of union UsageRequestResponse");
725
0
                return false;
726
0
            }
727
0
            return true;
728
0
        }
729
0
    case union__::TAllUsageResponse:
730
0
        {
731
0
            mozilla::dom::quota::AllUsageResponse tmp = mozilla::dom::quota::AllUsageResponse();
732
0
            (*(aVar)) = tmp;
733
0
            if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_AllUsageResponse())))))) {
734
0
                (aActor)->FatalError("Error deserializing variant TAllUsageResponse of union UsageRequestResponse");
735
0
                return false;
736
0
            }
737
0
            // Sentinel = 'TAllUsageResponse'
738
0
            if ((!((aMsg)->ReadSentinel(aIter, 3226243202)))) {
739
0
                mozilla::ipc::SentinelReadError("Error deserializing variant TAllUsageResponse of union UsageRequestResponse");
740
0
                return false;
741
0
            }
742
0
            return true;
743
0
        }
744
0
    case union__::TOriginUsageResponse:
745
0
        {
746
0
            mozilla::dom::quota::OriginUsageResponse tmp = mozilla::dom::quota::OriginUsageResponse();
747
0
            (*(aVar)) = tmp;
748
0
            if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_OriginUsageResponse())))))) {
749
0
                (aActor)->FatalError("Error deserializing variant TOriginUsageResponse of union UsageRequestResponse");
750
0
                return false;
751
0
            }
752
0
            // Sentinel = 'TOriginUsageResponse'
753
0
            if ((!((aMsg)->ReadSentinel(aIter, 1702568234)))) {
754
0
                mozilla::ipc::SentinelReadError("Error deserializing variant TOriginUsageResponse of union UsageRequestResponse");
755
0
                return false;
756
0
            }
757
0
            return true;
758
0
        }
759
0
    default:
760
0
        {
761
0
            (aActor)->FatalError("unknown union type");
762
0
            return false;
763
0
        }
764
0
    }
765
0
}
766
767
} // namespace ipc
768
} // namespace mozilla