Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PRemotePrintJobChild.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/layout/PRemotePrintJobChild.h"
8
9
#include "mozilla/embedding/PPrintingChild.h"
10
11
#include "nsIFile.h"
12
#include "GeckoProfiler.h"
13
14
namespace mozilla {
15
namespace layout {
16
17
18
auto PRemotePrintJobChild::Recv__delete__() -> mozilla::ipc::IPCResult
19
0
{
20
0
    return IPC_OK();
21
0
}
22
23
auto PRemotePrintJobChild::ActorDestroy(ActorDestroyReason aWhy) -> void
24
0
{
25
0
}
26
27
MOZ_IMPLICIT PRemotePrintJobChild::PRemotePrintJobChild() :
28
    mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
29
    mLivenessState(mozilla::ipc::LivenessState::Dead)
30
0
{
31
0
    MOZ_COUNT_CTOR(PRemotePrintJobChild);
32
0
}
33
34
PRemotePrintJobChild::~PRemotePrintJobChild()
35
0
{
36
0
    MOZ_COUNT_DTOR(PRemotePrintJobChild);
37
0
}
38
39
auto PRemotePrintJobChild::Manager() const -> PPrintingChild*
40
0
{
41
0
    return static_cast<PPrintingChild*>(IProtocol::Manager());
42
0
}
43
44
auto PRemotePrintJobChild::SendAbortPrint(const nsresult& aRv) -> bool
45
0
{
46
0
    IPC::Message* msg__ = PRemotePrintJob::Msg_AbortPrint(Id());
47
0
48
0
    WriteIPDLParam(msg__, this, aRv);
49
0
    // Sentinel = 'aRv'
50
0
    (msg__)->WriteSentinel(2742041894);
51
0
52
0
53
0
54
0
55
0
    if (mozilla::ipc::LoggingEnabledFor("PRemotePrintJobChild")) {
56
0
        mozilla::ipc::LogMessageForProtocol("PRemotePrintJobChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
57
0
    }
58
0
    AUTO_PROFILER_LABEL("PRemotePrintJob::Msg_AbortPrint", OTHER);
59
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
60
0
        mozilla::ipc::LogicError("Transition error");
61
0
    }
62
0
63
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
64
0
    return sendok__;
65
0
}
66
67
auto PRemotePrintJobChild::SendInitializePrint(
68
        const nsString& aDocumentTitle,
69
        const nsString& aPrintToFile,
70
        const int32_t& aStartPage,
71
        const int32_t& aEndPage) -> bool
72
0
{
73
0
    IPC::Message* msg__ = PRemotePrintJob::Msg_InitializePrint(Id());
74
0
75
0
    WriteIPDLParam(msg__, this, aDocumentTitle);
76
0
    // Sentinel = 'aDocumentTitle'
77
0
    (msg__)->WriteSentinel(1351873518);
78
0
    WriteIPDLParam(msg__, this, aPrintToFile);
79
0
    // Sentinel = 'aPrintToFile'
80
0
    (msg__)->WriteSentinel(977976703);
81
0
    WriteIPDLParam(msg__, this, aStartPage);
82
0
    // Sentinel = 'aStartPage'
83
0
    (msg__)->WriteSentinel(1865995324);
84
0
    WriteIPDLParam(msg__, this, aEndPage);
85
0
    // Sentinel = 'aEndPage'
86
0
    (msg__)->WriteSentinel(2700499489);
87
0
88
0
89
0
90
0
91
0
    if (mozilla::ipc::LoggingEnabledFor("PRemotePrintJobChild")) {
92
0
        mozilla::ipc::LogMessageForProtocol("PRemotePrintJobChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
93
0
    }
94
0
    AUTO_PROFILER_LABEL("PRemotePrintJob::Msg_InitializePrint", OTHER);
95
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
96
0
        mozilla::ipc::LogicError("Transition error");
97
0
    }
98
0
99
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
100
0
    return sendok__;
101
0
}
102
103
auto PRemotePrintJobChild::SendProcessPage() -> bool
104
0
{
105
0
    IPC::Message* msg__ = PRemotePrintJob::Msg_ProcessPage(Id());
106
0
107
0
108
0
109
0
110
0
111
0
    if (mozilla::ipc::LoggingEnabledFor("PRemotePrintJobChild")) {
112
0
        mozilla::ipc::LogMessageForProtocol("PRemotePrintJobChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
113
0
    }
114
0
    AUTO_PROFILER_LABEL("PRemotePrintJob::Msg_ProcessPage", OTHER);
115
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
116
0
        mozilla::ipc::LogicError("Transition error");
117
0
    }
118
0
119
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
120
0
    return sendok__;
121
0
}
122
123
auto PRemotePrintJobChild::SendFinalizePrint() -> bool
124
0
{
125
0
    IPC::Message* msg__ = PRemotePrintJob::Msg_FinalizePrint(Id());
126
0
127
0
128
0
129
0
130
0
131
0
    if (mozilla::ipc::LoggingEnabledFor("PRemotePrintJobChild")) {
132
0
        mozilla::ipc::LogMessageForProtocol("PRemotePrintJobChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
133
0
    }
134
0
    AUTO_PROFILER_LABEL("PRemotePrintJob::Msg_FinalizePrint", OTHER);
135
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
136
0
        mozilla::ipc::LogicError("Transition error");
137
0
    }
138
0
139
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
140
0
    return sendok__;
141
0
}
142
143
auto PRemotePrintJobChild::SendStateChange(
144
        const long& aStateFlags,
145
        const nsresult& aStatus) -> bool
146
0
{
147
0
    IPC::Message* msg__ = PRemotePrintJob::Msg_StateChange(Id());
148
0
149
0
    WriteIPDLParam(msg__, this, aStateFlags);
150
0
    // Sentinel = 'aStateFlags'
151
0
    (msg__)->WriteSentinel(4037748614);
152
0
    WriteIPDLParam(msg__, this, aStatus);
153
0
    // Sentinel = 'aStatus'
154
0
    (msg__)->WriteSentinel(236002576);
155
0
156
0
157
0
158
0
159
0
    if (mozilla::ipc::LoggingEnabledFor("PRemotePrintJobChild")) {
160
0
        mozilla::ipc::LogMessageForProtocol("PRemotePrintJobChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
161
0
    }
162
0
    AUTO_PROFILER_LABEL("PRemotePrintJob::Msg_StateChange", OTHER);
163
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
164
0
        mozilla::ipc::LogicError("Transition error");
165
0
    }
166
0
167
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
168
0
    return sendok__;
169
0
}
170
171
auto PRemotePrintJobChild::SendProgressChange(
172
        const long& aCurSelfProgress,
173
        const long& aMaxSelfProgress,
174
        const long& aCurTotalProgress,
175
        const long& aMaxTotalProgress) -> bool
176
0
{
177
0
    IPC::Message* msg__ = PRemotePrintJob::Msg_ProgressChange(Id());
178
0
179
0
    WriteIPDLParam(msg__, this, aCurSelfProgress);
180
0
    // Sentinel = 'aCurSelfProgress'
181
0
    (msg__)->WriteSentinel(3889538918);
182
0
    WriteIPDLParam(msg__, this, aMaxSelfProgress);
183
0
    // Sentinel = 'aMaxSelfProgress'
184
0
    (msg__)->WriteSentinel(2579322770);
185
0
    WriteIPDLParam(msg__, this, aCurTotalProgress);
186
0
    // Sentinel = 'aCurTotalProgress'
187
0
    (msg__)->WriteSentinel(3893274129);
188
0
    WriteIPDLParam(msg__, this, aMaxTotalProgress);
189
0
    // Sentinel = 'aMaxTotalProgress'
190
0
    (msg__)->WriteSentinel(1178224797);
191
0
192
0
193
0
194
0
195
0
    if (mozilla::ipc::LoggingEnabledFor("PRemotePrintJobChild")) {
196
0
        mozilla::ipc::LogMessageForProtocol("PRemotePrintJobChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
197
0
    }
198
0
    AUTO_PROFILER_LABEL("PRemotePrintJob::Msg_ProgressChange", OTHER);
199
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
200
0
        mozilla::ipc::LogicError("Transition error");
201
0
    }
202
0
203
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
204
0
    return sendok__;
205
0
}
206
207
auto PRemotePrintJobChild::SendStatusChange(const nsresult& aStatus) -> bool
208
0
{
209
0
    IPC::Message* msg__ = PRemotePrintJob::Msg_StatusChange(Id());
210
0
211
0
    WriteIPDLParam(msg__, this, aStatus);
212
0
    // Sentinel = 'aStatus'
213
0
    (msg__)->WriteSentinel(236002576);
214
0
215
0
216
0
217
0
218
0
    if (mozilla::ipc::LoggingEnabledFor("PRemotePrintJobChild")) {
219
0
        mozilla::ipc::LogMessageForProtocol("PRemotePrintJobChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
220
0
    }
221
0
    AUTO_PROFILER_LABEL("PRemotePrintJob::Msg_StatusChange", OTHER);
222
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
223
0
        mozilla::ipc::LogicError("Transition error");
224
0
    }
225
0
226
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
227
0
    return sendok__;
228
0
}
229
230
auto PRemotePrintJobChild::RemoveManagee(
231
        int32_t aProtocolId,
232
        IProtocol* aListener) -> void
233
0
{
234
0
    FatalError("unreached");
235
0
    return;
236
0
}
237
238
auto PRemotePrintJobChild::OnMessageReceived(const Message& msg__) -> PRemotePrintJobChild::Result
239
0
{
240
0
    switch ((msg__).type()) {
241
0
    case PRemotePrintJob::Msg_AbortPrint__ID:
242
0
        {
243
0
            if (mozilla::ipc::LoggingEnabledFor("PRemotePrintJobChild")) {
244
0
                mozilla::ipc::LogMessageForProtocol("PRemotePrintJobChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
245
0
            }
246
0
            AUTO_PROFILER_LABEL("PRemotePrintJob::Msg_AbortPrint", OTHER);
247
0
248
0
            PickleIterator iter__(msg__);
249
0
            nsresult aRv;
250
0
251
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aRv)))))) {
252
0
                FatalError("Error deserializing 'nsresult'");
253
0
                return MsgValueError;
254
0
            }
255
0
            // Sentinel = 'aRv'
256
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2742041894)))) {
257
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
258
0
                return MsgValueError;
259
0
            }
260
0
            (msg__).EndRead(iter__, (msg__).type());
261
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
262
0
                FatalError("Transition error");
263
0
                return MsgValueError;
264
0
            }
265
0
            if ((!(RecvAbortPrint(aRv)))) {
266
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
267
0
                // Error handled in mozilla::ipc::IPCResult
268
0
                return MsgProcessingError;
269
0
            }
270
0
271
0
            return MsgProcessed;
272
0
        }
273
0
    case PRemotePrintJob::Msg_PrintInitializationResult__ID:
274
0
        {
275
0
            if (mozilla::ipc::LoggingEnabledFor("PRemotePrintJobChild")) {
276
0
                mozilla::ipc::LogMessageForProtocol("PRemotePrintJobChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
277
0
            }
278
0
            AUTO_PROFILER_LABEL("PRemotePrintJob::Msg_PrintInitializationResult", OTHER);
279
0
280
0
            PickleIterator iter__(msg__);
281
0
            nsresult aRv;
282
0
            FileDescriptor aFd;
283
0
284
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aRv)))))) {
285
0
                FatalError("Error deserializing 'nsresult'");
286
0
                return MsgValueError;
287
0
            }
288
0
            // Sentinel = 'aRv'
289
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2742041894)))) {
290
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
291
0
                return MsgValueError;
292
0
            }
293
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aFd)))))) {
294
0
                FatalError("Error deserializing 'FileDescriptor'");
295
0
                return MsgValueError;
296
0
            }
297
0
            // Sentinel = 'aFd'
298
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2730041928)))) {
299
0
                mozilla::ipc::SentinelReadError("Error deserializing 'FileDescriptor'");
300
0
                return MsgValueError;
301
0
            }
302
0
            (msg__).EndRead(iter__, (msg__).type());
303
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
304
0
                FatalError("Transition error");
305
0
                return MsgValueError;
306
0
            }
307
0
            if ((!(RecvPrintInitializationResult(aRv, aFd)))) {
308
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
309
0
                // Error handled in mozilla::ipc::IPCResult
310
0
                return MsgProcessingError;
311
0
            }
312
0
313
0
            return MsgProcessed;
314
0
        }
315
0
    case PRemotePrintJob::Msg_PageProcessed__ID:
316
0
        {
317
0
            if (mozilla::ipc::LoggingEnabledFor("PRemotePrintJobChild")) {
318
0
                mozilla::ipc::LogMessageForProtocol("PRemotePrintJobChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
319
0
            }
320
0
            AUTO_PROFILER_LABEL("PRemotePrintJob::Msg_PageProcessed", OTHER);
321
0
322
0
            PickleIterator iter__(msg__);
323
0
            FileDescriptor aFd;
324
0
325
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aFd)))))) {
326
0
                FatalError("Error deserializing 'FileDescriptor'");
327
0
                return MsgValueError;
328
0
            }
329
0
            // Sentinel = 'aFd'
330
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2730041928)))) {
331
0
                mozilla::ipc::SentinelReadError("Error deserializing 'FileDescriptor'");
332
0
                return MsgValueError;
333
0
            }
334
0
            (msg__).EndRead(iter__, (msg__).type());
335
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
336
0
                FatalError("Transition error");
337
0
                return MsgValueError;
338
0
            }
339
0
            if ((!(RecvPageProcessed(aFd)))) {
340
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
341
0
                // Error handled in mozilla::ipc::IPCResult
342
0
                return MsgProcessingError;
343
0
            }
344
0
345
0
            return MsgProcessed;
346
0
        }
347
0
    case PRemotePrintJob::Msg___delete____ID:
348
0
        {
349
0
            if (mozilla::ipc::LoggingEnabledFor("PRemotePrintJobChild")) {
350
0
                mozilla::ipc::LogMessageForProtocol("PRemotePrintJobChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
351
0
            }
352
0
            AUTO_PROFILER_LABEL("PRemotePrintJob::Msg___delete__", OTHER);
353
0
354
0
            PickleIterator iter__(msg__);
355
0
            PRemotePrintJobChild* actor;
356
0
357
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) {
358
0
                FatalError("Error deserializing 'PRemotePrintJobChild'");
359
0
                return MsgValueError;
360
0
            }
361
0
            if ((!((*((&(actor))))))) {
362
0
                FatalError("Error deserializing 'PRemotePrintJobChild'");
363
0
                return MsgValueError;
364
0
            }
365
0
            // Sentinel = 'actor'
366
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
367
0
                mozilla::ipc::SentinelReadError("Error deserializing 'PRemotePrintJobChild'");
368
0
                return MsgValueError;
369
0
            }
370
0
            (msg__).EndRead(iter__, (msg__).type());
371
0
            if ((!(StateTransition(true, (&(mLivenessState)))))) {
372
0
                FatalError("Transition error");
373
0
                return MsgValueError;
374
0
            }
375
0
            if ((!(Recv__delete__()))) {
376
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
377
0
                // Error handled in mozilla::ipc::IPCResult
378
0
                return MsgProcessingError;
379
0
            }
380
0
381
0
382
0
            IProtocol* mgr = (actor)->Manager();
383
0
            (actor)->DestroySubtree(Deletion);
384
0
            (actor)->DeallocSubtree();
385
0
            (mgr)->RemoveManagee(PRemotePrintJobMsgStart, actor);
386
0
387
0
            return MsgProcessed;
388
0
        }
389
0
    default:
390
0
        {
391
0
            return MsgNotKnown;
392
0
        }
393
0
    }
394
0
}
395
396
auto PRemotePrintJobChild::OnMessageReceived(
397
        const Message& msg__,
398
        Message*& reply__) -> PRemotePrintJobChild::Result
399
0
{
400
0
    return MsgNotKnown;
401
0
}
402
403
auto PRemotePrintJobChild::OnCallReceived(
404
        const Message& msg__,
405
        Message*& reply__) -> PRemotePrintJobChild::Result
406
0
{
407
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
408
0
    return MsgNotKnown;
409
0
}
410
411
auto PRemotePrintJobChild::GetProtocolTypeId() -> int32_t
412
0
{
413
0
    return PRemotePrintJobMsgStart;
414
0
}
415
416
auto PRemotePrintJobChild::DestroySubtree(ActorDestroyReason why) -> void
417
0
{
418
0
    // Unregister from our manager.
419
0
    Unregister(Id());
420
0
421
0
    // Reject owning pending responses.
422
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
423
0
424
0
    // Finally, destroy "us".
425
0
    ActorDestroy(why);
426
0
}
427
428
auto PRemotePrintJobChild::DeallocSubtree() -> void
429
0
{
430
0
}
431
432
433
434
} // namespace layout
435
} // namespace mozilla
436
namespace mozilla {
437
namespace ipc {
438
auto IPDLParamTraits<mozilla::layout::PRemotePrintJobChild>::Write(
439
        IPC::Message* aMsg,
440
        mozilla::ipc::IProtocol* aActor,
441
        const paramType& aVar) -> void
442
0
{
443
0
    int32_t id;
444
0
    if ((!(aVar))) {
445
0
        id = 0;
446
0
    }
447
0
    else {
448
0
        id = (aVar)->Id();
449
0
        if ((1) == (id)) {
450
0
            (aActor)->FatalError("actor has been |delete|d");
451
0
        }
452
0
    }
453
0
    WriteIPDLParam(aMsg, aActor, id);
454
0
}
455
456
auto IPDLParamTraits<mozilla::layout::PRemotePrintJobChild>::Read(
457
        const IPC::Message* aMsg,
458
        PickleIterator* aIter,
459
        mozilla::ipc::IProtocol* aActor,
460
        paramType* aVar) -> bool
461
0
{
462
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PRemotePrintJob", PRemotePrintJobMsgStart);
463
0
    if ((actor).isNothing()) {
464
0
        return false;
465
0
    }
466
0
467
0
    (*(aVar)) = static_cast<mozilla::layout::PRemotePrintJobChild*>((actor).value());
468
0
    return true;
469
0
}
470
471
} // namespace ipc
472
} // namespace mozilla