Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PUDPSocketChild.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/net/PUDPSocketChild.h"
8
#include "ipc/IPCMessageUtils.h"
9
10
#include "mozilla/net/PNeckoChild.h"
11
#include "mozilla/ipc/PBackgroundChild.h"
12
#include "mozilla/ipc/PFileDescriptorSetChild.h"
13
#include "mozilla/ipc/PChildToParentStreamChild.h"
14
#include "mozilla/ipc/PParentToChildStreamChild.h"
15
16
#include "nsIFile.h"
17
#include "GeckoProfiler.h"
18
19
namespace mozilla {
20
namespace net {
21
22
23
auto PUDPSocketChild::Recv__delete__() -> mozilla::ipc::IPCResult
24
0
{
25
0
    return IPC_OK();
26
0
}
27
28
auto PUDPSocketChild::ActorDestroy(ActorDestroyReason aWhy) -> void
29
0
{
30
0
}
31
32
MOZ_IMPLICIT PUDPSocketChild::PUDPSocketChild() :
33
    mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
34
    mLivenessState(mozilla::ipc::LivenessState::Dead)
35
0
{
36
0
    MOZ_COUNT_CTOR(PUDPSocketChild);
37
0
}
38
39
PUDPSocketChild::~PUDPSocketChild()
40
0
{
41
0
    MOZ_COUNT_DTOR(PUDPSocketChild);
42
0
}
43
44
auto PUDPSocketChild::SendBind(
45
        const UDPAddressInfo& addressInfo,
46
        const bool& addressReuse,
47
        const bool& loopback,
48
        const uint32_t& recvBufferSize,
49
        const uint32_t& sendBufferSize) -> bool
50
0
{
51
0
    IPC::Message* msg__ = PUDPSocket::Msg_Bind(Id());
52
0
53
0
    WriteIPDLParam(msg__, this, addressInfo);
54
0
    // Sentinel = 'addressInfo'
55
0
    (msg__)->WriteSentinel(120478815);
56
0
    WriteIPDLParam(msg__, this, addressReuse);
57
0
    // Sentinel = 'addressReuse'
58
0
    (msg__)->WriteSentinel(1196020092);
59
0
    WriteIPDLParam(msg__, this, loopback);
60
0
    // Sentinel = 'loopback'
61
0
    (msg__)->WriteSentinel(3759795879);
62
0
    WriteIPDLParam(msg__, this, recvBufferSize);
63
0
    // Sentinel = 'recvBufferSize'
64
0
    (msg__)->WriteSentinel(1394780231);
65
0
    WriteIPDLParam(msg__, this, sendBufferSize);
66
0
    // Sentinel = 'sendBufferSize'
67
0
    (msg__)->WriteSentinel(1728596941);
68
0
69
0
70
0
71
0
72
0
    if (mozilla::ipc::LoggingEnabledFor("PUDPSocketChild")) {
73
0
        mozilla::ipc::LogMessageForProtocol("PUDPSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
74
0
    }
75
0
    AUTO_PROFILER_LABEL("PUDPSocket::Msg_Bind", OTHER);
76
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
77
0
        mozilla::ipc::LogicError("Transition error");
78
0
    }
79
0
80
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
81
0
    return sendok__;
82
0
}
83
84
auto PUDPSocketChild::SendConnect(const UDPAddressInfo& addressInfo) -> bool
85
0
{
86
0
    IPC::Message* msg__ = PUDPSocket::Msg_Connect(Id());
87
0
88
0
    WriteIPDLParam(msg__, this, addressInfo);
89
0
    // Sentinel = 'addressInfo'
90
0
    (msg__)->WriteSentinel(120478815);
91
0
92
0
93
0
94
0
95
0
    if (mozilla::ipc::LoggingEnabledFor("PUDPSocketChild")) {
96
0
        mozilla::ipc::LogMessageForProtocol("PUDPSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
97
0
    }
98
0
    AUTO_PROFILER_LABEL("PUDPSocket::Msg_Connect", OTHER);
99
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
100
0
        mozilla::ipc::LogicError("Transition error");
101
0
    }
102
0
103
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
104
0
    return sendok__;
105
0
}
106
107
auto PUDPSocketChild::SendOutgoingData(
108
        const UDPData& data,
109
        const UDPSocketAddr& addr) -> bool
110
0
{
111
0
    IPC::Message* msg__ = PUDPSocket::Msg_OutgoingData(Id());
112
0
113
0
    WriteIPDLParam(msg__, this, data);
114
0
    // Sentinel = 'data'
115
0
    (msg__)->WriteSentinel(843352540);
116
0
    WriteIPDLParam(msg__, this, addr);
117
0
    // Sentinel = 'addr'
118
0
    (msg__)->WriteSentinel(1506625701);
119
0
120
0
121
0
122
0
123
0
    if (mozilla::ipc::LoggingEnabledFor("PUDPSocketChild")) {
124
0
        mozilla::ipc::LogMessageForProtocol("PUDPSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
125
0
    }
126
0
    AUTO_PROFILER_LABEL("PUDPSocket::Msg_OutgoingData", OTHER);
127
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
128
0
        mozilla::ipc::LogicError("Transition error");
129
0
    }
130
0
131
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
132
0
    return sendok__;
133
0
}
134
135
auto PUDPSocketChild::SendJoinMulticast(
136
        const nsCString& multicastAddress,
137
        const nsCString& iface) -> bool
138
0
{
139
0
    IPC::Message* msg__ = PUDPSocket::Msg_JoinMulticast(Id());
140
0
141
0
    WriteIPDLParam(msg__, this, multicastAddress);
142
0
    // Sentinel = 'multicastAddress'
143
0
    (msg__)->WriteSentinel(1375995778);
144
0
    WriteIPDLParam(msg__, this, iface);
145
0
    // Sentinel = 'iface'
146
0
    (msg__)->WriteSentinel(3356902307);
147
0
148
0
149
0
150
0
151
0
    if (mozilla::ipc::LoggingEnabledFor("PUDPSocketChild")) {
152
0
        mozilla::ipc::LogMessageForProtocol("PUDPSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
153
0
    }
154
0
    AUTO_PROFILER_LABEL("PUDPSocket::Msg_JoinMulticast", OTHER);
155
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
156
0
        mozilla::ipc::LogicError("Transition error");
157
0
    }
158
0
159
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
160
0
    return sendok__;
161
0
}
162
163
auto PUDPSocketChild::SendLeaveMulticast(
164
        const nsCString& multicastAddress,
165
        const nsCString& iface) -> bool
166
0
{
167
0
    IPC::Message* msg__ = PUDPSocket::Msg_LeaveMulticast(Id());
168
0
169
0
    WriteIPDLParam(msg__, this, multicastAddress);
170
0
    // Sentinel = 'multicastAddress'
171
0
    (msg__)->WriteSentinel(1375995778);
172
0
    WriteIPDLParam(msg__, this, iface);
173
0
    // Sentinel = 'iface'
174
0
    (msg__)->WriteSentinel(3356902307);
175
0
176
0
177
0
178
0
179
0
    if (mozilla::ipc::LoggingEnabledFor("PUDPSocketChild")) {
180
0
        mozilla::ipc::LogMessageForProtocol("PUDPSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
181
0
    }
182
0
    AUTO_PROFILER_LABEL("PUDPSocket::Msg_LeaveMulticast", OTHER);
183
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
184
0
        mozilla::ipc::LogicError("Transition error");
185
0
    }
186
0
187
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
188
0
    return sendok__;
189
0
}
190
191
auto PUDPSocketChild::SendClose() -> bool
192
0
{
193
0
    IPC::Message* msg__ = PUDPSocket::Msg_Close(Id());
194
0
195
0
196
0
197
0
198
0
199
0
    if (mozilla::ipc::LoggingEnabledFor("PUDPSocketChild")) {
200
0
        mozilla::ipc::LogMessageForProtocol("PUDPSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
201
0
    }
202
0
    AUTO_PROFILER_LABEL("PUDPSocket::Msg_Close", OTHER);
203
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
204
0
        mozilla::ipc::LogicError("Transition error");
205
0
    }
206
0
207
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
208
0
    return sendok__;
209
0
}
210
211
auto PUDPSocketChild::SendRequestDelete() -> bool
212
0
{
213
0
    IPC::Message* msg__ = PUDPSocket::Msg_RequestDelete(Id());
214
0
215
0
216
0
217
0
218
0
219
0
    if (mozilla::ipc::LoggingEnabledFor("PUDPSocketChild")) {
220
0
        mozilla::ipc::LogMessageForProtocol("PUDPSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
221
0
    }
222
0
    AUTO_PROFILER_LABEL("PUDPSocket::Msg_RequestDelete", OTHER);
223
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
224
0
        mozilla::ipc::LogicError("Transition error");
225
0
    }
226
0
227
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
228
0
    return sendok__;
229
0
}
230
231
auto PUDPSocketChild::RemoveManagee(
232
        int32_t aProtocolId,
233
        IProtocol* aListener) -> void
234
0
{
235
0
    FatalError("unreached");
236
0
    return;
237
0
}
238
239
auto PUDPSocketChild::OnMessageReceived(const Message& msg__) -> PUDPSocketChild::Result
240
0
{
241
0
    switch ((msg__).type()) {
242
0
    case PUDPSocket::Msg_CallbackOpened__ID:
243
0
        {
244
0
            if (mozilla::ipc::LoggingEnabledFor("PUDPSocketChild")) {
245
0
                mozilla::ipc::LogMessageForProtocol("PUDPSocketChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
246
0
            }
247
0
            AUTO_PROFILER_LABEL("PUDPSocket::Msg_CallbackOpened", OTHER);
248
0
249
0
            PickleIterator iter__(msg__);
250
0
            UDPAddressInfo addressInfo;
251
0
252
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(addressInfo)))))) {
253
0
                FatalError("Error deserializing 'UDPAddressInfo'");
254
0
                return MsgValueError;
255
0
            }
256
0
            // Sentinel = 'addressInfo'
257
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 120478815)))) {
258
0
                mozilla::ipc::SentinelReadError("Error deserializing 'UDPAddressInfo'");
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 ((!(RecvCallbackOpened(addressInfo)))) {
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 PUDPSocket::Msg_CallbackConnected__ID:
275
0
        {
276
0
            if (mozilla::ipc::LoggingEnabledFor("PUDPSocketChild")) {
277
0
                mozilla::ipc::LogMessageForProtocol("PUDPSocketChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
278
0
            }
279
0
            AUTO_PROFILER_LABEL("PUDPSocket::Msg_CallbackConnected", OTHER);
280
0
281
0
            PickleIterator iter__(msg__);
282
0
            UDPAddressInfo addressInfo;
283
0
284
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(addressInfo)))))) {
285
0
                FatalError("Error deserializing 'UDPAddressInfo'");
286
0
                return MsgValueError;
287
0
            }
288
0
            // Sentinel = 'addressInfo'
289
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 120478815)))) {
290
0
                mozilla::ipc::SentinelReadError("Error deserializing 'UDPAddressInfo'");
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 ((!(RecvCallbackConnected(addressInfo)))) {
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 PUDPSocket::Msg_CallbackClosed__ID:
307
0
        {
308
0
            if (mozilla::ipc::LoggingEnabledFor("PUDPSocketChild")) {
309
0
                mozilla::ipc::LogMessageForProtocol("PUDPSocketChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
310
0
            }
311
0
            AUTO_PROFILER_LABEL("PUDPSocket::Msg_CallbackClosed", OTHER);
312
0
313
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
314
0
                FatalError("Transition error");
315
0
                return MsgValueError;
316
0
            }
317
0
            if ((!(RecvCallbackClosed()))) {
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 PUDPSocket::Msg_CallbackReceivedData__ID:
326
0
        {
327
0
            if (mozilla::ipc::LoggingEnabledFor("PUDPSocketChild")) {
328
0
                mozilla::ipc::LogMessageForProtocol("PUDPSocketChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
329
0
            }
330
0
            AUTO_PROFILER_LABEL("PUDPSocket::Msg_CallbackReceivedData", OTHER);
331
0
332
0
            PickleIterator iter__(msg__);
333
0
            UDPAddressInfo addressInfo;
334
0
            nsTArray<uint8_t> data;
335
0
336
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(addressInfo)))))) {
337
0
                FatalError("Error deserializing 'UDPAddressInfo'");
338
0
                return MsgValueError;
339
0
            }
340
0
            // Sentinel = 'addressInfo'
341
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 120478815)))) {
342
0
                mozilla::ipc::SentinelReadError("Error deserializing 'UDPAddressInfo'");
343
0
                return MsgValueError;
344
0
            }
345
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(data)))))) {
346
0
                FatalError("Error deserializing 'nsTArray'");
347
0
                return MsgValueError;
348
0
            }
349
0
            // Sentinel = 'data'
350
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 843352540)))) {
351
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsTArray'");
352
0
                return MsgValueError;
353
0
            }
354
0
            (msg__).EndRead(iter__, (msg__).type());
355
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
356
0
                FatalError("Transition error");
357
0
                return MsgValueError;
358
0
            }
359
0
            if ((!(RecvCallbackReceivedData(addressInfo, std::move(data))))) {
360
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
361
0
                // Error handled in mozilla::ipc::IPCResult
362
0
                return MsgProcessingError;
363
0
            }
364
0
365
0
            return MsgProcessed;
366
0
        }
367
0
    case PUDPSocket::Msg_CallbackError__ID:
368
0
        {
369
0
            if (mozilla::ipc::LoggingEnabledFor("PUDPSocketChild")) {
370
0
                mozilla::ipc::LogMessageForProtocol("PUDPSocketChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
371
0
            }
372
0
            AUTO_PROFILER_LABEL("PUDPSocket::Msg_CallbackError", OTHER);
373
0
374
0
            PickleIterator iter__(msg__);
375
0
            nsCString message;
376
0
            nsCString filename;
377
0
            uint32_t lineNumber;
378
0
379
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(message)))))) {
380
0
                FatalError("Error deserializing 'nsCString'");
381
0
                return MsgValueError;
382
0
            }
383
0
            // Sentinel = 'message'
384
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1366108954)))) {
385
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
386
0
                return MsgValueError;
387
0
            }
388
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(filename)))))) {
389
0
                FatalError("Error deserializing 'nsCString'");
390
0
                return MsgValueError;
391
0
            }
392
0
            // Sentinel = 'filename'
393
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1198638255)))) {
394
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
395
0
                return MsgValueError;
396
0
            }
397
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(lineNumber)))))) {
398
0
                FatalError("Error deserializing 'uint32_t'");
399
0
                return MsgValueError;
400
0
            }
401
0
            // Sentinel = 'lineNumber'
402
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1005376855)))) {
403
0
                mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
404
0
                return MsgValueError;
405
0
            }
406
0
            (msg__).EndRead(iter__, (msg__).type());
407
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
408
0
                FatalError("Transition error");
409
0
                return MsgValueError;
410
0
            }
411
0
            if ((!(RecvCallbackError(message, filename, lineNumber)))) {
412
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
413
0
                // Error handled in mozilla::ipc::IPCResult
414
0
                return MsgProcessingError;
415
0
            }
416
0
417
0
            return MsgProcessed;
418
0
        }
419
0
    case PUDPSocket::Msg___delete____ID:
420
0
        {
421
0
            if (mozilla::ipc::LoggingEnabledFor("PUDPSocketChild")) {
422
0
                mozilla::ipc::LogMessageForProtocol("PUDPSocketChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
423
0
            }
424
0
            AUTO_PROFILER_LABEL("PUDPSocket::Msg___delete__", OTHER);
425
0
426
0
            PickleIterator iter__(msg__);
427
0
            PUDPSocketChild* actor;
428
0
429
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) {
430
0
                FatalError("Error deserializing 'PUDPSocketChild'");
431
0
                return MsgValueError;
432
0
            }
433
0
            if ((!((*((&(actor))))))) {
434
0
                FatalError("Error deserializing 'PUDPSocketChild'");
435
0
                return MsgValueError;
436
0
            }
437
0
            // Sentinel = 'actor'
438
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
439
0
                mozilla::ipc::SentinelReadError("Error deserializing 'PUDPSocketChild'");
440
0
                return MsgValueError;
441
0
            }
442
0
            (msg__).EndRead(iter__, (msg__).type());
443
0
            if ((!(StateTransition(true, (&(mLivenessState)))))) {
444
0
                FatalError("Transition error");
445
0
                return MsgValueError;
446
0
            }
447
0
            if ((!(Recv__delete__()))) {
448
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
449
0
                // Error handled in mozilla::ipc::IPCResult
450
0
                return MsgProcessingError;
451
0
            }
452
0
453
0
454
0
            IProtocol* mgr = (actor)->Manager();
455
0
            (actor)->DestroySubtree(Deletion);
456
0
            (actor)->DeallocSubtree();
457
0
            (mgr)->RemoveManagee(PUDPSocketMsgStart, actor);
458
0
459
0
            return MsgProcessed;
460
0
        }
461
0
    default:
462
0
        {
463
0
            return MsgNotKnown;
464
0
        }
465
0
    }
466
0
}
467
468
auto PUDPSocketChild::OnMessageReceived(
469
        const Message& msg__,
470
        Message*& reply__) -> PUDPSocketChild::Result
471
0
{
472
0
    return MsgNotKnown;
473
0
}
474
475
auto PUDPSocketChild::OnCallReceived(
476
        const Message& msg__,
477
        Message*& reply__) -> PUDPSocketChild::Result
478
0
{
479
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
480
0
    return MsgNotKnown;
481
0
}
482
483
auto PUDPSocketChild::GetProtocolTypeId() -> int32_t
484
0
{
485
0
    return PUDPSocketMsgStart;
486
0
}
487
488
auto PUDPSocketChild::DestroySubtree(ActorDestroyReason why) -> void
489
0
{
490
0
    // Unregister from our manager.
491
0
    Unregister(Id());
492
0
493
0
    // Reject owning pending responses.
494
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
495
0
496
0
    // Finally, destroy "us".
497
0
    ActorDestroy(why);
498
0
}
499
500
auto PUDPSocketChild::DeallocSubtree() -> void
501
0
{
502
0
}
503
504
505
506
} // namespace net
507
} // namespace mozilla
508
namespace mozilla {
509
namespace ipc {
510
auto IPDLParamTraits<mozilla::net::PUDPSocketChild>::Write(
511
        IPC::Message* aMsg,
512
        mozilla::ipc::IProtocol* aActor,
513
        const paramType& aVar) -> void
514
0
{
515
0
    int32_t id;
516
0
    if ((!(aVar))) {
517
0
        id = 0;
518
0
    }
519
0
    else {
520
0
        id = (aVar)->Id();
521
0
        if ((1) == (id)) {
522
0
            (aActor)->FatalError("actor has been |delete|d");
523
0
        }
524
0
    }
525
0
    WriteIPDLParam(aMsg, aActor, id);
526
0
}
527
528
auto IPDLParamTraits<mozilla::net::PUDPSocketChild>::Read(
529
        const IPC::Message* aMsg,
530
        PickleIterator* aIter,
531
        mozilla::ipc::IProtocol* aActor,
532
        paramType* aVar) -> bool
533
0
{
534
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PUDPSocket", PUDPSocketMsgStart);
535
0
    if ((actor).isNothing()) {
536
0
        return false;
537
0
    }
538
0
539
0
    (*(aVar)) = static_cast<mozilla::net::PUDPSocketChild*>((actor).value());
540
0
    return true;
541
0
}
542
543
} // namespace ipc
544
} // namespace mozilla