Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PAsmJSCacheEntry.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/PBackgroundParent.h"
8
#include "mozilla/ipc/PBackgroundChild.h"
9
#include "mozilla/dom/asmjscache/PAsmJSCacheEntry.h"
10
11
namespace mozilla {
12
namespace dom {
13
namespace asmjscache {
14
namespace PAsmJSCacheEntry {
15
16
nsresult
17
CreateEndpoints(
18
        base::ProcessId aParentDestPid,
19
        base::ProcessId aChildDestPid,
20
        mozilla::ipc::Endpoint<mozilla::dom::asmjscache::PAsmJSCacheEntryParent>* aParent,
21
        mozilla::ipc::Endpoint<mozilla::dom::asmjscache::PAsmJSCacheEntryChild>* aChild)
22
0
{
23
0
    return mozilla::ipc::CreateEndpoints(mozilla::ipc::PrivateIPDLInterface(), aParentDestPid, aChildDestPid, aParent, aChild);
24
0
}
25
IPC::Message*
26
Msg_OnOpenMetadataForRead(int32_t routingId)
27
0
{
28
0
    return IPC::Message::IPDLMessage(routingId, Msg_OnOpenMetadataForRead__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_SelectCacheFileToRead(int32_t routingId)
32
0
{
33
0
    return IPC::Message::IPDLMessage(routingId, Msg_SelectCacheFileToRead__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
Msg_OnOpenCacheFile(int32_t routingId)
37
0
{
38
0
    return IPC::Message::IPDLMessage(routingId, Msg_OnOpenCacheFile__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));
39
0
}
40
IPC::Message*
41
Msg_Close(int32_t routingId)
42
0
{
43
0
    return IPC::Message::IPDLMessage(routingId, Msg_Close__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));
44
0
}
45
IPC::Message*
46
Msg___delete__(int32_t routingId)
47
0
{
48
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));
49
0
}
50
IPC::Message*
51
Reply___delete__(int32_t routingId)
52
0
{
53
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));
54
0
}
55
56
} // namespace PAsmJSCacheEntry
57
} // namespace asmjscache
58
} // namespace dom
59
} // namespace mozilla
60
61
//-----------------------------------------------------------------------------
62
// Method definitions for the IPDL type |union OpenMetadataForReadResponse|
63
//
64
namespace mozilla {
65
namespace dom {
66
namespace asmjscache {
67
auto OpenMetadataForReadResponse::MaybeDestroy(Type aNewType) -> bool
68
0
{
69
0
    if ((mType) == (T__None)) {
70
0
        return true;
71
0
    }
72
0
    if ((mType) == (aNewType)) {
73
0
        return false;
74
0
    }
75
0
    switch (mType) {
76
0
    case TAsmJSCacheResult:
77
0
        {
78
0
            (ptr_AsmJSCacheResult())->~AsmJSCacheResult__tdef();
79
0
            break;
80
0
        }
81
0
    case Tuint32_t:
82
0
        {
83
0
            (ptr_uint32_t())->~uint32_t__tdef();
84
0
            break;
85
0
        }
86
0
    default:
87
0
        {
88
0
            mozilla::ipc::LogicError("not reached");
89
0
            break;
90
0
        }
91
0
    }
92
0
    return true;
93
0
}
94
95
MOZ_IMPLICIT OpenMetadataForReadResponse::OpenMetadataForReadResponse(const AsmJSCacheResult& aOther)
96
0
{
97
0
    new (mozilla::KnownNotNull, ptr_AsmJSCacheResult()) AsmJSCacheResult(aOther);
98
0
    mType = TAsmJSCacheResult;
99
0
}
100
101
MOZ_IMPLICIT OpenMetadataForReadResponse::OpenMetadataForReadResponse(AsmJSCacheResult&& aOther)
102
0
{
103
0
    new (mozilla::KnownNotNull, ptr_AsmJSCacheResult()) AsmJSCacheResult(std::move(aOther));
104
0
    mType = TAsmJSCacheResult;
105
0
}
106
107
MOZ_IMPLICIT OpenMetadataForReadResponse::OpenMetadataForReadResponse(const uint32_t& aOther)
108
0
{
109
0
    new (mozilla::KnownNotNull, ptr_uint32_t()) uint32_t(aOther);
110
0
    mType = Tuint32_t;
111
0
}
112
113
MOZ_IMPLICIT OpenMetadataForReadResponse::OpenMetadataForReadResponse(uint32_t&& aOther)
114
0
{
115
0
    new (mozilla::KnownNotNull, ptr_uint32_t()) uint32_t(std::move(aOther));
116
0
    mType = Tuint32_t;
117
0
}
118
119
MOZ_IMPLICIT OpenMetadataForReadResponse::OpenMetadataForReadResponse(const OpenMetadataForReadResponse& aOther)
120
0
{
121
0
    (aOther).AssertSanity();
122
0
    switch ((aOther).type()) {
123
0
    case TAsmJSCacheResult:
124
0
        {
125
0
            new (mozilla::KnownNotNull, ptr_AsmJSCacheResult()) AsmJSCacheResult((aOther).get_AsmJSCacheResult());
126
0
            break;
127
0
        }
128
0
    case Tuint32_t:
129
0
        {
130
0
            new (mozilla::KnownNotNull, ptr_uint32_t()) uint32_t((aOther).get_uint32_t());
131
0
            break;
132
0
        }
133
0
    case T__None:
134
0
        {
135
0
            break;
136
0
        }
137
0
    default:
138
0
        {
139
0
            mozilla::ipc::LogicError("unreached");
140
0
            return;
141
0
        }
142
0
    }
143
0
    mType = (aOther).type();
144
0
}
145
146
MOZ_IMPLICIT OpenMetadataForReadResponse::OpenMetadataForReadResponse(OpenMetadataForReadResponse&& aOther)
147
0
{
148
0
    (aOther).AssertSanity();
149
0
    Type t = (aOther).type();
150
0
    switch (t) {
151
0
    case TAsmJSCacheResult:
152
0
        {
153
0
            new (mozilla::KnownNotNull, ptr_AsmJSCacheResult()) AsmJSCacheResult(std::move((aOther).get_AsmJSCacheResult()));
154
0
            static_cast<void>((aOther).MaybeDestroy(T__None));
155
0
            break;
156
0
        }
157
0
    case Tuint32_t:
158
0
        {
159
0
            new (mozilla::KnownNotNull, ptr_uint32_t()) uint32_t(std::move((aOther).get_uint32_t()));
160
0
            static_cast<void>((aOther).MaybeDestroy(T__None));
161
0
            break;
162
0
        }
163
0
    case T__None:
164
0
        {
165
0
            break;
166
0
        }
167
0
    default:
168
0
        {
169
0
            mozilla::ipc::LogicError("unreached");
170
0
            return;
171
0
        }
172
0
    }
173
0
    (aOther).mType = T__None;
174
0
    mType = t;
175
0
}
176
177
OpenMetadataForReadResponse::~OpenMetadataForReadResponse()
178
0
{
179
0
    static_cast<void>(MaybeDestroy(T__None));
180
0
}
181
182
auto OpenMetadataForReadResponse::operator=(const AsmJSCacheResult& aRhs) -> OpenMetadataForReadResponse&
183
0
{
184
0
    if (MaybeDestroy(TAsmJSCacheResult)) {
185
0
        new (mozilla::KnownNotNull, ptr_AsmJSCacheResult()) AsmJSCacheResult;
186
0
    }
187
0
    (*(ptr_AsmJSCacheResult())) = aRhs;
188
0
    mType = TAsmJSCacheResult;
189
0
    return (*(this));
190
0
}
191
192
auto OpenMetadataForReadResponse::operator=(AsmJSCacheResult&& aRhs) -> OpenMetadataForReadResponse&
193
0
{
194
0
    if (MaybeDestroy(TAsmJSCacheResult)) {
195
0
        new (mozilla::KnownNotNull, ptr_AsmJSCacheResult()) AsmJSCacheResult;
196
0
    }
197
0
    (*(ptr_AsmJSCacheResult())) = std::move(aRhs);
198
0
    mType = TAsmJSCacheResult;
199
0
    return (*(this));
200
0
}
201
202
auto OpenMetadataForReadResponse::operator=(const uint32_t& aRhs) -> OpenMetadataForReadResponse&
203
0
{
204
0
    if (MaybeDestroy(Tuint32_t)) {
205
0
        new (mozilla::KnownNotNull, ptr_uint32_t()) uint32_t;
206
0
    }
207
0
    (*(ptr_uint32_t())) = aRhs;
208
0
    mType = Tuint32_t;
209
0
    return (*(this));
210
0
}
211
212
auto OpenMetadataForReadResponse::operator=(uint32_t&& aRhs) -> OpenMetadataForReadResponse&
213
0
{
214
0
    if (MaybeDestroy(Tuint32_t)) {
215
0
        new (mozilla::KnownNotNull, ptr_uint32_t()) uint32_t;
216
0
    }
217
0
    (*(ptr_uint32_t())) = std::move(aRhs);
218
0
    mType = Tuint32_t;
219
0
    return (*(this));
220
0
}
221
222
auto OpenMetadataForReadResponse::operator=(const OpenMetadataForReadResponse& aRhs) -> OpenMetadataForReadResponse&
223
0
{
224
0
    (aRhs).AssertSanity();
225
0
    Type t = (aRhs).type();
226
0
    switch (t) {
227
0
    case TAsmJSCacheResult:
228
0
        {
229
0
            if (MaybeDestroy(t)) {
230
0
                new (mozilla::KnownNotNull, ptr_AsmJSCacheResult()) AsmJSCacheResult;
231
0
            }
232
0
            (*(ptr_AsmJSCacheResult())) = (aRhs).get_AsmJSCacheResult();
233
0
            break;
234
0
        }
235
0
    case Tuint32_t:
236
0
        {
237
0
            if (MaybeDestroy(t)) {
238
0
                new (mozilla::KnownNotNull, ptr_uint32_t()) uint32_t;
239
0
            }
240
0
            (*(ptr_uint32_t())) = (aRhs).get_uint32_t();
241
0
            break;
242
0
        }
243
0
    case T__None:
244
0
        {
245
0
            static_cast<void>(MaybeDestroy(t));
246
0
            break;
247
0
        }
248
0
    default:
249
0
        {
250
0
            mozilla::ipc::LogicError("unreached");
251
0
            break;
252
0
        }
253
0
    }
254
0
    mType = t;
255
0
    return (*(this));
256
0
}
257
258
auto OpenMetadataForReadResponse::operator=(OpenMetadataForReadResponse&& aRhs) -> OpenMetadataForReadResponse&
259
0
{
260
0
    (aRhs).AssertSanity();
261
0
    Type t = (aRhs).type();
262
0
    switch (t) {
263
0
    case TAsmJSCacheResult:
264
0
        {
265
0
            if (MaybeDestroy(t)) {
266
0
                new (mozilla::KnownNotNull, ptr_AsmJSCacheResult()) AsmJSCacheResult;
267
0
            }
268
0
            (*(ptr_AsmJSCacheResult())) = std::move((aRhs).get_AsmJSCacheResult());
269
0
            static_cast<void>((aRhs).MaybeDestroy(T__None));
270
0
            break;
271
0
        }
272
0
    case Tuint32_t:
273
0
        {
274
0
            if (MaybeDestroy(t)) {
275
0
                new (mozilla::KnownNotNull, ptr_uint32_t()) uint32_t;
276
0
            }
277
0
            (*(ptr_uint32_t())) = std::move((aRhs).get_uint32_t());
278
0
            static_cast<void>((aRhs).MaybeDestroy(T__None));
279
0
            break;
280
0
        }
281
0
    case T__None:
282
0
        {
283
0
            static_cast<void>(MaybeDestroy(t));
284
0
            break;
285
0
        }
286
0
    default:
287
0
        {
288
0
            mozilla::ipc::LogicError("unreached");
289
0
            break;
290
0
        }
291
0
    }
292
0
    (aRhs).mType = T__None;
293
0
    mType = t;
294
0
    return (*(this));
295
0
}
296
297
auto OpenMetadataForReadResponse::operator==(const AsmJSCacheResult& aRhs) const -> bool
298
0
{
299
0
    return (get_AsmJSCacheResult()) == (aRhs);
300
0
}
301
302
auto OpenMetadataForReadResponse::operator==(const uint32_t& aRhs) const -> bool
303
0
{
304
0
    return (get_uint32_t()) == (aRhs);
305
0
}
306
307
auto OpenMetadataForReadResponse::operator==(const OpenMetadataForReadResponse& aRhs) const -> bool
308
0
{
309
0
    if ((type()) != ((aRhs).type())) {
310
0
        return false;
311
0
    }
312
0
313
0
    switch (type()) {
314
0
    case TAsmJSCacheResult:
315
0
        {
316
0
            return (get_AsmJSCacheResult()) == ((aRhs).get_AsmJSCacheResult());
317
0
        }
318
0
    case Tuint32_t:
319
0
        {
320
0
            return (get_uint32_t()) == ((aRhs).get_uint32_t());
321
0
        }
322
0
    default:
323
0
        {
324
0
            mozilla::ipc::LogicError("unreached");
325
0
            return false;
326
0
        }
327
0
    }
328
0
}
329
330
auto OpenMetadataForReadResponse::get(AsmJSCacheResult* aOutValue) const -> void
331
0
{
332
0
    (*(aOutValue)) = get_AsmJSCacheResult();
333
0
}
334
335
auto OpenMetadataForReadResponse::get(uint32_t* aOutValue) const -> void
336
0
{
337
0
    (*(aOutValue)) = get_uint32_t();
338
0
}
339
340
} // namespace asmjscache
341
} // namespace dom
342
} // namespace mozilla
343
344
namespace mozilla {
345
namespace ipc {
346
auto IPDLParamTraits<mozilla::dom::asmjscache::OpenMetadataForReadResponse>::Write(
347
        IPC::Message* aMsg,
348
        mozilla::ipc::IProtocol* aActor,
349
        const paramType& aVar) -> void
350
{
351
    typedef mozilla::dom::asmjscache::OpenMetadataForReadResponse union__;
352
    int type;
353
    type = (aVar).type();
354
    WriteIPDLParam(aMsg, aActor, type);
355
    // Sentinel = 'OpenMetadataForReadResponse'
356
    (aMsg)->WriteSentinel(3070419442);
357
358
    switch (type) {
359
    case union__::TAsmJSCacheResult:
360
        {
361
            WriteIPDLParam(aMsg, aActor, (aVar).get_AsmJSCacheResult());
362
            // Sentinel = 'TAsmJSCacheResult'
363
            (aMsg)->WriteSentinel(3104508664);
364
            return;
365
        }
366
    case union__::Tuint32_t:
367
        {
368
            WriteIPDLParam(aMsg, aActor, (aVar).get_uint32_t());
369
            // Sentinel = 'Tuint32_t'
370
            (aMsg)->WriteSentinel(2137600675);
371
            return;
372
        }
373
    default:
374
        {
375
            (aActor)->FatalError("unknown union type");
376
            return;
377
        }
378
    }
379
}
380
381
auto IPDLParamTraits<mozilla::dom::asmjscache::OpenMetadataForReadResponse>::Read(
382
        const IPC::Message* aMsg,
383
        PickleIterator* aIter,
384
        mozilla::ipc::IProtocol* aActor,
385
        paramType* aVar) -> bool
386
0
{
387
0
    typedef mozilla::dom::asmjscache::OpenMetadataForReadResponse union__;
388
0
    int type;
389
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&(type)))))) {
390
0
        (aActor)->FatalError("Error deserializing type of union OpenMetadataForReadResponse");
391
0
        return false;
392
0
    }
393
0
    // Sentinel = 'OpenMetadataForReadResponse'
394
0
    if ((!((aMsg)->ReadSentinel(aIter, 3070419442)))) {
395
0
        mozilla::ipc::SentinelReadError("Error deserializing type of union OpenMetadataForReadResponse");
396
0
        return false;
397
0
    }
398
0
399
0
    switch (type) {
400
0
    case union__::TAsmJSCacheResult:
401
0
        {
402
0
            JS::AsmJSCacheResult tmp = JS::AsmJSCacheResult();
403
0
            (*(aVar)) = tmp;
404
0
            if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_AsmJSCacheResult())))))) {
405
0
                (aActor)->FatalError("Error deserializing variant TAsmJSCacheResult of union OpenMetadataForReadResponse");
406
0
                return false;
407
0
            }
408
0
            // Sentinel = 'TAsmJSCacheResult'
409
0
            if ((!((aMsg)->ReadSentinel(aIter, 3104508664)))) {
410
0
                mozilla::ipc::SentinelReadError("Error deserializing variant TAsmJSCacheResult of union OpenMetadataForReadResponse");
411
0
                return false;
412
0
            }
413
0
            return true;
414
0
        }
415
0
    case union__::Tuint32_t:
416
0
        {
417
0
            uint32_t tmp = uint32_t();
418
0
            (*(aVar)) = tmp;
419
0
            if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_uint32_t())))))) {
420
0
                (aActor)->FatalError("Error deserializing variant Tuint32_t of union OpenMetadataForReadResponse");
421
0
                return false;
422
0
            }
423
0
            // Sentinel = 'Tuint32_t'
424
0
            if ((!((aMsg)->ReadSentinel(aIter, 2137600675)))) {
425
0
                mozilla::ipc::SentinelReadError("Error deserializing variant Tuint32_t of union OpenMetadataForReadResponse");
426
0
                return false;
427
0
            }
428
0
            return true;
429
0
        }
430
0
    default:
431
0
        {
432
0
            (aActor)->FatalError("unknown union type");
433
0
            return false;
434
0
        }
435
0
    }
436
0
}
437
438
} // namespace ipc
439
} // namespace mozilla