Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PGMPVideoDecoderParent.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/gmp/PGMPVideoDecoderParent.h"
8
9
#include "mozilla/gmp/PGMPContentParent.h"
10
11
#include "nsIFile.h"
12
#include "GeckoProfiler.h"
13
14
namespace mozilla {
15
namespace gmp {
16
17
18
auto PGMPVideoDecoderParent::Recv__delete__() -> mozilla::ipc::IPCResult
19
0
{
20
0
    return IPC_OK();
21
0
}
22
23
auto PGMPVideoDecoderParent::ActorDestroy(ActorDestroyReason aWhy) -> void
24
0
{
25
0
}
26
27
MOZ_IMPLICIT PGMPVideoDecoderParent::PGMPVideoDecoderParent() :
28
    mozilla::ipc::IProtocol(mozilla::ipc::ParentSide),
29
    mLivenessState(mozilla::ipc::LivenessState::Dead)
30
0
{
31
0
    MOZ_COUNT_CTOR(PGMPVideoDecoderParent);
32
0
}
33
34
PGMPVideoDecoderParent::~PGMPVideoDecoderParent()
35
0
{
36
0
    MOZ_COUNT_DTOR(PGMPVideoDecoderParent);
37
0
}
38
39
auto PGMPVideoDecoderParent::Manager() const -> PGMPContentParent*
40
0
{
41
0
    return static_cast<PGMPContentParent*>(IProtocol::Manager());
42
0
}
43
44
auto PGMPVideoDecoderParent::SendInitDecode(
45
        const GMPVideoCodec& aCodecSettings,
46
        const nsTArray<uint8_t>& aCodecSpecific,
47
        const int32_t& aCoreCount) -> bool
48
0
{
49
0
    IPC::Message* msg__ = PGMPVideoDecoder::Msg_InitDecode(Id());
50
0
51
0
    WriteIPDLParam(msg__, this, aCodecSettings);
52
0
    // Sentinel = 'aCodecSettings'
53
0
    (msg__)->WriteSentinel(394896860);
54
0
    WriteIPDLParam(msg__, this, aCodecSpecific);
55
0
    // Sentinel = 'aCodecSpecific'
56
0
    (msg__)->WriteSentinel(3773952059);
57
0
    WriteIPDLParam(msg__, this, aCoreCount);
58
0
    // Sentinel = 'aCoreCount'
59
0
    (msg__)->WriteSentinel(3418548679);
60
0
61
0
62
0
63
0
64
0
    if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoderParent")) {
65
0
        mozilla::ipc::LogMessageForProtocol("PGMPVideoDecoderParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
66
0
    }
67
0
    AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_InitDecode", OTHER);
68
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
69
0
        mozilla::ipc::LogicError("Transition error");
70
0
    }
71
0
72
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
73
0
    return sendok__;
74
0
}
75
76
auto PGMPVideoDecoderParent::SendDecode(
77
        const GMPVideoEncodedFrameData& aInputFrame,
78
        const bool& aMissingFrames,
79
        const nsTArray<uint8_t>& aCodecSpecificInfo,
80
        const int64_t& aRenderTimeMs) -> bool
81
0
{
82
0
    IPC::Message* msg__ = PGMPVideoDecoder::Msg_Decode(Id());
83
0
84
0
    WriteIPDLParam(msg__, this, aInputFrame);
85
0
    // Sentinel = 'aInputFrame'
86
0
    (msg__)->WriteSentinel(3664588317);
87
0
    WriteIPDLParam(msg__, this, aMissingFrames);
88
0
    // Sentinel = 'aMissingFrames'
89
0
    (msg__)->WriteSentinel(2267431183);
90
0
    WriteIPDLParam(msg__, this, aCodecSpecificInfo);
91
0
    // Sentinel = 'aCodecSpecificInfo'
92
0
    (msg__)->WriteSentinel(742576219);
93
0
    WriteIPDLParam(msg__, this, aRenderTimeMs);
94
0
    // Sentinel = 'aRenderTimeMs'
95
0
    (msg__)->WriteSentinel(2368677663);
96
0
97
0
98
0
99
0
100
0
    if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoderParent")) {
101
0
        mozilla::ipc::LogMessageForProtocol("PGMPVideoDecoderParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
102
0
    }
103
0
    AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_Decode", OTHER);
104
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
105
0
        mozilla::ipc::LogicError("Transition error");
106
0
    }
107
0
108
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
109
0
    return sendok__;
110
0
}
111
112
auto PGMPVideoDecoderParent::SendReset() -> bool
113
0
{
114
0
    IPC::Message* msg__ = PGMPVideoDecoder::Msg_Reset(Id());
115
0
116
0
117
0
118
0
119
0
120
0
    if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoderParent")) {
121
0
        mozilla::ipc::LogMessageForProtocol("PGMPVideoDecoderParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
122
0
    }
123
0
    AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_Reset", OTHER);
124
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
125
0
        mozilla::ipc::LogicError("Transition error");
126
0
    }
127
0
128
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
129
0
    return sendok__;
130
0
}
131
132
auto PGMPVideoDecoderParent::SendDrain() -> bool
133
0
{
134
0
    IPC::Message* msg__ = PGMPVideoDecoder::Msg_Drain(Id());
135
0
136
0
137
0
138
0
139
0
140
0
    if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoderParent")) {
141
0
        mozilla::ipc::LogMessageForProtocol("PGMPVideoDecoderParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
142
0
    }
143
0
    AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_Drain", OTHER);
144
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
145
0
        mozilla::ipc::LogicError("Transition error");
146
0
    }
147
0
148
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
149
0
    return sendok__;
150
0
}
151
152
auto PGMPVideoDecoderParent::SendDecodingComplete() -> bool
153
0
{
154
0
    IPC::Message* msg__ = PGMPVideoDecoder::Msg_DecodingComplete(Id());
155
0
156
0
157
0
158
0
159
0
160
0
    if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoderParent")) {
161
0
        mozilla::ipc::LogMessageForProtocol("PGMPVideoDecoderParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
162
0
    }
163
0
    AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_DecodingComplete", OTHER);
164
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
165
0
        mozilla::ipc::LogicError("Transition error");
166
0
    }
167
0
168
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
169
0
    return sendok__;
170
0
}
171
172
auto PGMPVideoDecoderParent::SendChildShmemForPool(Shmem& aFrameBuffer) -> bool
173
0
{
174
0
    IPC::Message* msg__ = PGMPVideoDecoder::Msg_ChildShmemForPool(Id());
175
0
176
0
    WriteIPDLParam(msg__, this, aFrameBuffer);
177
0
    // Sentinel = 'aFrameBuffer'
178
0
    (msg__)->WriteSentinel(3888831322);
179
0
180
0
181
0
182
0
183
0
    if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoderParent")) {
184
0
        mozilla::ipc::LogMessageForProtocol("PGMPVideoDecoderParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
185
0
    }
186
0
    AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_ChildShmemForPool", OTHER);
187
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
188
0
        mozilla::ipc::LogicError("Transition error");
189
0
    }
190
0
191
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
192
0
    return sendok__;
193
0
}
194
195
auto PGMPVideoDecoderParent::RemoveManagee(
196
        int32_t aProtocolId,
197
        IProtocol* aListener) -> void
198
0
{
199
0
    FatalError("unreached");
200
0
    return;
201
0
}
202
203
auto PGMPVideoDecoderParent::OnMessageReceived(const Message& msg__) -> PGMPVideoDecoderParent::Result
204
0
{
205
0
    switch ((msg__).type()) {
206
0
    case PGMPVideoDecoder::Msg___delete____ID:
207
0
        {
208
0
            if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoderParent")) {
209
0
                mozilla::ipc::LogMessageForProtocol("PGMPVideoDecoderParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
210
0
            }
211
0
            AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg___delete__", OTHER);
212
0
213
0
            PickleIterator iter__(msg__);
214
0
            PGMPVideoDecoderParent* actor;
215
0
216
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) {
217
0
                FatalError("Error deserializing 'PGMPVideoDecoderParent'");
218
0
                return MsgValueError;
219
0
            }
220
0
            if ((!((*((&(actor))))))) {
221
0
                FatalError("Error deserializing 'PGMPVideoDecoderParent'");
222
0
                return MsgValueError;
223
0
            }
224
0
            // Sentinel = 'actor'
225
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
226
0
                mozilla::ipc::SentinelReadError("Error deserializing 'PGMPVideoDecoderParent'");
227
0
                return MsgValueError;
228
0
            }
229
0
            (msg__).EndRead(iter__, (msg__).type());
230
0
            if ((!(StateTransition(true, (&(mLivenessState)))))) {
231
0
                FatalError("Transition error");
232
0
                return MsgValueError;
233
0
            }
234
0
            if ((!(Recv__delete__()))) {
235
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
236
0
                // Error handled in mozilla::ipc::IPCResult
237
0
                return MsgProcessingError;
238
0
            }
239
0
240
0
241
0
            IProtocol* mgr = (actor)->Manager();
242
0
            (actor)->DestroySubtree(Deletion);
243
0
            (actor)->DeallocSubtree();
244
0
            (mgr)->RemoveManagee(PGMPVideoDecoderMsgStart, actor);
245
0
246
0
            return MsgProcessed;
247
0
        }
248
0
    case PGMPVideoDecoder::Msg_Decoded__ID:
249
0
        {
250
0
            if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoderParent")) {
251
0
                mozilla::ipc::LogMessageForProtocol("PGMPVideoDecoderParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
252
0
            }
253
0
            AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_Decoded", OTHER);
254
0
255
0
            PickleIterator iter__(msg__);
256
0
            GMPVideoi420FrameData aDecodedFrame;
257
0
258
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aDecodedFrame)))))) {
259
0
                FatalError("Error deserializing 'GMPVideoi420FrameData'");
260
0
                return MsgValueError;
261
0
            }
262
0
            // Sentinel = 'aDecodedFrame'
263
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1155687621)))) {
264
0
                mozilla::ipc::SentinelReadError("Error deserializing 'GMPVideoi420FrameData'");
265
0
                return MsgValueError;
266
0
            }
267
0
            (msg__).EndRead(iter__, (msg__).type());
268
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
269
0
                FatalError("Transition error");
270
0
                return MsgValueError;
271
0
            }
272
0
            if ((!(RecvDecoded(aDecodedFrame)))) {
273
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
274
0
                // Error handled in mozilla::ipc::IPCResult
275
0
                return MsgProcessingError;
276
0
            }
277
0
278
0
            return MsgProcessed;
279
0
        }
280
0
    case PGMPVideoDecoder::Msg_ReceivedDecodedReferenceFrame__ID:
281
0
        {
282
0
            if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoderParent")) {
283
0
                mozilla::ipc::LogMessageForProtocol("PGMPVideoDecoderParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
284
0
            }
285
0
            AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_ReceivedDecodedReferenceFrame", OTHER);
286
0
287
0
            PickleIterator iter__(msg__);
288
0
            uint64_t aPictureId;
289
0
290
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aPictureId)))))) {
291
0
                FatalError("Error deserializing 'uint64_t'");
292
0
                return MsgValueError;
293
0
            }
294
0
            // Sentinel = 'aPictureId'
295
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 288389592)))) {
296
0
                mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
297
0
                return MsgValueError;
298
0
            }
299
0
            (msg__).EndRead(iter__, (msg__).type());
300
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
301
0
                FatalError("Transition error");
302
0
                return MsgValueError;
303
0
            }
304
0
            if ((!(RecvReceivedDecodedReferenceFrame(aPictureId)))) {
305
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
306
0
                // Error handled in mozilla::ipc::IPCResult
307
0
                return MsgProcessingError;
308
0
            }
309
0
310
0
            return MsgProcessed;
311
0
        }
312
0
    case PGMPVideoDecoder::Msg_ReceivedDecodedFrame__ID:
313
0
        {
314
0
            if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoderParent")) {
315
0
                mozilla::ipc::LogMessageForProtocol("PGMPVideoDecoderParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
316
0
            }
317
0
            AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_ReceivedDecodedFrame", OTHER);
318
0
319
0
            PickleIterator iter__(msg__);
320
0
            uint64_t aPictureId;
321
0
322
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aPictureId)))))) {
323
0
                FatalError("Error deserializing 'uint64_t'");
324
0
                return MsgValueError;
325
0
            }
326
0
            // Sentinel = 'aPictureId'
327
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 288389592)))) {
328
0
                mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
329
0
                return MsgValueError;
330
0
            }
331
0
            (msg__).EndRead(iter__, (msg__).type());
332
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
333
0
                FatalError("Transition error");
334
0
                return MsgValueError;
335
0
            }
336
0
            if ((!(RecvReceivedDecodedFrame(aPictureId)))) {
337
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
338
0
                // Error handled in mozilla::ipc::IPCResult
339
0
                return MsgProcessingError;
340
0
            }
341
0
342
0
            return MsgProcessed;
343
0
        }
344
0
    case PGMPVideoDecoder::Msg_InputDataExhausted__ID:
345
0
        {
346
0
            if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoderParent")) {
347
0
                mozilla::ipc::LogMessageForProtocol("PGMPVideoDecoderParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
348
0
            }
349
0
            AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_InputDataExhausted", OTHER);
350
0
351
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
352
0
                FatalError("Transition error");
353
0
                return MsgValueError;
354
0
            }
355
0
            if ((!(RecvInputDataExhausted()))) {
356
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
357
0
                // Error handled in mozilla::ipc::IPCResult
358
0
                return MsgProcessingError;
359
0
            }
360
0
361
0
            return MsgProcessed;
362
0
        }
363
0
    case PGMPVideoDecoder::Msg_DrainComplete__ID:
364
0
        {
365
0
            if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoderParent")) {
366
0
                mozilla::ipc::LogMessageForProtocol("PGMPVideoDecoderParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
367
0
            }
368
0
            AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_DrainComplete", OTHER);
369
0
370
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
371
0
                FatalError("Transition error");
372
0
                return MsgValueError;
373
0
            }
374
0
            if ((!(RecvDrainComplete()))) {
375
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
376
0
                // Error handled in mozilla::ipc::IPCResult
377
0
                return MsgProcessingError;
378
0
            }
379
0
380
0
            return MsgProcessed;
381
0
        }
382
0
    case PGMPVideoDecoder::Msg_ResetComplete__ID:
383
0
        {
384
0
            if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoderParent")) {
385
0
                mozilla::ipc::LogMessageForProtocol("PGMPVideoDecoderParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
386
0
            }
387
0
            AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_ResetComplete", OTHER);
388
0
389
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
390
0
                FatalError("Transition error");
391
0
                return MsgValueError;
392
0
            }
393
0
            if ((!(RecvResetComplete()))) {
394
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
395
0
                // Error handled in mozilla::ipc::IPCResult
396
0
                return MsgProcessingError;
397
0
            }
398
0
399
0
            return MsgProcessed;
400
0
        }
401
0
    case PGMPVideoDecoder::Msg_Error__ID:
402
0
        {
403
0
            if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoderParent")) {
404
0
                mozilla::ipc::LogMessageForProtocol("PGMPVideoDecoderParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
405
0
            }
406
0
            AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_Error", OTHER);
407
0
408
0
            PickleIterator iter__(msg__);
409
0
            GMPErr aErr;
410
0
411
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aErr)))))) {
412
0
                FatalError("Error deserializing 'GMPErr'");
413
0
                return MsgValueError;
414
0
            }
415
0
            // Sentinel = 'aErr'
416
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 540683382)))) {
417
0
                mozilla::ipc::SentinelReadError("Error deserializing 'GMPErr'");
418
0
                return MsgValueError;
419
0
            }
420
0
            (msg__).EndRead(iter__, (msg__).type());
421
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
422
0
                FatalError("Transition error");
423
0
                return MsgValueError;
424
0
            }
425
0
            if ((!(RecvError(aErr)))) {
426
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
427
0
                // Error handled in mozilla::ipc::IPCResult
428
0
                return MsgProcessingError;
429
0
            }
430
0
431
0
            return MsgProcessed;
432
0
        }
433
0
    case PGMPVideoDecoder::Msg_Shutdown__ID:
434
0
        {
435
0
            if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoderParent")) {
436
0
                mozilla::ipc::LogMessageForProtocol("PGMPVideoDecoderParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
437
0
            }
438
0
            AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_Shutdown", OTHER);
439
0
440
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
441
0
                FatalError("Transition error");
442
0
                return MsgValueError;
443
0
            }
444
0
            if ((!(RecvShutdown()))) {
445
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
446
0
                // Error handled in mozilla::ipc::IPCResult
447
0
                return MsgProcessingError;
448
0
            }
449
0
450
0
            return MsgProcessed;
451
0
        }
452
0
    case PGMPVideoDecoder::Msg_ParentShmemForPool__ID:
453
0
        {
454
0
            if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoderParent")) {
455
0
                mozilla::ipc::LogMessageForProtocol("PGMPVideoDecoderParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
456
0
            }
457
0
            AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_ParentShmemForPool", OTHER);
458
0
459
0
            PickleIterator iter__(msg__);
460
0
            Shmem aEncodedBuffer;
461
0
462
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aEncodedBuffer)))))) {
463
0
                FatalError("Error deserializing 'Shmem'");
464
0
                return MsgValueError;
465
0
            }
466
0
            // Sentinel = 'aEncodedBuffer'
467
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3335299401)))) {
468
0
                mozilla::ipc::SentinelReadError("Error deserializing 'Shmem'");
469
0
                return MsgValueError;
470
0
            }
471
0
            (msg__).EndRead(iter__, (msg__).type());
472
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
473
0
                FatalError("Transition error");
474
0
                return MsgValueError;
475
0
            }
476
0
            if ((!(RecvParentShmemForPool(std::move(aEncodedBuffer))))) {
477
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
478
0
                // Error handled in mozilla::ipc::IPCResult
479
0
                return MsgProcessingError;
480
0
            }
481
0
482
0
            return MsgProcessed;
483
0
        }
484
0
    default:
485
0
        {
486
0
            return MsgNotKnown;
487
0
        }
488
0
    }
489
0
}
490
491
auto PGMPVideoDecoderParent::OnMessageReceived(
492
        const Message& msg__,
493
        Message*& reply__) -> PGMPVideoDecoderParent::Result
494
0
{
495
0
    return MsgNotKnown;
496
0
}
497
498
auto PGMPVideoDecoderParent::OnCallReceived(
499
        const Message& msg__,
500
        Message*& reply__) -> PGMPVideoDecoderParent::Result
501
0
{
502
0
    switch ((msg__).type()) {
503
0
    case PGMPVideoDecoder::Msg_NeedShmem__ID:
504
0
        {
505
0
            if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoderParent")) {
506
0
                mozilla::ipc::LogMessageForProtocol("PGMPVideoDecoderParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
507
0
            }
508
0
            AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_NeedShmem", OTHER);
509
0
510
0
            PickleIterator iter__(msg__);
511
0
            uint32_t aFrameBufferSize;
512
0
513
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aFrameBufferSize)))))) {
514
0
                FatalError("Error deserializing 'uint32_t'");
515
0
                return MsgValueError;
516
0
            }
517
0
            // Sentinel = 'aFrameBufferSize'
518
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 182265385)))) {
519
0
                mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
520
0
                return MsgValueError;
521
0
            }
522
0
            (msg__).EndRead(iter__, (msg__).type());
523
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
524
0
                FatalError("Transition error");
525
0
                return MsgValueError;
526
0
            }
527
0
            int32_t id__ = Id();
528
0
            Shmem aMem;
529
0
            if ((!(AnswerNeedShmem(aFrameBufferSize, (&(aMem)))))) {
530
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
531
0
                // Error handled in mozilla::ipc::IPCResult
532
0
                return MsgProcessingError;
533
0
            }
534
0
535
0
            reply__ = PGMPVideoDecoder::Reply_NeedShmem(id__);
536
0
537
0
            WriteIPDLParam(reply__, this, aMem);
538
0
            // Sentinel = 'aMem'
539
0
            (reply__)->WriteSentinel(3574578916);
540
0
541
0
            if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoderParent")) {
542
0
                mozilla::ipc::LogMessageForProtocol("PGMPVideoDecoderParent", OtherPid(), "Sending reply ", (reply__)->type(), mozilla::ipc::MessageDirection::eSending);
543
0
            }
544
0
            return MsgProcessed;
545
0
        }
546
0
    default:
547
0
        {
548
0
            return MsgNotKnown;
549
0
        }
550
0
    }
551
0
}
552
553
auto PGMPVideoDecoderParent::GetProtocolTypeId() -> int32_t
554
0
{
555
0
    return PGMPVideoDecoderMsgStart;
556
0
}
557
558
auto PGMPVideoDecoderParent::DestroySubtree(ActorDestroyReason why) -> void
559
0
{
560
0
    // Unregister from our manager.
561
0
    Unregister(Id());
562
0
563
0
    // Reject owning pending responses.
564
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
565
0
566
0
    // Finally, destroy "us".
567
0
    ActorDestroy(why);
568
0
}
569
570
auto PGMPVideoDecoderParent::DeallocSubtree() -> void
571
0
{
572
0
}
573
574
575
576
} // namespace gmp
577
} // namespace mozilla
578
namespace mozilla {
579
namespace ipc {
580
auto IPDLParamTraits<mozilla::gmp::PGMPVideoDecoderParent>::Write(
581
        IPC::Message* aMsg,
582
        mozilla::ipc::IProtocol* aActor,
583
        const paramType& aVar) -> void
584
0
{
585
0
    int32_t id;
586
0
    if ((!(aVar))) {
587
0
        id = 0;
588
0
    }
589
0
    else {
590
0
        id = (aVar)->Id();
591
0
        if ((1) == (id)) {
592
0
            (aActor)->FatalError("actor has been |delete|d");
593
0
        }
594
0
    }
595
0
    WriteIPDLParam(aMsg, aActor, id);
596
0
}
597
598
auto IPDLParamTraits<mozilla::gmp::PGMPVideoDecoderParent>::Read(
599
        const IPC::Message* aMsg,
600
        PickleIterator* aIter,
601
        mozilla::ipc::IProtocol* aActor,
602
        paramType* aVar) -> bool
603
0
{
604
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PGMPVideoDecoder", PGMPVideoDecoderMsgStart);
605
0
    if ((actor).isNothing()) {
606
0
        return false;
607
0
    }
608
0
609
0
    (*(aVar)) = static_cast<mozilla::gmp::PGMPVideoDecoderParent*>((actor).value());
610
0
    return true;
611
0
}
612
613
} // namespace ipc
614
} // namespace mozilla