Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PCamerasChild.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/camera/PCamerasChild.h"
8
9
#include "mozilla/dom/PContentChild.h"
10
#include "mozilla/ipc/PBackgroundChild.h"
11
12
#include "nsIFile.h"
13
#include "GeckoProfiler.h"
14
15
namespace mozilla {
16
namespace camera {
17
18
19
auto PCamerasChild::Recv__delete__() -> mozilla::ipc::IPCResult
20
0
{
21
0
    return IPC_OK();
22
0
}
23
24
auto PCamerasChild::ActorDestroy(ActorDestroyReason aWhy) -> void
25
0
{
26
0
}
27
28
MOZ_IMPLICIT PCamerasChild::PCamerasChild() :
29
    mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
30
    mLivenessState(mozilla::ipc::LivenessState::Dead)
31
0
{
32
0
    MOZ_COUNT_CTOR(PCamerasChild);
33
0
}
34
35
PCamerasChild::~PCamerasChild()
36
0
{
37
0
    MOZ_COUNT_DTOR(PCamerasChild);
38
0
}
39
40
auto PCamerasChild::Manager() const -> PBackgroundChild*
41
0
{
42
0
    return static_cast<PBackgroundChild*>(IProtocol::Manager());
43
0
}
44
45
auto PCamerasChild::SendNumberOfCaptureDevices(const CaptureEngine& engine) -> bool
46
0
{
47
0
    IPC::Message* msg__ = PCameras::Msg_NumberOfCaptureDevices(Id());
48
0
49
0
    WriteIPDLParam(msg__, this, engine);
50
0
    // Sentinel = 'engine'
51
0
    (msg__)->WriteSentinel(749038912);
52
0
53
0
54
0
55
0
56
0
    if (mozilla::ipc::LoggingEnabledFor("PCamerasChild")) {
57
0
        mozilla::ipc::LogMessageForProtocol("PCamerasChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
58
0
    }
59
0
    AUTO_PROFILER_LABEL("PCameras::Msg_NumberOfCaptureDevices", OTHER);
60
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
61
0
        mozilla::ipc::LogicError("Transition error");
62
0
    }
63
0
64
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
65
0
    return sendok__;
66
0
}
67
68
auto PCamerasChild::SendNumberOfCapabilities(
69
        const CaptureEngine& engine,
70
        const nsCString& deviceUniqueIdUTF8) -> bool
71
0
{
72
0
    IPC::Message* msg__ = PCameras::Msg_NumberOfCapabilities(Id());
73
0
74
0
    WriteIPDLParam(msg__, this, engine);
75
0
    // Sentinel = 'engine'
76
0
    (msg__)->WriteSentinel(749038912);
77
0
    WriteIPDLParam(msg__, this, deviceUniqueIdUTF8);
78
0
    // Sentinel = 'deviceUniqueIdUTF8'
79
0
    (msg__)->WriteSentinel(1853575775);
80
0
81
0
82
0
83
0
84
0
    if (mozilla::ipc::LoggingEnabledFor("PCamerasChild")) {
85
0
        mozilla::ipc::LogMessageForProtocol("PCamerasChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
86
0
    }
87
0
    AUTO_PROFILER_LABEL("PCameras::Msg_NumberOfCapabilities", OTHER);
88
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
89
0
        mozilla::ipc::LogicError("Transition error");
90
0
    }
91
0
92
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
93
0
    return sendok__;
94
0
}
95
96
auto PCamerasChild::SendGetCaptureCapability(
97
        const CaptureEngine& engine,
98
        const nsCString& unique_idUTF8,
99
        const int& capability_number) -> bool
100
0
{
101
0
    IPC::Message* msg__ = PCameras::Msg_GetCaptureCapability(Id());
102
0
103
0
    WriteIPDLParam(msg__, this, engine);
104
0
    // Sentinel = 'engine'
105
0
    (msg__)->WriteSentinel(749038912);
106
0
    WriteIPDLParam(msg__, this, unique_idUTF8);
107
0
    // Sentinel = 'unique_idUTF8'
108
0
    (msg__)->WriteSentinel(1172699115);
109
0
    WriteIPDLParam(msg__, this, capability_number);
110
0
    // Sentinel = 'capability_number'
111
0
    (msg__)->WriteSentinel(2978179015);
112
0
113
0
114
0
115
0
116
0
    if (mozilla::ipc::LoggingEnabledFor("PCamerasChild")) {
117
0
        mozilla::ipc::LogMessageForProtocol("PCamerasChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
118
0
    }
119
0
    AUTO_PROFILER_LABEL("PCameras::Msg_GetCaptureCapability", OTHER);
120
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
121
0
        mozilla::ipc::LogicError("Transition error");
122
0
    }
123
0
124
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
125
0
    return sendok__;
126
0
}
127
128
auto PCamerasChild::SendGetCaptureDevice(
129
        const CaptureEngine& engine,
130
        const int& num) -> bool
131
0
{
132
0
    IPC::Message* msg__ = PCameras::Msg_GetCaptureDevice(Id());
133
0
134
0
    WriteIPDLParam(msg__, this, engine);
135
0
    // Sentinel = 'engine'
136
0
    (msg__)->WriteSentinel(749038912);
137
0
    WriteIPDLParam(msg__, this, num);
138
0
    // Sentinel = 'num'
139
0
    (msg__)->WriteSentinel(2933843091);
140
0
141
0
142
0
143
0
144
0
    if (mozilla::ipc::LoggingEnabledFor("PCamerasChild")) {
145
0
        mozilla::ipc::LogMessageForProtocol("PCamerasChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
146
0
    }
147
0
    AUTO_PROFILER_LABEL("PCameras::Msg_GetCaptureDevice", OTHER);
148
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
149
0
        mozilla::ipc::LogicError("Transition error");
150
0
    }
151
0
152
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
153
0
    return sendok__;
154
0
}
155
156
auto PCamerasChild::SendAllocateCaptureDevice(
157
        const CaptureEngine& engine,
158
        const nsCString& unique_idUTF8,
159
        const PrincipalInfo& principal) -> bool
160
0
{
161
0
    IPC::Message* msg__ = PCameras::Msg_AllocateCaptureDevice(Id());
162
0
163
0
    WriteIPDLParam(msg__, this, engine);
164
0
    // Sentinel = 'engine'
165
0
    (msg__)->WriteSentinel(749038912);
166
0
    WriteIPDLParam(msg__, this, unique_idUTF8);
167
0
    // Sentinel = 'unique_idUTF8'
168
0
    (msg__)->WriteSentinel(1172699115);
169
0
    WriteIPDLParam(msg__, this, principal);
170
0
    // Sentinel = 'principal'
171
0
    (msg__)->WriteSentinel(732240927);
172
0
173
0
174
0
175
0
176
0
    if (mozilla::ipc::LoggingEnabledFor("PCamerasChild")) {
177
0
        mozilla::ipc::LogMessageForProtocol("PCamerasChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
178
0
    }
179
0
    AUTO_PROFILER_LABEL("PCameras::Msg_AllocateCaptureDevice", OTHER);
180
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
181
0
        mozilla::ipc::LogicError("Transition error");
182
0
    }
183
0
184
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
185
0
    return sendok__;
186
0
}
187
188
auto PCamerasChild::SendReleaseCaptureDevice(
189
        const CaptureEngine& engine,
190
        const int& numdev) -> bool
191
0
{
192
0
    IPC::Message* msg__ = PCameras::Msg_ReleaseCaptureDevice(Id());
193
0
194
0
    WriteIPDLParam(msg__, this, engine);
195
0
    // Sentinel = 'engine'
196
0
    (msg__)->WriteSentinel(749038912);
197
0
    WriteIPDLParam(msg__, this, numdev);
198
0
    // Sentinel = 'numdev'
199
0
    (msg__)->WriteSentinel(2469121787);
200
0
201
0
202
0
203
0
204
0
    if (mozilla::ipc::LoggingEnabledFor("PCamerasChild")) {
205
0
        mozilla::ipc::LogMessageForProtocol("PCamerasChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
206
0
    }
207
0
    AUTO_PROFILER_LABEL("PCameras::Msg_ReleaseCaptureDevice", OTHER);
208
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
209
0
        mozilla::ipc::LogicError("Transition error");
210
0
    }
211
0
212
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
213
0
    return sendok__;
214
0
}
215
216
auto PCamerasChild::SendStartCapture(
217
        const CaptureEngine& engine,
218
        const int& numdev,
219
        const VideoCaptureCapability& capability) -> bool
220
0
{
221
0
    IPC::Message* msg__ = PCameras::Msg_StartCapture(Id());
222
0
223
0
    WriteIPDLParam(msg__, this, engine);
224
0
    // Sentinel = 'engine'
225
0
    (msg__)->WriteSentinel(749038912);
226
0
    WriteIPDLParam(msg__, this, numdev);
227
0
    // Sentinel = 'numdev'
228
0
    (msg__)->WriteSentinel(2469121787);
229
0
    WriteIPDLParam(msg__, this, capability);
230
0
    // Sentinel = 'capability'
231
0
    (msg__)->WriteSentinel(2146873968);
232
0
233
0
234
0
235
0
236
0
    if (mozilla::ipc::LoggingEnabledFor("PCamerasChild")) {
237
0
        mozilla::ipc::LogMessageForProtocol("PCamerasChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
238
0
    }
239
0
    AUTO_PROFILER_LABEL("PCameras::Msg_StartCapture", OTHER);
240
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
241
0
        mozilla::ipc::LogicError("Transition error");
242
0
    }
243
0
244
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
245
0
    return sendok__;
246
0
}
247
248
auto PCamerasChild::SendFocusOnSelectedSource(
249
        const CaptureEngine& engine,
250
        const int& numdev) -> bool
251
0
{
252
0
    IPC::Message* msg__ = PCameras::Msg_FocusOnSelectedSource(Id());
253
0
254
0
    WriteIPDLParam(msg__, this, engine);
255
0
    // Sentinel = 'engine'
256
0
    (msg__)->WriteSentinel(749038912);
257
0
    WriteIPDLParam(msg__, this, numdev);
258
0
    // Sentinel = 'numdev'
259
0
    (msg__)->WriteSentinel(2469121787);
260
0
261
0
262
0
263
0
264
0
    if (mozilla::ipc::LoggingEnabledFor("PCamerasChild")) {
265
0
        mozilla::ipc::LogMessageForProtocol("PCamerasChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
266
0
    }
267
0
    AUTO_PROFILER_LABEL("PCameras::Msg_FocusOnSelectedSource", OTHER);
268
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
269
0
        mozilla::ipc::LogicError("Transition error");
270
0
    }
271
0
272
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
273
0
    return sendok__;
274
0
}
275
276
auto PCamerasChild::SendStopCapture(
277
        const CaptureEngine& engine,
278
        const int& numdev) -> bool
279
0
{
280
0
    IPC::Message* msg__ = PCameras::Msg_StopCapture(Id());
281
0
282
0
    WriteIPDLParam(msg__, this, engine);
283
0
    // Sentinel = 'engine'
284
0
    (msg__)->WriteSentinel(749038912);
285
0
    WriteIPDLParam(msg__, this, numdev);
286
0
    // Sentinel = 'numdev'
287
0
    (msg__)->WriteSentinel(2469121787);
288
0
289
0
290
0
291
0
292
0
    if (mozilla::ipc::LoggingEnabledFor("PCamerasChild")) {
293
0
        mozilla::ipc::LogMessageForProtocol("PCamerasChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
294
0
    }
295
0
    AUTO_PROFILER_LABEL("PCameras::Msg_StopCapture", OTHER);
296
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
297
0
        mozilla::ipc::LogicError("Transition error");
298
0
    }
299
0
300
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
301
0
    return sendok__;
302
0
}
303
304
auto PCamerasChild::SendReleaseFrame(Shmem& s) -> bool
305
0
{
306
0
    IPC::Message* msg__ = PCameras::Msg_ReleaseFrame(Id());
307
0
308
0
    WriteIPDLParam(msg__, this, s);
309
0
    // Sentinel = 's'
310
0
    (msg__)->WriteSentinel(1835142386);
311
0
312
0
313
0
314
0
315
0
    if (mozilla::ipc::LoggingEnabledFor("PCamerasChild")) {
316
0
        mozilla::ipc::LogMessageForProtocol("PCamerasChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
317
0
    }
318
0
    AUTO_PROFILER_LABEL("PCameras::Msg_ReleaseFrame", OTHER);
319
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
320
0
        mozilla::ipc::LogicError("Transition error");
321
0
    }
322
0
323
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
324
0
    return sendok__;
325
0
}
326
327
auto PCamerasChild::SendAllDone() -> bool
328
0
{
329
0
    IPC::Message* msg__ = PCameras::Msg_AllDone(Id());
330
0
331
0
332
0
333
0
334
0
335
0
    if (mozilla::ipc::LoggingEnabledFor("PCamerasChild")) {
336
0
        mozilla::ipc::LogMessageForProtocol("PCamerasChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
337
0
    }
338
0
    AUTO_PROFILER_LABEL("PCameras::Msg_AllDone", OTHER);
339
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
340
0
        mozilla::ipc::LogicError("Transition error");
341
0
    }
342
0
343
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
344
0
    return sendok__;
345
0
}
346
347
auto PCamerasChild::SendEnsureInitialized(const CaptureEngine& engine) -> bool
348
0
{
349
0
    IPC::Message* msg__ = PCameras::Msg_EnsureInitialized(Id());
350
0
351
0
    WriteIPDLParam(msg__, this, engine);
352
0
    // Sentinel = 'engine'
353
0
    (msg__)->WriteSentinel(749038912);
354
0
355
0
356
0
357
0
358
0
    if (mozilla::ipc::LoggingEnabledFor("PCamerasChild")) {
359
0
        mozilla::ipc::LogMessageForProtocol("PCamerasChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
360
0
    }
361
0
    AUTO_PROFILER_LABEL("PCameras::Msg_EnsureInitialized", OTHER);
362
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
363
0
        mozilla::ipc::LogicError("Transition error");
364
0
    }
365
0
366
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
367
0
    return sendok__;
368
0
}
369
370
auto PCamerasChild::RemoveManagee(
371
        int32_t aProtocolId,
372
        IProtocol* aListener) -> void
373
0
{
374
0
    FatalError("unreached");
375
0
    return;
376
0
}
377
378
auto PCamerasChild::OnMessageReceived(const Message& msg__) -> PCamerasChild::Result
379
0
{
380
0
    switch ((msg__).type()) {
381
0
    case PCameras::Msg_DeliverFrame__ID:
382
0
        {
383
0
            if (mozilla::ipc::LoggingEnabledFor("PCamerasChild")) {
384
0
                mozilla::ipc::LogMessageForProtocol("PCamerasChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
385
0
            }
386
0
            AUTO_PROFILER_LABEL("PCameras::Msg_DeliverFrame", OTHER);
387
0
388
0
            PickleIterator iter__(msg__);
389
0
            CaptureEngine capEngine;
390
0
            int streamId;
391
0
            Shmem buffer;
392
0
            VideoFrameProperties props;
393
0
394
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(capEngine)))))) {
395
0
                FatalError("Error deserializing 'CaptureEngine'");
396
0
                return MsgValueError;
397
0
            }
398
0
            // Sentinel = 'capEngine'
399
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 653793175)))) {
400
0
                mozilla::ipc::SentinelReadError("Error deserializing 'CaptureEngine'");
401
0
                return MsgValueError;
402
0
            }
403
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(streamId)))))) {
404
0
                FatalError("Error deserializing 'int'");
405
0
                return MsgValueError;
406
0
            }
407
0
            // Sentinel = 'streamId'
408
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 456612599)))) {
409
0
                mozilla::ipc::SentinelReadError("Error deserializing 'int'");
410
0
                return MsgValueError;
411
0
            }
412
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(buffer)))))) {
413
0
                FatalError("Error deserializing 'Shmem'");
414
0
                return MsgValueError;
415
0
            }
416
0
            // Sentinel = 'buffer'
417
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4093250504)))) {
418
0
                mozilla::ipc::SentinelReadError("Error deserializing 'Shmem'");
419
0
                return MsgValueError;
420
0
            }
421
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(props)))))) {
422
0
                FatalError("Error deserializing 'VideoFrameProperties'");
423
0
                return MsgValueError;
424
0
            }
425
0
            // Sentinel = 'props'
426
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3139085495)))) {
427
0
                mozilla::ipc::SentinelReadError("Error deserializing 'VideoFrameProperties'");
428
0
                return MsgValueError;
429
0
            }
430
0
            (msg__).EndRead(iter__, (msg__).type());
431
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
432
0
                FatalError("Transition error");
433
0
                return MsgValueError;
434
0
            }
435
0
            if ((!(RecvDeliverFrame(capEngine, streamId, std::move(buffer), props)))) {
436
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
437
0
                // Error handled in mozilla::ipc::IPCResult
438
0
                return MsgProcessingError;
439
0
            }
440
0
441
0
            return MsgProcessed;
442
0
        }
443
0
    case PCameras::Msg_DeviceChange__ID:
444
0
        {
445
0
            if (mozilla::ipc::LoggingEnabledFor("PCamerasChild")) {
446
0
                mozilla::ipc::LogMessageForProtocol("PCamerasChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
447
0
            }
448
0
            AUTO_PROFILER_LABEL("PCameras::Msg_DeviceChange", OTHER);
449
0
450
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
451
0
                FatalError("Transition error");
452
0
                return MsgValueError;
453
0
            }
454
0
            if ((!(RecvDeviceChange()))) {
455
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
456
0
                // Error handled in mozilla::ipc::IPCResult
457
0
                return MsgProcessingError;
458
0
            }
459
0
460
0
            return MsgProcessed;
461
0
        }
462
0
    case PCameras::Msg_ReplyNumberOfCaptureDevices__ID:
463
0
        {
464
0
            if (mozilla::ipc::LoggingEnabledFor("PCamerasChild")) {
465
0
                mozilla::ipc::LogMessageForProtocol("PCamerasChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
466
0
            }
467
0
            AUTO_PROFILER_LABEL("PCameras::Msg_ReplyNumberOfCaptureDevices", OTHER);
468
0
469
0
            PickleIterator iter__(msg__);
470
0
            int numdev;
471
0
472
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(numdev)))))) {
473
0
                FatalError("Error deserializing 'int'");
474
0
                return MsgValueError;
475
0
            }
476
0
            // Sentinel = 'numdev'
477
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2469121787)))) {
478
0
                mozilla::ipc::SentinelReadError("Error deserializing 'int'");
479
0
                return MsgValueError;
480
0
            }
481
0
            (msg__).EndRead(iter__, (msg__).type());
482
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
483
0
                FatalError("Transition error");
484
0
                return MsgValueError;
485
0
            }
486
0
            if ((!(RecvReplyNumberOfCaptureDevices(numdev)))) {
487
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
488
0
                // Error handled in mozilla::ipc::IPCResult
489
0
                return MsgProcessingError;
490
0
            }
491
0
492
0
            return MsgProcessed;
493
0
        }
494
0
    case PCameras::Msg_ReplyNumberOfCapabilities__ID:
495
0
        {
496
0
            if (mozilla::ipc::LoggingEnabledFor("PCamerasChild")) {
497
0
                mozilla::ipc::LogMessageForProtocol("PCamerasChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
498
0
            }
499
0
            AUTO_PROFILER_LABEL("PCameras::Msg_ReplyNumberOfCapabilities", OTHER);
500
0
501
0
            PickleIterator iter__(msg__);
502
0
            int numdev;
503
0
504
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(numdev)))))) {
505
0
                FatalError("Error deserializing 'int'");
506
0
                return MsgValueError;
507
0
            }
508
0
            // Sentinel = 'numdev'
509
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2469121787)))) {
510
0
                mozilla::ipc::SentinelReadError("Error deserializing 'int'");
511
0
                return MsgValueError;
512
0
            }
513
0
            (msg__).EndRead(iter__, (msg__).type());
514
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
515
0
                FatalError("Transition error");
516
0
                return MsgValueError;
517
0
            }
518
0
            if ((!(RecvReplyNumberOfCapabilities(numdev)))) {
519
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
520
0
                // Error handled in mozilla::ipc::IPCResult
521
0
                return MsgProcessingError;
522
0
            }
523
0
524
0
            return MsgProcessed;
525
0
        }
526
0
    case PCameras::Msg_ReplyAllocateCaptureDevice__ID:
527
0
        {
528
0
            if (mozilla::ipc::LoggingEnabledFor("PCamerasChild")) {
529
0
                mozilla::ipc::LogMessageForProtocol("PCamerasChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
530
0
            }
531
0
            AUTO_PROFILER_LABEL("PCameras::Msg_ReplyAllocateCaptureDevice", OTHER);
532
0
533
0
            PickleIterator iter__(msg__);
534
0
            int numdev;
535
0
536
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(numdev)))))) {
537
0
                FatalError("Error deserializing 'int'");
538
0
                return MsgValueError;
539
0
            }
540
0
            // Sentinel = 'numdev'
541
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2469121787)))) {
542
0
                mozilla::ipc::SentinelReadError("Error deserializing 'int'");
543
0
                return MsgValueError;
544
0
            }
545
0
            (msg__).EndRead(iter__, (msg__).type());
546
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
547
0
                FatalError("Transition error");
548
0
                return MsgValueError;
549
0
            }
550
0
            if ((!(RecvReplyAllocateCaptureDevice(numdev)))) {
551
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
552
0
                // Error handled in mozilla::ipc::IPCResult
553
0
                return MsgProcessingError;
554
0
            }
555
0
556
0
            return MsgProcessed;
557
0
        }
558
0
    case PCameras::Msg_ReplyGetCaptureCapability__ID:
559
0
        {
560
0
            if (mozilla::ipc::LoggingEnabledFor("PCamerasChild")) {
561
0
                mozilla::ipc::LogMessageForProtocol("PCamerasChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
562
0
            }
563
0
            AUTO_PROFILER_LABEL("PCameras::Msg_ReplyGetCaptureCapability", OTHER);
564
0
565
0
            PickleIterator iter__(msg__);
566
0
            VideoCaptureCapability cap;
567
0
568
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(cap)))))) {
569
0
                FatalError("Error deserializing 'VideoCaptureCapability'");
570
0
                return MsgValueError;
571
0
            }
572
0
            // Sentinel = 'cap'
573
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 405875051)))) {
574
0
                mozilla::ipc::SentinelReadError("Error deserializing 'VideoCaptureCapability'");
575
0
                return MsgValueError;
576
0
            }
577
0
            (msg__).EndRead(iter__, (msg__).type());
578
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
579
0
                FatalError("Transition error");
580
0
                return MsgValueError;
581
0
            }
582
0
            if ((!(RecvReplyGetCaptureCapability(cap)))) {
583
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
584
0
                // Error handled in mozilla::ipc::IPCResult
585
0
                return MsgProcessingError;
586
0
            }
587
0
588
0
            return MsgProcessed;
589
0
        }
590
0
    case PCameras::Msg_ReplyGetCaptureDevice__ID:
591
0
        {
592
0
            if (mozilla::ipc::LoggingEnabledFor("PCamerasChild")) {
593
0
                mozilla::ipc::LogMessageForProtocol("PCamerasChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
594
0
            }
595
0
            AUTO_PROFILER_LABEL("PCameras::Msg_ReplyGetCaptureDevice", OTHER);
596
0
597
0
            PickleIterator iter__(msg__);
598
0
            nsCString device_name;
599
0
            nsCString device_id;
600
0
            bool scary;
601
0
602
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(device_name)))))) {
603
0
                FatalError("Error deserializing 'nsCString'");
604
0
                return MsgValueError;
605
0
            }
606
0
            // Sentinel = 'device_name'
607
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2744663535)))) {
608
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
609
0
                return MsgValueError;
610
0
            }
611
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(device_id)))))) {
612
0
                FatalError("Error deserializing 'nsCString'");
613
0
                return MsgValueError;
614
0
            }
615
0
            // Sentinel = 'device_id'
616
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 31832543)))) {
617
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
618
0
                return MsgValueError;
619
0
            }
620
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(scary)))))) {
621
0
                FatalError("Error deserializing 'bool'");
622
0
                return MsgValueError;
623
0
            }
624
0
            // Sentinel = 'scary'
625
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 620600033)))) {
626
0
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
627
0
                return MsgValueError;
628
0
            }
629
0
            (msg__).EndRead(iter__, (msg__).type());
630
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
631
0
                FatalError("Transition error");
632
0
                return MsgValueError;
633
0
            }
634
0
            if ((!(RecvReplyGetCaptureDevice(device_name, device_id, scary)))) {
635
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
636
0
                // Error handled in mozilla::ipc::IPCResult
637
0
                return MsgProcessingError;
638
0
            }
639
0
640
0
            return MsgProcessed;
641
0
        }
642
0
    case PCameras::Msg_ReplyFailure__ID:
643
0
        {
644
0
            if (mozilla::ipc::LoggingEnabledFor("PCamerasChild")) {
645
0
                mozilla::ipc::LogMessageForProtocol("PCamerasChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
646
0
            }
647
0
            AUTO_PROFILER_LABEL("PCameras::Msg_ReplyFailure", OTHER);
648
0
649
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
650
0
                FatalError("Transition error");
651
0
                return MsgValueError;
652
0
            }
653
0
            if ((!(RecvReplyFailure()))) {
654
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
655
0
                // Error handled in mozilla::ipc::IPCResult
656
0
                return MsgProcessingError;
657
0
            }
658
0
659
0
            return MsgProcessed;
660
0
        }
661
0
    case PCameras::Msg_ReplySuccess__ID:
662
0
        {
663
0
            if (mozilla::ipc::LoggingEnabledFor("PCamerasChild")) {
664
0
                mozilla::ipc::LogMessageForProtocol("PCamerasChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
665
0
            }
666
0
            AUTO_PROFILER_LABEL("PCameras::Msg_ReplySuccess", OTHER);
667
0
668
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
669
0
                FatalError("Transition error");
670
0
                return MsgValueError;
671
0
            }
672
0
            if ((!(RecvReplySuccess()))) {
673
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
674
0
                // Error handled in mozilla::ipc::IPCResult
675
0
                return MsgProcessingError;
676
0
            }
677
0
678
0
            return MsgProcessed;
679
0
        }
680
0
    case PCameras::Msg___delete____ID:
681
0
        {
682
0
            if (mozilla::ipc::LoggingEnabledFor("PCamerasChild")) {
683
0
                mozilla::ipc::LogMessageForProtocol("PCamerasChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
684
0
            }
685
0
            AUTO_PROFILER_LABEL("PCameras::Msg___delete__", OTHER);
686
0
687
0
            PickleIterator iter__(msg__);
688
0
            PCamerasChild* actor;
689
0
690
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) {
691
0
                FatalError("Error deserializing 'PCamerasChild'");
692
0
                return MsgValueError;
693
0
            }
694
0
            if ((!((*((&(actor))))))) {
695
0
                FatalError("Error deserializing 'PCamerasChild'");
696
0
                return MsgValueError;
697
0
            }
698
0
            // Sentinel = 'actor'
699
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
700
0
                mozilla::ipc::SentinelReadError("Error deserializing 'PCamerasChild'");
701
0
                return MsgValueError;
702
0
            }
703
0
            (msg__).EndRead(iter__, (msg__).type());
704
0
            if ((!(StateTransition(true, (&(mLivenessState)))))) {
705
0
                FatalError("Transition error");
706
0
                return MsgValueError;
707
0
            }
708
0
            if ((!(Recv__delete__()))) {
709
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
710
0
                // Error handled in mozilla::ipc::IPCResult
711
0
                return MsgProcessingError;
712
0
            }
713
0
714
0
715
0
            IProtocol* mgr = (actor)->Manager();
716
0
            (actor)->DestroySubtree(Deletion);
717
0
            (actor)->DeallocSubtree();
718
0
            (mgr)->RemoveManagee(PCamerasMsgStart, actor);
719
0
720
0
            return MsgProcessed;
721
0
        }
722
0
    default:
723
0
        {
724
0
            return MsgNotKnown;
725
0
        }
726
0
    }
727
0
}
728
729
auto PCamerasChild::OnMessageReceived(
730
        const Message& msg__,
731
        Message*& reply__) -> PCamerasChild::Result
732
0
{
733
0
    return MsgNotKnown;
734
0
}
735
736
auto PCamerasChild::OnCallReceived(
737
        const Message& msg__,
738
        Message*& reply__) -> PCamerasChild::Result
739
0
{
740
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
741
0
    return MsgNotKnown;
742
0
}
743
744
auto PCamerasChild::GetProtocolTypeId() -> int32_t
745
0
{
746
0
    return PCamerasMsgStart;
747
0
}
748
749
auto PCamerasChild::DestroySubtree(ActorDestroyReason why) -> void
750
0
{
751
0
    // Unregister from our manager.
752
0
    Unregister(Id());
753
0
754
0
    // Reject owning pending responses.
755
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
756
0
757
0
    // Finally, destroy "us".
758
0
    ActorDestroy(why);
759
0
}
760
761
auto PCamerasChild::DeallocSubtree() -> void
762
0
{
763
0
}
764
765
766
767
} // namespace camera
768
} // namespace mozilla
769
namespace mozilla {
770
namespace ipc {
771
auto IPDLParamTraits<mozilla::camera::PCamerasChild>::Write(
772
        IPC::Message* aMsg,
773
        mozilla::ipc::IProtocol* aActor,
774
        const paramType& aVar) -> void
775
0
{
776
0
    int32_t id;
777
0
    if ((!(aVar))) {
778
0
        id = 0;
779
0
    }
780
0
    else {
781
0
        id = (aVar)->Id();
782
0
        if ((1) == (id)) {
783
0
            (aActor)->FatalError("actor has been |delete|d");
784
0
        }
785
0
    }
786
0
    WriteIPDLParam(aMsg, aActor, id);
787
0
}
788
789
auto IPDLParamTraits<mozilla::camera::PCamerasChild>::Read(
790
        const IPC::Message* aMsg,
791
        PickleIterator* aIter,
792
        mozilla::ipc::IProtocol* aActor,
793
        paramType* aVar) -> bool
794
0
{
795
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PCameras", PCamerasMsgStart);
796
0
    if ((actor).isNothing()) {
797
0
        return false;
798
0
    }
799
0
800
0
    (*(aVar)) = static_cast<mozilla::camera::PCamerasChild*>((actor).value());
801
0
    return true;
802
0
}
803
804
} // namespace ipc
805
} // namespace mozilla