Coverage Report

Created: 2018-09-25 14:53

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