Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PBackgroundIDBDatabaseRequest.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/indexedDB/PBackgroundIDBDatabaseParent.h"
8
#include "mozilla/dom/indexedDB/PBackgroundIDBDatabaseChild.h"
9
#include "mozilla/dom/PBackgroundMutableFileParent.h"
10
#include "mozilla/dom/PBackgroundMutableFileChild.h"
11
#include "mozilla/dom/indexedDB/PBackgroundIDBDatabaseRequest.h"
12
13
namespace mozilla {
14
namespace dom {
15
namespace indexedDB {
16
namespace PBackgroundIDBDatabaseRequest {
17
18
nsresult
19
CreateEndpoints(
20
        base::ProcessId aParentDestPid,
21
        base::ProcessId aChildDestPid,
22
        mozilla::ipc::Endpoint<mozilla::dom::indexedDB::PBackgroundIDBDatabaseRequestParent>* aParent,
23
        mozilla::ipc::Endpoint<mozilla::dom::indexedDB::PBackgroundIDBDatabaseRequestChild>* aChild)
24
0
{
25
0
    return mozilla::ipc::CreateEndpoints(mozilla::ipc::PrivateIPDLInterface(), aParentDestPid, aChildDestPid, aParent, aChild);
26
0
}
27
IPC::Message*
28
Msg___delete__(int32_t routingId)
29
0
{
30
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));
31
0
}
32
IPC::Message*
33
Reply___delete__(int32_t routingId)
34
0
{
35
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));
36
0
}
37
38
} // namespace PBackgroundIDBDatabaseRequest
39
} // namespace indexedDB
40
} // namespace dom
41
} // namespace mozilla
42
43
//-----------------------------------------------------------------------------
44
// Method definitions for the IPDL type |struct CreateFileRequestResponse|
45
//
46
namespace mozilla {
47
namespace dom {
48
namespace indexedDB {
49
auto CreateFileRequestResponse::operator==(const CreateFileRequestResponse& _o) const -> bool
50
0
{
51
0
    if ((!((mutableFileParent()) == ((_o).mutableFileParent())))) {
52
0
        return false;
53
0
    }
54
0
    if ((!((mutableFileChild()) == ((_o).mutableFileChild())))) {
55
0
        return false;
56
0
    }
57
0
    return true;
58
0
}
59
60
auto CreateFileRequestResponse::operator!=(const CreateFileRequestResponse& _o) const -> bool
61
0
{
62
0
    return (!(operator==(_o)));
63
0
}
64
65
} // namespace indexedDB
66
} // namespace dom
67
} // namespace mozilla
68
69
namespace mozilla {
70
namespace ipc {
71
auto IPDLParamTraits<mozilla::dom::indexedDB::CreateFileRequestResponse>::Write(
72
        IPC::Message* aMsg,
73
        mozilla::ipc::IProtocol* aActor,
74
        const paramType& aVar) -> void
75
0
{
76
0
    if ((mozilla::ipc::ParentSide) == ((aActor)->GetSide())) {
77
0
        MOZ_RELEASE_ASSERT((aVar).mutableFileParent(), "NULL actor value passed to non-nullable param");
78
0
        WriteIPDLParam(aMsg, aActor, (aVar).mutableFileParent());
79
0
        // Sentinel = 'mutableFile'
80
0
        (aMsg)->WriteSentinel(1328259167);
81
0
    }
82
0
    if ((mozilla::ipc::ChildSide) == ((aActor)->GetSide())) {
83
0
        MOZ_RELEASE_ASSERT((aVar).mutableFileChild(), "NULL actor value passed to non-nullable param");
84
0
        WriteIPDLParam(aMsg, aActor, (aVar).mutableFileChild());
85
0
        // Sentinel = 'mutableFile'
86
0
        (aMsg)->WriteSentinel(1328259167);
87
0
    }
88
0
}
89
90
auto IPDLParamTraits<mozilla::dom::indexedDB::CreateFileRequestResponse>::Read(
91
        const IPC::Message* aMsg,
92
        PickleIterator* aIter,
93
        mozilla::ipc::IProtocol* aActor,
94
        paramType* aVar) -> bool
95
0
{
96
0
    if ((mozilla::ipc::ParentSide) == ((aActor)->GetSide())) {
97
0
        if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->mutableFileParent())))))) {
98
0
            (aActor)->FatalError("Error deserializing 'mutableFileParent' (PBackgroundMutableFile) member of 'CreateFileRequestResponse'");
99
0
            return false;
100
0
        }
101
0
        if ((!((*((&((aVar)->mutableFileParent()))))))) {
102
0
            (aActor)->FatalError("Error deserializing 'mutableFileParent' (PBackgroundMutableFile) member of 'CreateFileRequestResponse'");
103
0
            return false;
104
0
        }
105
0
        // Sentinel = 'mutableFile'
106
0
        if ((!((aMsg)->ReadSentinel(aIter, 1328259167)))) {
107
0
            mozilla::ipc::SentinelReadError("Error deserializing 'mutableFileParent' (PBackgroundMutableFile) member of 'CreateFileRequestResponse'");
108
0
            return false;
109
0
        }
110
0
    }
111
0
    if ((mozilla::ipc::ChildSide) == ((aActor)->GetSide())) {
112
0
        if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->mutableFileChild())))))) {
113
0
            (aActor)->FatalError("Error deserializing 'mutableFileChild' (PBackgroundMutableFile) member of 'CreateFileRequestResponse'");
114
0
            return false;
115
0
        }
116
0
        if ((!((*((&((aVar)->mutableFileChild()))))))) {
117
0
            (aActor)->FatalError("Error deserializing 'mutableFileChild' (PBackgroundMutableFile) member of 'CreateFileRequestResponse'");
118
0
            return false;
119
0
        }
120
0
        // Sentinel = 'mutableFile'
121
0
        if ((!((aMsg)->ReadSentinel(aIter, 1328259167)))) {
122
0
            mozilla::ipc::SentinelReadError("Error deserializing 'mutableFileChild' (PBackgroundMutableFile) member of 'CreateFileRequestResponse'");
123
0
            return false;
124
0
        }
125
0
    }
126
0
    return true;
127
0
}
128
129
} // namespace ipc
130
} // namespace mozilla
131
132
//-----------------------------------------------------------------------------
133
// Method definitions for the IPDL type |union DatabaseRequestResponse|
134
//
135
namespace mozilla {
136
namespace dom {
137
namespace indexedDB {
138
auto DatabaseRequestResponse::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 TCreateFileRequestResponse:
153
0
        {
154
0
            (ptr_CreateFileRequestResponse())->~CreateFileRequestResponse__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 DatabaseRequestResponse::DatabaseRequestResponse(const nsresult& aOther)
167
0
{
168
0
    new (mozilla::KnownNotNull, ptr_nsresult()) nsresult(aOther);
169
0
    mType = Tnsresult;
170
0
}
171
172
MOZ_IMPLICIT DatabaseRequestResponse::DatabaseRequestResponse(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 DatabaseRequestResponse::DatabaseRequestResponse(const CreateFileRequestResponse& aOther)
179
0
{
180
0
    new (mozilla::KnownNotNull, ptr_CreateFileRequestResponse()) CreateFileRequestResponse(aOther);
181
0
    mType = TCreateFileRequestResponse;
182
0
}
183
184
MOZ_IMPLICIT DatabaseRequestResponse::DatabaseRequestResponse(CreateFileRequestResponse&& aOther)
185
0
{
186
0
    new (mozilla::KnownNotNull, ptr_CreateFileRequestResponse()) CreateFileRequestResponse(std::move(aOther));
187
0
    mType = TCreateFileRequestResponse;
188
0
}
189
190
MOZ_IMPLICIT DatabaseRequestResponse::DatabaseRequestResponse(const DatabaseRequestResponse& 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 TCreateFileRequestResponse:
200
0
        {
201
0
            new (mozilla::KnownNotNull, ptr_CreateFileRequestResponse()) CreateFileRequestResponse((aOther).get_CreateFileRequestResponse());
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 DatabaseRequestResponse::DatabaseRequestResponse(DatabaseRequestResponse&& 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 TCreateFileRequestResponse:
229
0
        {
230
0
            new (mozilla::KnownNotNull, ptr_CreateFileRequestResponse()) CreateFileRequestResponse(std::move((aOther).get_CreateFileRequestResponse()));
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
DatabaseRequestResponse::~DatabaseRequestResponse()
249
0
{
250
0
    static_cast<void>(MaybeDestroy(T__None));
251
0
}
252
253
auto DatabaseRequestResponse::operator=(const nsresult& aRhs) -> DatabaseRequestResponse&
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 DatabaseRequestResponse::operator=(nsresult&& aRhs) -> DatabaseRequestResponse&
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 DatabaseRequestResponse::operator=(const CreateFileRequestResponse& aRhs) -> DatabaseRequestResponse&
274
0
{
275
0
    if (MaybeDestroy(TCreateFileRequestResponse)) {
276
0
        new (mozilla::KnownNotNull, ptr_CreateFileRequestResponse()) CreateFileRequestResponse;
277
0
    }
278
0
    (*(ptr_CreateFileRequestResponse())) = aRhs;
279
0
    mType = TCreateFileRequestResponse;
280
0
    return (*(this));
281
0
}
282
283
auto DatabaseRequestResponse::operator=(CreateFileRequestResponse&& aRhs) -> DatabaseRequestResponse&
284
0
{
285
0
    if (MaybeDestroy(TCreateFileRequestResponse)) {
286
0
        new (mozilla::KnownNotNull, ptr_CreateFileRequestResponse()) CreateFileRequestResponse;
287
0
    }
288
0
    (*(ptr_CreateFileRequestResponse())) = std::move(aRhs);
289
0
    mType = TCreateFileRequestResponse;
290
0
    return (*(this));
291
0
}
292
293
auto DatabaseRequestResponse::operator=(const DatabaseRequestResponse& aRhs) -> DatabaseRequestResponse&
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 TCreateFileRequestResponse:
307
0
        {
308
0
            if (MaybeDestroy(t)) {
309
0
                new (mozilla::KnownNotNull, ptr_CreateFileRequestResponse()) CreateFileRequestResponse;
310
0
            }
311
0
            (*(ptr_CreateFileRequestResponse())) = (aRhs).get_CreateFileRequestResponse();
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 DatabaseRequestResponse::operator=(DatabaseRequestResponse&& aRhs) -> DatabaseRequestResponse&
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 TCreateFileRequestResponse:
344
0
        {
345
0
            if (MaybeDestroy(t)) {
346
0
                new (mozilla::KnownNotNull, ptr_CreateFileRequestResponse()) CreateFileRequestResponse;
347
0
            }
348
0
            (*(ptr_CreateFileRequestResponse())) = std::move((aRhs).get_CreateFileRequestResponse());
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 DatabaseRequestResponse::operator==(const nsresult& aRhs) const -> bool
369
0
{
370
0
    return (get_nsresult()) == (aRhs);
371
0
}
372
373
auto DatabaseRequestResponse::operator==(const CreateFileRequestResponse& aRhs) const -> bool
374
0
{
375
0
    return (get_CreateFileRequestResponse()) == (aRhs);
376
0
}
377
378
auto DatabaseRequestResponse::operator==(const DatabaseRequestResponse& 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 TCreateFileRequestResponse:
390
0
        {
391
0
            return (get_CreateFileRequestResponse()) == ((aRhs).get_CreateFileRequestResponse());
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 DatabaseRequestResponse::get(nsresult* aOutValue) const -> void
402
0
{
403
0
    (*(aOutValue)) = get_nsresult();
404
0
}
405
406
auto DatabaseRequestResponse::get(CreateFileRequestResponse* aOutValue) const -> void
407
0
{
408
0
    (*(aOutValue)) = get_CreateFileRequestResponse();
409
0
}
410
411
} // namespace indexedDB
412
} // namespace dom
413
} // namespace mozilla
414
415
namespace mozilla {
416
namespace ipc {
417
auto IPDLParamTraits<mozilla::dom::indexedDB::DatabaseRequestResponse>::Write(
418
        IPC::Message* aMsg,
419
        mozilla::ipc::IProtocol* aActor,
420
        const paramType& aVar) -> void
421
{
422
    typedef mozilla::dom::indexedDB::DatabaseRequestResponse union__;
423
    int type;
424
    type = (aVar).type();
425
    WriteIPDLParam(aMsg, aActor, type);
426
    // Sentinel = 'DatabaseRequestResponse'
427
    (aMsg)->WriteSentinel(943126744);
428
429
    switch (type) {
430
    case union__::Tnsresult:
431
        {
432
            WriteIPDLParam(aMsg, aActor, (aVar).get_nsresult());
433
            // Sentinel = 'Tnsresult'
434
            (aMsg)->WriteSentinel(2293764539);
435
            return;
436
        }
437
    case union__::TCreateFileRequestResponse:
438
        {
439
            WriteIPDLParam(aMsg, aActor, (aVar).get_CreateFileRequestResponse());
440
            // Sentinel = 'TCreateFileRequestResponse'
441
            (aMsg)->WriteSentinel(3189577818);
442
            return;
443
        }
444
    default:
445
        {
446
            (aActor)->FatalError("unknown union type");
447
            return;
448
        }
449
    }
450
}
451
452
auto IPDLParamTraits<mozilla::dom::indexedDB::DatabaseRequestResponse>::Read(
453
        const IPC::Message* aMsg,
454
        PickleIterator* aIter,
455
        mozilla::ipc::IProtocol* aActor,
456
        paramType* aVar) -> bool
457
0
{
458
0
    typedef mozilla::dom::indexedDB::DatabaseRequestResponse union__;
459
0
    int type;
460
0
    if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&(type)))))) {
461
0
        (aActor)->FatalError("Error deserializing type of union DatabaseRequestResponse");
462
0
        return false;
463
0
    }
464
0
    // Sentinel = 'DatabaseRequestResponse'
465
0
    if ((!((aMsg)->ReadSentinel(aIter, 943126744)))) {
466
0
        mozilla::ipc::SentinelReadError("Error deserializing type of union DatabaseRequestResponse");
467
0
        return false;
468
0
    }
469
0
470
0
    switch (type) {
471
0
    case union__::Tnsresult:
472
0
        {
473
0
            nsresult tmp = nsresult();
474
0
            (*(aVar)) = tmp;
475
0
            if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_nsresult())))))) {
476
0
                (aActor)->FatalError("Error deserializing variant Tnsresult of union DatabaseRequestResponse");
477
0
                return false;
478
0
            }
479
0
            // Sentinel = 'Tnsresult'
480
0
            if ((!((aMsg)->ReadSentinel(aIter, 2293764539)))) {
481
0
                mozilla::ipc::SentinelReadError("Error deserializing variant Tnsresult of union DatabaseRequestResponse");
482
0
                return false;
483
0
            }
484
0
            return true;
485
0
        }
486
0
    case union__::TCreateFileRequestResponse:
487
0
        {
488
0
            mozilla::dom::indexedDB::CreateFileRequestResponse tmp = mozilla::dom::indexedDB::CreateFileRequestResponse();
489
0
            (*(aVar)) = tmp;
490
0
            if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_CreateFileRequestResponse())))))) {
491
0
                (aActor)->FatalError("Error deserializing variant TCreateFileRequestResponse of union DatabaseRequestResponse");
492
0
                return false;
493
0
            }
494
0
            // Sentinel = 'TCreateFileRequestResponse'
495
0
            if ((!((aMsg)->ReadSentinel(aIter, 3189577818)))) {
496
0
                mozilla::ipc::SentinelReadError("Error deserializing variant TCreateFileRequestResponse of union DatabaseRequestResponse");
497
0
                return false;
498
0
            }
499
0
            return true;
500
0
        }
501
0
    default:
502
0
        {
503
0
            (aActor)->FatalError("unknown union type");
504
0
            return false;
505
0
        }
506
0
    }
507
0
}
508
509
} // namespace ipc
510
} // namespace mozilla