Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PHeapSnapshotTempFileHelper.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/PContentParent.h"
8
#include "mozilla/dom/PContentChild.h"
9
#include "mozilla/devtools/PHeapSnapshotTempFileHelper.h"
10
11
namespace mozilla {
12
namespace devtools {
13
namespace PHeapSnapshotTempFileHelper {
14
15
nsresult
16
CreateEndpoints(
17
        base::ProcessId aParentDestPid,
18
        base::ProcessId aChildDestPid,
19
        mozilla::ipc::Endpoint<mozilla::devtools::PHeapSnapshotTempFileHelperParent>* aParent,
20
        mozilla::ipc::Endpoint<mozilla::devtools::PHeapSnapshotTempFileHelperChild>* aChild)
21
0
{
22
0
    return mozilla::ipc::CreateEndpoints(mozilla::ipc::PrivateIPDLInterface(), aParentDestPid, aChildDestPid, aParent, aChild);
23
0
}
24
IPC::Message*
25
Msg_OpenHeapSnapshotTempFile(int32_t routingId)
26
0
{
27
0
    return IPC::Message::IPDLMessage(routingId, Msg_OpenHeapSnapshotTempFile__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::SYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::NOT_REPLY));
28
0
}
29
IPC::Message*
30
Reply_OpenHeapSnapshotTempFile(int32_t routingId)
31
0
{
32
0
    return IPC::Message::IPDLMessage(routingId, Reply_OpenHeapSnapshotTempFile__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::SYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::REPLY));
33
0
}
34
IPC::Message*
35
Msg___delete__(int32_t routingId)
36
0
{
37
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));
38
0
}
39
IPC::Message*
40
Reply___delete__(int32_t routingId)
41
0
{
42
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));
43
0
}
44
45
} // namespace PHeapSnapshotTempFileHelper
46
} // namespace devtools
47
} // namespace mozilla
48
49
//-----------------------------------------------------------------------------
50
// Method definitions for the IPDL type |struct OpenedFile|
51
//
52
namespace mozilla {
53
namespace devtools {
54
auto OpenedFile::operator==(const OpenedFile& _o) const -> bool
55
0
{
56
0
    if ((!((path()) == ((_o).path())))) {
57
0
        return false;
58
0
    }
59
0
    if ((!((snapshotId()) == ((_o).snapshotId())))) {
60
0
        return false;
61
0
    }
62
0
    if ((!((descriptor()) == ((_o).descriptor())))) {
63
0
        return false;
64
0
    }
65
0
    return true;
66
0
}
67
68
auto OpenedFile::operator!=(const OpenedFile& _o) const -> bool
69
0
{
70
0
    return (!(operator==(_o)));
71
0
}
72
73
} // namespace devtools
74
} // namespace mozilla
75
76
namespace mozilla {
77
namespace ipc {
78
auto IPDLParamTraits<mozilla::devtools::OpenedFile>::Write(
79
        IPC::Message* aMsg,
80
        mozilla::ipc::IProtocol* aActor,
81
        const paramType& aVar) -> void
82
0
{
83
0
    WriteIPDLParam(aMsg, aActor, (aVar).path());
84
0
    // Sentinel = 'path'
85
0
    (aMsg)->WriteSentinel(913629401);
86
0
    WriteIPDLParam(aMsg, aActor, (aVar).snapshotId());
87
0
    // Sentinel = 'snapshotId'
88
0
    (aMsg)->WriteSentinel(2517068057);
89
0
    WriteIPDLParam(aMsg, aActor, (aVar).descriptor());
90
0
    // Sentinel = 'descriptor'
91
0
    (aMsg)->WriteSentinel(2435877233);
92
0
}
93
94
auto IPDLParamTraits<mozilla::devtools::OpenedFile>::Read(
95
        const IPC::Message* aMsg,
96
        PickleIterator* aIter,
97
        mozilla::ipc::IProtocol* aActor,
98
        paramType* aVar) -> bool
99
0
{
100
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->path())))))) {
101
0
        (aActor)->FatalError("Error deserializing 'path' (nsString) member of 'OpenedFile'");
102
0
        return false;
103
0
    }
104
0
    // Sentinel = 'path'
105
0
    if ((!((aMsg)->ReadSentinel(aIter, 913629401)))) {
106
0
        mozilla::ipc::SentinelReadError("Error deserializing 'path' (nsString) member of 'OpenedFile'");
107
0
        return false;
108
0
    }
109
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->snapshotId())))))) {
110
0
        (aActor)->FatalError("Error deserializing 'snapshotId' (nsString) member of 'OpenedFile'");
111
0
        return false;
112
0
    }
113
0
    // Sentinel = 'snapshotId'
114
0
    if ((!((aMsg)->ReadSentinel(aIter, 2517068057)))) {
115
0
        mozilla::ipc::SentinelReadError("Error deserializing 'snapshotId' (nsString) member of 'OpenedFile'");
116
0
        return false;
117
0
    }
118
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->descriptor())))))) {
119
0
        (aActor)->FatalError("Error deserializing 'descriptor' (FileDescriptor) member of 'OpenedFile'");
120
0
        return false;
121
0
    }
122
0
    // Sentinel = 'descriptor'
123
0
    if ((!((aMsg)->ReadSentinel(aIter, 2435877233)))) {
124
0
        mozilla::ipc::SentinelReadError("Error deserializing 'descriptor' (FileDescriptor) member of 'OpenedFile'");
125
0
        return false;
126
0
    }
127
0
    return true;
128
0
}
129
130
} // namespace ipc
131
} // namespace mozilla
132
133
//-----------------------------------------------------------------------------
134
// Method definitions for the IPDL type |union OpenHeapSnapshotTempFileResponse|
135
//
136
namespace mozilla {
137
namespace devtools {
138
auto OpenHeapSnapshotTempFileResponse::MaybeDestroy(Type aNewType) -> bool
139
0
{
140
0
    if ((mType) == (T__None)) {
141
0
        return true;
142
0
    }
143
0
    if ((mType) == (aNewType)) {
144
0
        return false;
145
0
    }
146
0
    switch (mType) {
147
0
    case Tnsresult:
148
0
        {
149
0
            (ptr_nsresult())->~nsresult__tdef();
150
0
            break;
151
0
        }
152
0
    case TOpenedFile:
153
0
        {
154
0
            (ptr_OpenedFile())->~OpenedFile__tdef();
155
0
            break;
156
0
        }
157
0
    default:
158
0
        {
159
0
            mozilla::ipc::LogicError("not reached");
160
0
            break;
161
0
        }
162
0
    }
163
0
    return true;
164
0
}
165
166
MOZ_IMPLICIT OpenHeapSnapshotTempFileResponse::OpenHeapSnapshotTempFileResponse(const nsresult& aOther)
167
0
{
168
0
    new (mozilla::KnownNotNull, ptr_nsresult()) nsresult(aOther);
169
0
    mType = Tnsresult;
170
0
}
171
172
MOZ_IMPLICIT OpenHeapSnapshotTempFileResponse::OpenHeapSnapshotTempFileResponse(nsresult&& aOther)
173
0
{
174
0
    new (mozilla::KnownNotNull, ptr_nsresult()) nsresult(std::move(aOther));
175
0
    mType = Tnsresult;
176
0
}
177
178
MOZ_IMPLICIT OpenHeapSnapshotTempFileResponse::OpenHeapSnapshotTempFileResponse(const OpenedFile& aOther)
179
0
{
180
0
    new (mozilla::KnownNotNull, ptr_OpenedFile()) OpenedFile(aOther);
181
0
    mType = TOpenedFile;
182
0
}
183
184
MOZ_IMPLICIT OpenHeapSnapshotTempFileResponse::OpenHeapSnapshotTempFileResponse(OpenedFile&& aOther)
185
0
{
186
0
    new (mozilla::KnownNotNull, ptr_OpenedFile()) OpenedFile(std::move(aOther));
187
0
    mType = TOpenedFile;
188
0
}
189
190
MOZ_IMPLICIT OpenHeapSnapshotTempFileResponse::OpenHeapSnapshotTempFileResponse(const OpenHeapSnapshotTempFileResponse& aOther)
191
0
{
192
0
    (aOther).AssertSanity();
193
0
    switch ((aOther).type()) {
194
0
    case Tnsresult:
195
0
        {
196
0
            new (mozilla::KnownNotNull, ptr_nsresult()) nsresult((aOther).get_nsresult());
197
0
            break;
198
0
        }
199
0
    case TOpenedFile:
200
0
        {
201
0
            new (mozilla::KnownNotNull, ptr_OpenedFile()) OpenedFile((aOther).get_OpenedFile());
202
0
            break;
203
0
        }
204
0
    case T__None:
205
0
        {
206
0
            break;
207
0
        }
208
0
    default:
209
0
        {
210
0
            mozilla::ipc::LogicError("unreached");
211
0
            return;
212
0
        }
213
0
    }
214
0
    mType = (aOther).type();
215
0
}
216
217
MOZ_IMPLICIT OpenHeapSnapshotTempFileResponse::OpenHeapSnapshotTempFileResponse(OpenHeapSnapshotTempFileResponse&& aOther)
218
0
{
219
0
    (aOther).AssertSanity();
220
0
    Type t = (aOther).type();
221
0
    switch (t) {
222
0
    case Tnsresult:
223
0
        {
224
0
            new (mozilla::KnownNotNull, ptr_nsresult()) nsresult(std::move((aOther).get_nsresult()));
225
0
            static_cast<void>((aOther).MaybeDestroy(T__None));
226
0
            break;
227
0
        }
228
0
    case TOpenedFile:
229
0
        {
230
0
            new (mozilla::KnownNotNull, ptr_OpenedFile()) OpenedFile(std::move((aOther).get_OpenedFile()));
231
0
            static_cast<void>((aOther).MaybeDestroy(T__None));
232
0
            break;
233
0
        }
234
0
    case T__None:
235
0
        {
236
0
            break;
237
0
        }
238
0
    default:
239
0
        {
240
0
            mozilla::ipc::LogicError("unreached");
241
0
            return;
242
0
        }
243
0
    }
244
0
    (aOther).mType = T__None;
245
0
    mType = t;
246
0
}
247
248
OpenHeapSnapshotTempFileResponse::~OpenHeapSnapshotTempFileResponse()
249
0
{
250
0
    static_cast<void>(MaybeDestroy(T__None));
251
0
}
252
253
auto OpenHeapSnapshotTempFileResponse::operator=(const nsresult& aRhs) -> OpenHeapSnapshotTempFileResponse&
254
0
{
255
0
    if (MaybeDestroy(Tnsresult)) {
256
0
        new (mozilla::KnownNotNull, ptr_nsresult()) nsresult;
257
0
    }
258
0
    (*(ptr_nsresult())) = aRhs;
259
0
    mType = Tnsresult;
260
0
    return (*(this));
261
0
}
262
263
auto OpenHeapSnapshotTempFileResponse::operator=(nsresult&& aRhs) -> OpenHeapSnapshotTempFileResponse&
264
0
{
265
0
    if (MaybeDestroy(Tnsresult)) {
266
0
        new (mozilla::KnownNotNull, ptr_nsresult()) nsresult;
267
0
    }
268
0
    (*(ptr_nsresult())) = std::move(aRhs);
269
0
    mType = Tnsresult;
270
0
    return (*(this));
271
0
}
272
273
auto OpenHeapSnapshotTempFileResponse::operator=(const OpenedFile& aRhs) -> OpenHeapSnapshotTempFileResponse&
274
0
{
275
0
    if (MaybeDestroy(TOpenedFile)) {
276
0
        new (mozilla::KnownNotNull, ptr_OpenedFile()) OpenedFile;
277
0
    }
278
0
    (*(ptr_OpenedFile())) = aRhs;
279
0
    mType = TOpenedFile;
280
0
    return (*(this));
281
0
}
282
283
auto OpenHeapSnapshotTempFileResponse::operator=(OpenedFile&& aRhs) -> OpenHeapSnapshotTempFileResponse&
284
0
{
285
0
    if (MaybeDestroy(TOpenedFile)) {
286
0
        new (mozilla::KnownNotNull, ptr_OpenedFile()) OpenedFile;
287
0
    }
288
0
    (*(ptr_OpenedFile())) = std::move(aRhs);
289
0
    mType = TOpenedFile;
290
0
    return (*(this));
291
0
}
292
293
auto OpenHeapSnapshotTempFileResponse::operator=(const OpenHeapSnapshotTempFileResponse& aRhs) -> OpenHeapSnapshotTempFileResponse&
294
0
{
295
0
    (aRhs).AssertSanity();
296
0
    Type t = (aRhs).type();
297
0
    switch (t) {
298
0
    case Tnsresult:
299
0
        {
300
0
            if (MaybeDestroy(t)) {
301
0
                new (mozilla::KnownNotNull, ptr_nsresult()) nsresult;
302
0
            }
303
0
            (*(ptr_nsresult())) = (aRhs).get_nsresult();
304
0
            break;
305
0
        }
306
0
    case TOpenedFile:
307
0
        {
308
0
            if (MaybeDestroy(t)) {
309
0
                new (mozilla::KnownNotNull, ptr_OpenedFile()) OpenedFile;
310
0
            }
311
0
            (*(ptr_OpenedFile())) = (aRhs).get_OpenedFile();
312
0
            break;
313
0
        }
314
0
    case T__None:
315
0
        {
316
0
            static_cast<void>(MaybeDestroy(t));
317
0
            break;
318
0
        }
319
0
    default:
320
0
        {
321
0
            mozilla::ipc::LogicError("unreached");
322
0
            break;
323
0
        }
324
0
    }
325
0
    mType = t;
326
0
    return (*(this));
327
0
}
328
329
auto OpenHeapSnapshotTempFileResponse::operator=(OpenHeapSnapshotTempFileResponse&& aRhs) -> OpenHeapSnapshotTempFileResponse&
330
0
{
331
0
    (aRhs).AssertSanity();
332
0
    Type t = (aRhs).type();
333
0
    switch (t) {
334
0
    case Tnsresult:
335
0
        {
336
0
            if (MaybeDestroy(t)) {
337
0
                new (mozilla::KnownNotNull, ptr_nsresult()) nsresult;
338
0
            }
339
0
            (*(ptr_nsresult())) = std::move((aRhs).get_nsresult());
340
0
            static_cast<void>((aRhs).MaybeDestroy(T__None));
341
0
            break;
342
0
        }
343
0
    case TOpenedFile:
344
0
        {
345
0
            if (MaybeDestroy(t)) {
346
0
                new (mozilla::KnownNotNull, ptr_OpenedFile()) OpenedFile;
347
0
            }
348
0
            (*(ptr_OpenedFile())) = std::move((aRhs).get_OpenedFile());
349
0
            static_cast<void>((aRhs).MaybeDestroy(T__None));
350
0
            break;
351
0
        }
352
0
    case T__None:
353
0
        {
354
0
            static_cast<void>(MaybeDestroy(t));
355
0
            break;
356
0
        }
357
0
    default:
358
0
        {
359
0
            mozilla::ipc::LogicError("unreached");
360
0
            break;
361
0
        }
362
0
    }
363
0
    (aRhs).mType = T__None;
364
0
    mType = t;
365
0
    return (*(this));
366
0
}
367
368
auto OpenHeapSnapshotTempFileResponse::operator==(const nsresult& aRhs) const -> bool
369
0
{
370
0
    return (get_nsresult()) == (aRhs);
371
0
}
372
373
auto OpenHeapSnapshotTempFileResponse::operator==(const OpenedFile& aRhs) const -> bool
374
0
{
375
0
    return (get_OpenedFile()) == (aRhs);
376
0
}
377
378
auto OpenHeapSnapshotTempFileResponse::operator==(const OpenHeapSnapshotTempFileResponse& aRhs) const -> bool
379
0
{
380
0
    if ((type()) != ((aRhs).type())) {
381
0
        return false;
382
0
    }
383
0
384
0
    switch (type()) {
385
0
    case Tnsresult:
386
0
        {
387
0
            return (get_nsresult()) == ((aRhs).get_nsresult());
388
0
        }
389
0
    case TOpenedFile:
390
0
        {
391
0
            return (get_OpenedFile()) == ((aRhs).get_OpenedFile());
392
0
        }
393
0
    default:
394
0
        {
395
0
            mozilla::ipc::LogicError("unreached");
396
0
            return false;
397
0
        }
398
0
    }
399
0
}
400
401
auto OpenHeapSnapshotTempFileResponse::get(nsresult* aOutValue) const -> void
402
0
{
403
0
    (*(aOutValue)) = get_nsresult();
404
0
}
405
406
auto OpenHeapSnapshotTempFileResponse::get(OpenedFile* aOutValue) const -> void
407
0
{
408
0
    (*(aOutValue)) = get_OpenedFile();
409
0
}
410
411
} // namespace devtools
412
} // namespace mozilla
413
414
namespace mozilla {
415
namespace ipc {
416
auto IPDLParamTraits<mozilla::devtools::OpenHeapSnapshotTempFileResponse>::Write(
417
        IPC::Message* aMsg,
418
        mozilla::ipc::IProtocol* aActor,
419
        const paramType& aVar) -> void
420
{
421
    typedef mozilla::devtools::OpenHeapSnapshotTempFileResponse union__;
422
    int type;
423
    type = (aVar).type();
424
    WriteIPDLParam(aMsg, aActor, type);
425
    // Sentinel = 'OpenHeapSnapshotTempFileResponse'
426
    (aMsg)->WriteSentinel(201569947);
427
428
    switch (type) {
429
    case union__::Tnsresult:
430
        {
431
            WriteIPDLParam(aMsg, aActor, (aVar).get_nsresult());
432
            // Sentinel = 'Tnsresult'
433
            (aMsg)->WriteSentinel(2293764539);
434
            return;
435
        }
436
    case union__::TOpenedFile:
437
        {
438
            WriteIPDLParam(aMsg, aActor, (aVar).get_OpenedFile());
439
            // Sentinel = 'TOpenedFile'
440
            (aMsg)->WriteSentinel(218745554);
441
            return;
442
        }
443
    default:
444
        {
445
            (aActor)->FatalError("unknown union type");
446
            return;
447
        }
448
    }
449
}
450
451
auto IPDLParamTraits<mozilla::devtools::OpenHeapSnapshotTempFileResponse>::Read(
452
        const IPC::Message* aMsg,
453
        PickleIterator* aIter,
454
        mozilla::ipc::IProtocol* aActor,
455
        paramType* aVar) -> bool
456
0
{
457
0
    typedef mozilla::devtools::OpenHeapSnapshotTempFileResponse union__;
458
0
    int type;
459
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&(type)))))) {
460
0
        (aActor)->FatalError("Error deserializing type of union OpenHeapSnapshotTempFileResponse");
461
0
        return false;
462
0
    }
463
0
    // Sentinel = 'OpenHeapSnapshotTempFileResponse'
464
0
    if ((!((aMsg)->ReadSentinel(aIter, 201569947)))) {
465
0
        mozilla::ipc::SentinelReadError("Error deserializing type of union OpenHeapSnapshotTempFileResponse");
466
0
        return false;
467
0
    }
468
0
469
0
    switch (type) {
470
0
    case union__::Tnsresult:
471
0
        {
472
0
            nsresult tmp = nsresult();
473
0
            (*(aVar)) = tmp;
474
0
            if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_nsresult())))))) {
475
0
                (aActor)->FatalError("Error deserializing variant Tnsresult of union OpenHeapSnapshotTempFileResponse");
476
0
                return false;
477
0
            }
478
0
            // Sentinel = 'Tnsresult'
479
0
            if ((!((aMsg)->ReadSentinel(aIter, 2293764539)))) {
480
0
                mozilla::ipc::SentinelReadError("Error deserializing variant Tnsresult of union OpenHeapSnapshotTempFileResponse");
481
0
                return false;
482
0
            }
483
0
            return true;
484
0
        }
485
0
    case union__::TOpenedFile:
486
0
        {
487
0
            mozilla::devtools::OpenedFile tmp = mozilla::devtools::OpenedFile();
488
0
            (*(aVar)) = tmp;
489
0
            if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_OpenedFile())))))) {
490
0
                (aActor)->FatalError("Error deserializing variant TOpenedFile of union OpenHeapSnapshotTempFileResponse");
491
0
                return false;
492
0
            }
493
0
            // Sentinel = 'TOpenedFile'
494
0
            if ((!((aMsg)->ReadSentinel(aIter, 218745554)))) {
495
0
                mozilla::ipc::SentinelReadError("Error deserializing variant TOpenedFile of union OpenHeapSnapshotTempFileResponse");
496
0
                return false;
497
0
            }
498
0
            return true;
499
0
        }
500
0
    default:
501
0
        {
502
0
            (aActor)->FatalError("unknown union type");
503
0
            return false;
504
0
        }
505
0
    }
506
0
}
507
508
} // namespace ipc
509
} // namespace mozilla