Coverage Report

Created: 2018-09-25 14:53

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