Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PVideoDecoderChild.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/PVideoDecoderChild.h"
8
9
#include "mozilla/dom/PVideoDecoderManagerChild.h"
10
11
#include "nsIFile.h"
12
#include "GeckoProfiler.h"
13
14
namespace mozilla {
15
namespace dom {
16
17
18
auto PVideoDecoderChild::ActorDestroy(ActorDestroyReason aWhy) -> void
19
0
{
20
0
}
21
22
MOZ_IMPLICIT PVideoDecoderChild::PVideoDecoderChild() :
23
    mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
24
    mLivenessState(mozilla::ipc::LivenessState::Dead)
25
0
{
26
0
    MOZ_COUNT_CTOR(PVideoDecoderChild);
27
0
}
28
29
PVideoDecoderChild::~PVideoDecoderChild()
30
0
{
31
0
    MOZ_COUNT_DTOR(PVideoDecoderChild);
32
0
}
33
34
auto PVideoDecoderChild::Manager() const -> PVideoDecoderManagerChild*
35
0
{
36
0
    return static_cast<PVideoDecoderManagerChild*>(IProtocol::Manager());
37
0
}
38
39
auto PVideoDecoderChild::SendInit() -> bool
40
0
{
41
0
    IPC::Message* msg__ = PVideoDecoder::Msg_Init(Id());
42
0
43
0
44
0
45
0
46
0
47
0
    if (mozilla::ipc::LoggingEnabledFor("PVideoDecoderChild")) {
48
0
        mozilla::ipc::LogMessageForProtocol("PVideoDecoderChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
49
0
    }
50
0
    AUTO_PROFILER_LABEL("PVideoDecoder::Msg_Init", OTHER);
51
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
52
0
        mozilla::ipc::LogicError("Transition error");
53
0
    }
54
0
55
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
56
0
    return sendok__;
57
0
}
58
59
auto PVideoDecoderChild::SendInput(const MediaRawDataIPDL& data) -> bool
60
0
{
61
0
    IPC::Message* msg__ = PVideoDecoder::Msg_Input(Id());
62
0
63
0
    WriteIPDLParam(msg__, this, data);
64
0
    // Sentinel = 'data'
65
0
    (msg__)->WriteSentinel(843352540);
66
0
67
0
68
0
69
0
70
0
    if (mozilla::ipc::LoggingEnabledFor("PVideoDecoderChild")) {
71
0
        mozilla::ipc::LogMessageForProtocol("PVideoDecoderChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
72
0
    }
73
0
    AUTO_PROFILER_LABEL("PVideoDecoder::Msg_Input", OTHER);
74
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
75
0
        mozilla::ipc::LogicError("Transition error");
76
0
    }
77
0
78
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
79
0
    return sendok__;
80
0
}
81
82
auto PVideoDecoderChild::SendFlush() -> bool
83
0
{
84
0
    IPC::Message* msg__ = PVideoDecoder::Msg_Flush(Id());
85
0
86
0
87
0
88
0
89
0
90
0
    if (mozilla::ipc::LoggingEnabledFor("PVideoDecoderChild")) {
91
0
        mozilla::ipc::LogMessageForProtocol("PVideoDecoderChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
92
0
    }
93
0
    AUTO_PROFILER_LABEL("PVideoDecoder::Msg_Flush", OTHER);
94
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
95
0
        mozilla::ipc::LogicError("Transition error");
96
0
    }
97
0
98
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
99
0
    return sendok__;
100
0
}
101
102
auto PVideoDecoderChild::SendDrain() -> bool
103
0
{
104
0
    IPC::Message* msg__ = PVideoDecoder::Msg_Drain(Id());
105
0
106
0
107
0
108
0
109
0
110
0
    if (mozilla::ipc::LoggingEnabledFor("PVideoDecoderChild")) {
111
0
        mozilla::ipc::LogMessageForProtocol("PVideoDecoderChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
112
0
    }
113
0
    AUTO_PROFILER_LABEL("PVideoDecoder::Msg_Drain", OTHER);
114
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
115
0
        mozilla::ipc::LogicError("Transition error");
116
0
    }
117
0
118
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
119
0
    return sendok__;
120
0
}
121
122
auto PVideoDecoderChild::SendShutdown() -> bool
123
0
{
124
0
    IPC::Message* msg__ = PVideoDecoder::Msg_Shutdown(Id());
125
0
126
0
127
0
128
0
129
0
130
0
    if (mozilla::ipc::LoggingEnabledFor("PVideoDecoderChild")) {
131
0
        mozilla::ipc::LogMessageForProtocol("PVideoDecoderChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
132
0
    }
133
0
    AUTO_PROFILER_LABEL("PVideoDecoder::Msg_Shutdown", OTHER);
134
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
135
0
        mozilla::ipc::LogicError("Transition error");
136
0
    }
137
0
138
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
139
0
    return sendok__;
140
0
}
141
142
auto PVideoDecoderChild::SendSetSeekThreshold(const int64_t& time) -> bool
143
0
{
144
0
    IPC::Message* msg__ = PVideoDecoder::Msg_SetSeekThreshold(Id());
145
0
146
0
    WriteIPDLParam(msg__, this, time);
147
0
    // Sentinel = 'time'
148
0
    (msg__)->WriteSentinel(4231890935);
149
0
150
0
151
0
152
0
153
0
    if (mozilla::ipc::LoggingEnabledFor("PVideoDecoderChild")) {
154
0
        mozilla::ipc::LogMessageForProtocol("PVideoDecoderChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
155
0
    }
156
0
    AUTO_PROFILER_LABEL("PVideoDecoder::Msg_SetSeekThreshold", OTHER);
157
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
158
0
        mozilla::ipc::LogicError("Transition error");
159
0
    }
160
0
161
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
162
0
    return sendok__;
163
0
}
164
165
auto PVideoDecoderChild::Send__delete__(PVideoDecoderChild* actor) -> bool
166
0
{
167
0
    if ((!(actor))) {
168
0
        return false;
169
0
    }
170
0
171
0
    IPC::Message* msg__ = PVideoDecoder::Msg___delete__((actor)->Id());
172
0
173
0
    MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param");
174
0
    WriteIPDLParam(msg__, actor, actor);
175
0
    // Sentinel = 'actor'
176
0
    (msg__)->WriteSentinel(875202478);
177
0
178
0
179
0
180
0
    if (mozilla::ipc::LoggingEnabledFor("PVideoDecoderChild")) {
181
0
        mozilla::ipc::LogMessageForProtocol("PVideoDecoderChild", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
182
0
    }
183
0
    AUTO_PROFILER_LABEL("PVideoDecoder::Msg___delete__", OTHER);
184
0
    if ((!(StateTransition(true, (&((actor)->mLivenessState)))))) {
185
0
        mozilla::ipc::LogicError("Transition error");
186
0
    }
187
0
188
0
    bool sendok__ = ((actor)->GetIPCChannel())->Send(msg__);
189
0
190
0
    IProtocol* mgr = (actor)->Manager();
191
0
    (actor)->DestroySubtree(Deletion);
192
0
    (actor)->DeallocSubtree();
193
0
    (mgr)->RemoveManagee(PVideoDecoderMsgStart, actor);
194
0
    return sendok__;
195
0
}
196
197
auto PVideoDecoderChild::RemoveManagee(
198
        int32_t aProtocolId,
199
        IProtocol* aListener) -> void
200
0
{
201
0
    FatalError("unreached");
202
0
    return;
203
0
}
204
205
auto PVideoDecoderChild::OnMessageReceived(const Message& msg__) -> PVideoDecoderChild::Result
206
0
{
207
0
    switch ((msg__).type()) {
208
0
    case PVideoDecoder::Reply___delete____ID:
209
0
        {
210
0
            return MsgProcessed;
211
0
        }
212
0
    case PVideoDecoder::Msg_InitComplete__ID:
213
0
        {
214
0
            if (mozilla::ipc::LoggingEnabledFor("PVideoDecoderChild")) {
215
0
                mozilla::ipc::LogMessageForProtocol("PVideoDecoderChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
216
0
            }
217
0
            AUTO_PROFILER_LABEL("PVideoDecoder::Msg_InitComplete", OTHER);
218
0
219
0
            PickleIterator iter__(msg__);
220
0
            nsCString decoderDescription;
221
0
            bool hardware;
222
0
            nsCString hardwareReason;
223
0
            uint32_t conversion;
224
0
225
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(decoderDescription)))))) {
226
0
                FatalError("Error deserializing 'nsCString'");
227
0
                return MsgValueError;
228
0
            }
229
0
            // Sentinel = 'decoderDescription'
230
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3655557388)))) {
231
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
232
0
                return MsgValueError;
233
0
            }
234
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(hardware)))))) {
235
0
                FatalError("Error deserializing 'bool'");
236
0
                return MsgValueError;
237
0
            }
238
0
            // Sentinel = 'hardware'
239
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2165251472)))) {
240
0
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
241
0
                return MsgValueError;
242
0
            }
243
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(hardwareReason)))))) {
244
0
                FatalError("Error deserializing 'nsCString'");
245
0
                return MsgValueError;
246
0
            }
247
0
            // Sentinel = 'hardwareReason'
248
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 360765986)))) {
249
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
250
0
                return MsgValueError;
251
0
            }
252
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(conversion)))))) {
253
0
                FatalError("Error deserializing 'uint32_t'");
254
0
                return MsgValueError;
255
0
            }
256
0
            // Sentinel = 'conversion'
257
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1292757922)))) {
258
0
                mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
259
0
                return MsgValueError;
260
0
            }
261
0
            (msg__).EndRead(iter__, (msg__).type());
262
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
263
0
                FatalError("Transition error");
264
0
                return MsgValueError;
265
0
            }
266
0
            if ((!(RecvInitComplete(decoderDescription, hardware, hardwareReason, conversion)))) {
267
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
268
0
                // Error handled in mozilla::ipc::IPCResult
269
0
                return MsgProcessingError;
270
0
            }
271
0
272
0
            return MsgProcessed;
273
0
        }
274
0
    case PVideoDecoder::Msg_InitFailed__ID:
275
0
        {
276
0
            if (mozilla::ipc::LoggingEnabledFor("PVideoDecoderChild")) {
277
0
                mozilla::ipc::LogMessageForProtocol("PVideoDecoderChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
278
0
            }
279
0
            AUTO_PROFILER_LABEL("PVideoDecoder::Msg_InitFailed", OTHER);
280
0
281
0
            PickleIterator iter__(msg__);
282
0
            nsresult reason;
283
0
284
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(reason)))))) {
285
0
                FatalError("Error deserializing 'nsresult'");
286
0
                return MsgValueError;
287
0
            }
288
0
            // Sentinel = 'reason'
289
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4151390930)))) {
290
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
291
0
                return MsgValueError;
292
0
            }
293
0
            (msg__).EndRead(iter__, (msg__).type());
294
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
295
0
                FatalError("Transition error");
296
0
                return MsgValueError;
297
0
            }
298
0
            if ((!(RecvInitFailed(reason)))) {
299
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
300
0
                // Error handled in mozilla::ipc::IPCResult
301
0
                return MsgProcessingError;
302
0
            }
303
0
304
0
            return MsgProcessed;
305
0
        }
306
0
    case PVideoDecoder::Msg_FlushComplete__ID:
307
0
        {
308
0
            if (mozilla::ipc::LoggingEnabledFor("PVideoDecoderChild")) {
309
0
                mozilla::ipc::LogMessageForProtocol("PVideoDecoderChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
310
0
            }
311
0
            AUTO_PROFILER_LABEL("PVideoDecoder::Msg_FlushComplete", OTHER);
312
0
313
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
314
0
                FatalError("Transition error");
315
0
                return MsgValueError;
316
0
            }
317
0
            if ((!(RecvFlushComplete()))) {
318
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
319
0
                // Error handled in mozilla::ipc::IPCResult
320
0
                return MsgProcessingError;
321
0
            }
322
0
323
0
            return MsgProcessed;
324
0
        }
325
0
    case PVideoDecoder::Msg_Output__ID:
326
0
        {
327
0
            if (mozilla::ipc::LoggingEnabledFor("PVideoDecoderChild")) {
328
0
                mozilla::ipc::LogMessageForProtocol("PVideoDecoderChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
329
0
            }
330
0
            AUTO_PROFILER_LABEL("PVideoDecoder::Msg_Output", OTHER);
331
0
332
0
            PickleIterator iter__(msg__);
333
0
            VideoDataIPDL data;
334
0
335
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(data)))))) {
336
0
                FatalError("Error deserializing 'VideoDataIPDL'");
337
0
                return MsgValueError;
338
0
            }
339
0
            // Sentinel = 'data'
340
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 843352540)))) {
341
0
                mozilla::ipc::SentinelReadError("Error deserializing 'VideoDataIPDL'");
342
0
                return MsgValueError;
343
0
            }
344
0
            (msg__).EndRead(iter__, (msg__).type());
345
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
346
0
                FatalError("Transition error");
347
0
                return MsgValueError;
348
0
            }
349
0
            if ((!(RecvOutput(data)))) {
350
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
351
0
                // Error handled in mozilla::ipc::IPCResult
352
0
                return MsgProcessingError;
353
0
            }
354
0
355
0
            return MsgProcessed;
356
0
        }
357
0
    case PVideoDecoder::Msg_InputExhausted__ID:
358
0
        {
359
0
            if (mozilla::ipc::LoggingEnabledFor("PVideoDecoderChild")) {
360
0
                mozilla::ipc::LogMessageForProtocol("PVideoDecoderChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
361
0
            }
362
0
            AUTO_PROFILER_LABEL("PVideoDecoder::Msg_InputExhausted", OTHER);
363
0
364
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
365
0
                FatalError("Transition error");
366
0
                return MsgValueError;
367
0
            }
368
0
            if ((!(RecvInputExhausted()))) {
369
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
370
0
                // Error handled in mozilla::ipc::IPCResult
371
0
                return MsgProcessingError;
372
0
            }
373
0
374
0
            return MsgProcessed;
375
0
        }
376
0
    case PVideoDecoder::Msg_DrainComplete__ID:
377
0
        {
378
0
            if (mozilla::ipc::LoggingEnabledFor("PVideoDecoderChild")) {
379
0
                mozilla::ipc::LogMessageForProtocol("PVideoDecoderChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
380
0
            }
381
0
            AUTO_PROFILER_LABEL("PVideoDecoder::Msg_DrainComplete", OTHER);
382
0
383
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
384
0
                FatalError("Transition error");
385
0
                return MsgValueError;
386
0
            }
387
0
            if ((!(RecvDrainComplete()))) {
388
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
389
0
                // Error handled in mozilla::ipc::IPCResult
390
0
                return MsgProcessingError;
391
0
            }
392
0
393
0
            return MsgProcessed;
394
0
        }
395
0
    case PVideoDecoder::Msg_Error__ID:
396
0
        {
397
0
            if (mozilla::ipc::LoggingEnabledFor("PVideoDecoderChild")) {
398
0
                mozilla::ipc::LogMessageForProtocol("PVideoDecoderChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
399
0
            }
400
0
            AUTO_PROFILER_LABEL("PVideoDecoder::Msg_Error", OTHER);
401
0
402
0
            PickleIterator iter__(msg__);
403
0
            nsresult error;
404
0
405
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(error)))))) {
406
0
                FatalError("Error deserializing 'nsresult'");
407
0
                return MsgValueError;
408
0
            }
409
0
            // Sentinel = 'error'
410
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 313726327)))) {
411
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
412
0
                return MsgValueError;
413
0
            }
414
0
            (msg__).EndRead(iter__, (msg__).type());
415
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
416
0
                FatalError("Transition error");
417
0
                return MsgValueError;
418
0
            }
419
0
            if ((!(RecvError(error)))) {
420
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
421
0
                // Error handled in mozilla::ipc::IPCResult
422
0
                return MsgProcessingError;
423
0
            }
424
0
425
0
            return MsgProcessed;
426
0
        }
427
0
    default:
428
0
        {
429
0
            return MsgNotKnown;
430
0
        }
431
0
    }
432
0
}
433
434
auto PVideoDecoderChild::OnMessageReceived(
435
        const Message& msg__,
436
        Message*& reply__) -> PVideoDecoderChild::Result
437
0
{
438
0
    return MsgNotKnown;
439
0
}
440
441
auto PVideoDecoderChild::OnCallReceived(
442
        const Message& msg__,
443
        Message*& reply__) -> PVideoDecoderChild::Result
444
0
{
445
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
446
0
    return MsgNotKnown;
447
0
}
448
449
auto PVideoDecoderChild::GetProtocolTypeId() -> int32_t
450
0
{
451
0
    return PVideoDecoderMsgStart;
452
0
}
453
454
auto PVideoDecoderChild::DestroySubtree(ActorDestroyReason why) -> void
455
0
{
456
0
    // Unregister from our manager.
457
0
    Unregister(Id());
458
0
459
0
    // Reject owning pending responses.
460
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
461
0
462
0
    // Finally, destroy "us".
463
0
    ActorDestroy(why);
464
0
}
465
466
auto PVideoDecoderChild::DeallocSubtree() -> void
467
0
{
468
0
}
469
470
471
472
} // namespace dom
473
} // namespace mozilla
474
namespace mozilla {
475
namespace ipc {
476
auto IPDLParamTraits<mozilla::dom::PVideoDecoderChild>::Write(
477
        IPC::Message* aMsg,
478
        mozilla::ipc::IProtocol* aActor,
479
        const paramType& aVar) -> void
480
0
{
481
0
    int32_t id;
482
0
    if ((!(aVar))) {
483
0
        id = 0;
484
0
    }
485
0
    else {
486
0
        id = (aVar)->Id();
487
0
        if ((1) == (id)) {
488
0
            (aActor)->FatalError("actor has been |delete|d");
489
0
        }
490
0
    }
491
0
    WriteIPDLParam(aMsg, aActor, id);
492
0
}
493
494
auto IPDLParamTraits<mozilla::dom::PVideoDecoderChild>::Read(
495
        const IPC::Message* aMsg,
496
        PickleIterator* aIter,
497
        mozilla::ipc::IProtocol* aActor,
498
        paramType* aVar) -> bool
499
0
{
500
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PVideoDecoder", PVideoDecoderMsgStart);
501
0
    if ((actor).isNothing()) {
502
0
        return false;
503
0
    }
504
0
505
0
    (*(aVar)) = static_cast<mozilla::dom::PVideoDecoderChild*>((actor).value());
506
0
    return true;
507
0
}
508
509
} // namespace ipc
510
} // namespace mozilla