Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PPrintProgressDialogParent.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/embedding/PPrintProgressDialogParent.h"
8
9
#include "mozilla/embedding/PPrintingParent.h"
10
11
#include "nsIFile.h"
12
#include "GeckoProfiler.h"
13
14
namespace mozilla {
15
namespace embedding {
16
17
18
auto PPrintProgressDialogParent::Recv__delete__() -> mozilla::ipc::IPCResult
19
0
{
20
0
    return IPC_OK();
21
0
}
22
23
auto PPrintProgressDialogParent::ActorDestroy(ActorDestroyReason aWhy) -> void
24
0
{
25
0
}
26
27
MOZ_IMPLICIT PPrintProgressDialogParent::PPrintProgressDialogParent() :
28
    mozilla::ipc::IProtocol(mozilla::ipc::ParentSide),
29
    mLivenessState(mozilla::ipc::LivenessState::Dead)
30
0
{
31
0
    MOZ_COUNT_CTOR(PPrintProgressDialogParent);
32
0
}
33
34
PPrintProgressDialogParent::~PPrintProgressDialogParent()
35
0
{
36
0
    MOZ_COUNT_DTOR(PPrintProgressDialogParent);
37
0
}
38
39
auto PPrintProgressDialogParent::Manager() const -> PPrintingParent*
40
0
{
41
0
    return static_cast<PPrintingParent*>(IProtocol::Manager());
42
0
}
43
44
auto PPrintProgressDialogParent::SendDialogOpened() -> bool
45
0
{
46
0
    IPC::Message* msg__ = PPrintProgressDialog::Msg_DialogOpened(Id());
47
0
48
0
49
0
50
0
51
0
52
0
    if (mozilla::ipc::LoggingEnabledFor("PPrintProgressDialogParent")) {
53
0
        mozilla::ipc::LogMessageForProtocol("PPrintProgressDialogParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
54
0
    }
55
0
    AUTO_PROFILER_LABEL("PPrintProgressDialog::Msg_DialogOpened", OTHER);
56
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
57
0
        mozilla::ipc::LogicError("Transition error");
58
0
    }
59
0
60
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
61
0
    return sendok__;
62
0
}
63
64
auto PPrintProgressDialogParent::SendCancelledCurrentJob() -> bool
65
0
{
66
0
    IPC::Message* msg__ = PPrintProgressDialog::Msg_CancelledCurrentJob(Id());
67
0
68
0
69
0
70
0
71
0
72
0
    if (mozilla::ipc::LoggingEnabledFor("PPrintProgressDialogParent")) {
73
0
        mozilla::ipc::LogMessageForProtocol("PPrintProgressDialogParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
74
0
    }
75
0
    AUTO_PROFILER_LABEL("PPrintProgressDialog::Msg_CancelledCurrentJob", 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 PPrintProgressDialogParent::RemoveManagee(
85
        int32_t aProtocolId,
86
        IProtocol* aListener) -> void
87
0
{
88
0
    FatalError("unreached");
89
0
    return;
90
0
}
91
92
auto PPrintProgressDialogParent::OnMessageReceived(const Message& msg__) -> PPrintProgressDialogParent::Result
93
0
{
94
0
    switch ((msg__).type()) {
95
0
    case PPrintProgressDialog::Msg_StateChange__ID:
96
0
        {
97
0
            if (mozilla::ipc::LoggingEnabledFor("PPrintProgressDialogParent")) {
98
0
                mozilla::ipc::LogMessageForProtocol("PPrintProgressDialogParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
99
0
            }
100
0
            AUTO_PROFILER_LABEL("PPrintProgressDialog::Msg_StateChange", OTHER);
101
0
102
0
            PickleIterator iter__(msg__);
103
0
            long stateFlags;
104
0
            nsresult status;
105
0
106
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(stateFlags)))))) {
107
0
                FatalError("Error deserializing 'long'");
108
0
                return MsgValueError;
109
0
            }
110
0
            // Sentinel = 'stateFlags'
111
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2666547646)))) {
112
0
                mozilla::ipc::SentinelReadError("Error deserializing 'long'");
113
0
                return MsgValueError;
114
0
            }
115
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(status)))))) {
116
0
                FatalError("Error deserializing 'nsresult'");
117
0
                return MsgValueError;
118
0
            }
119
0
            // Sentinel = 'status'
120
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3714608576)))) {
121
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
122
0
                return MsgValueError;
123
0
            }
124
0
            (msg__).EndRead(iter__, (msg__).type());
125
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
126
0
                FatalError("Transition error");
127
0
                return MsgValueError;
128
0
            }
129
0
            if ((!(RecvStateChange(stateFlags, status)))) {
130
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
131
0
                // Error handled in mozilla::ipc::IPCResult
132
0
                return MsgProcessingError;
133
0
            }
134
0
135
0
            return MsgProcessed;
136
0
        }
137
0
    case PPrintProgressDialog::Msg_ProgressChange__ID:
138
0
        {
139
0
            if (mozilla::ipc::LoggingEnabledFor("PPrintProgressDialogParent")) {
140
0
                mozilla::ipc::LogMessageForProtocol("PPrintProgressDialogParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
141
0
            }
142
0
            AUTO_PROFILER_LABEL("PPrintProgressDialog::Msg_ProgressChange", OTHER);
143
0
144
0
            PickleIterator iter__(msg__);
145
0
            long curSelfProgress;
146
0
            long maxSelfProgress;
147
0
            long curTotalProgress;
148
0
            long maxTotalProgress;
149
0
150
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(curSelfProgress)))))) {
151
0
                FatalError("Error deserializing 'long'");
152
0
                return MsgValueError;
153
0
            }
154
0
            // Sentinel = 'curSelfProgress'
155
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4225363786)))) {
156
0
                mozilla::ipc::SentinelReadError("Error deserializing 'long'");
157
0
                return MsgValueError;
158
0
            }
159
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(maxSelfProgress)))))) {
160
0
                FatalError("Error deserializing 'long'");
161
0
                return MsgValueError;
162
0
            }
163
0
            // Sentinel = 'maxSelfProgress'
164
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3605923158)))) {
165
0
                mozilla::ipc::SentinelReadError("Error deserializing 'long'");
166
0
                return MsgValueError;
167
0
            }
168
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(curTotalProgress)))))) {
169
0
                FatalError("Error deserializing 'long'");
170
0
                return MsgValueError;
171
0
            }
172
0
            // Sentinel = 'curTotalProgress'
173
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3294949245)))) {
174
0
                mozilla::ipc::SentinelReadError("Error deserializing 'long'");
175
0
                return MsgValueError;
176
0
            }
177
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(maxTotalProgress)))))) {
178
0
                FatalError("Error deserializing 'long'");
179
0
                return MsgValueError;
180
0
            }
181
0
            // Sentinel = 'maxTotalProgress'
182
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2454639121)))) {
183
0
                mozilla::ipc::SentinelReadError("Error deserializing 'long'");
184
0
                return MsgValueError;
185
0
            }
186
0
            (msg__).EndRead(iter__, (msg__).type());
187
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
188
0
                FatalError("Transition error");
189
0
                return MsgValueError;
190
0
            }
191
0
            if ((!(RecvProgressChange(curSelfProgress, maxSelfProgress, curTotalProgress, maxTotalProgress)))) {
192
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
193
0
                // Error handled in mozilla::ipc::IPCResult
194
0
                return MsgProcessingError;
195
0
            }
196
0
197
0
            return MsgProcessed;
198
0
        }
199
0
    case PPrintProgressDialog::Msg_DocTitleChange__ID:
200
0
        {
201
0
            if (mozilla::ipc::LoggingEnabledFor("PPrintProgressDialogParent")) {
202
0
                mozilla::ipc::LogMessageForProtocol("PPrintProgressDialogParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
203
0
            }
204
0
            AUTO_PROFILER_LABEL("PPrintProgressDialog::Msg_DocTitleChange", OTHER);
205
0
206
0
            PickleIterator iter__(msg__);
207
0
            nsString newTitle;
208
0
209
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(newTitle)))))) {
210
0
                FatalError("Error deserializing 'nsString'");
211
0
                return MsgValueError;
212
0
            }
213
0
            // Sentinel = 'newTitle'
214
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2867378368)))) {
215
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
216
0
                return MsgValueError;
217
0
            }
218
0
            (msg__).EndRead(iter__, (msg__).type());
219
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
220
0
                FatalError("Transition error");
221
0
                return MsgValueError;
222
0
            }
223
0
            if ((!(RecvDocTitleChange(newTitle)))) {
224
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
225
0
                // Error handled in mozilla::ipc::IPCResult
226
0
                return MsgProcessingError;
227
0
            }
228
0
229
0
            return MsgProcessed;
230
0
        }
231
0
    case PPrintProgressDialog::Msg_DocURLChange__ID:
232
0
        {
233
0
            if (mozilla::ipc::LoggingEnabledFor("PPrintProgressDialogParent")) {
234
0
                mozilla::ipc::LogMessageForProtocol("PPrintProgressDialogParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
235
0
            }
236
0
            AUTO_PROFILER_LABEL("PPrintProgressDialog::Msg_DocURLChange", OTHER);
237
0
238
0
            PickleIterator iter__(msg__);
239
0
            nsString newURL;
240
0
241
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(newURL)))))) {
242
0
                FatalError("Error deserializing 'nsString'");
243
0
                return MsgValueError;
244
0
            }
245
0
            // Sentinel = 'newURL'
246
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1179970083)))) {
247
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
248
0
                return MsgValueError;
249
0
            }
250
0
            (msg__).EndRead(iter__, (msg__).type());
251
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
252
0
                FatalError("Transition error");
253
0
                return MsgValueError;
254
0
            }
255
0
            if ((!(RecvDocURLChange(newURL)))) {
256
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
257
0
                // Error handled in mozilla::ipc::IPCResult
258
0
                return MsgProcessingError;
259
0
            }
260
0
261
0
            return MsgProcessed;
262
0
        }
263
0
    case PPrintProgressDialog::Msg___delete____ID:
264
0
        {
265
0
            if (mozilla::ipc::LoggingEnabledFor("PPrintProgressDialogParent")) {
266
0
                mozilla::ipc::LogMessageForProtocol("PPrintProgressDialogParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
267
0
            }
268
0
            AUTO_PROFILER_LABEL("PPrintProgressDialog::Msg___delete__", OTHER);
269
0
270
0
            PickleIterator iter__(msg__);
271
0
            PPrintProgressDialogParent* actor;
272
0
273
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) {
274
0
                FatalError("Error deserializing 'PPrintProgressDialogParent'");
275
0
                return MsgValueError;
276
0
            }
277
0
            if ((!((*((&(actor))))))) {
278
0
                FatalError("Error deserializing 'PPrintProgressDialogParent'");
279
0
                return MsgValueError;
280
0
            }
281
0
            // Sentinel = 'actor'
282
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
283
0
                mozilla::ipc::SentinelReadError("Error deserializing 'PPrintProgressDialogParent'");
284
0
                return MsgValueError;
285
0
            }
286
0
            (msg__).EndRead(iter__, (msg__).type());
287
0
            if ((!(StateTransition(true, (&(mLivenessState)))))) {
288
0
                FatalError("Transition error");
289
0
                return MsgValueError;
290
0
            }
291
0
            if ((!(Recv__delete__()))) {
292
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
293
0
                // Error handled in mozilla::ipc::IPCResult
294
0
                return MsgProcessingError;
295
0
            }
296
0
297
0
298
0
            IProtocol* mgr = (actor)->Manager();
299
0
            (actor)->DestroySubtree(Deletion);
300
0
            (actor)->DeallocSubtree();
301
0
            (mgr)->RemoveManagee(PPrintProgressDialogMsgStart, actor);
302
0
303
0
            return MsgProcessed;
304
0
        }
305
0
    default:
306
0
        {
307
0
            return MsgNotKnown;
308
0
        }
309
0
    }
310
0
}
311
312
auto PPrintProgressDialogParent::OnMessageReceived(
313
        const Message& msg__,
314
        Message*& reply__) -> PPrintProgressDialogParent::Result
315
0
{
316
0
    return MsgNotKnown;
317
0
}
318
319
auto PPrintProgressDialogParent::OnCallReceived(
320
        const Message& msg__,
321
        Message*& reply__) -> PPrintProgressDialogParent::Result
322
0
{
323
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
324
0
    return MsgNotKnown;
325
0
}
326
327
auto PPrintProgressDialogParent::GetProtocolTypeId() -> int32_t
328
0
{
329
0
    return PPrintProgressDialogMsgStart;
330
0
}
331
332
auto PPrintProgressDialogParent::DestroySubtree(ActorDestroyReason why) -> void
333
0
{
334
0
    // Unregister from our manager.
335
0
    Unregister(Id());
336
0
337
0
    // Reject owning pending responses.
338
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
339
0
340
0
    // Finally, destroy "us".
341
0
    ActorDestroy(why);
342
0
}
343
344
auto PPrintProgressDialogParent::DeallocSubtree() -> void
345
0
{
346
0
}
347
348
349
350
} // namespace embedding
351
} // namespace mozilla
352
namespace mozilla {
353
namespace ipc {
354
auto IPDLParamTraits<mozilla::embedding::PPrintProgressDialogParent>::Write(
355
        IPC::Message* aMsg,
356
        mozilla::ipc::IProtocol* aActor,
357
        const paramType& aVar) -> void
358
0
{
359
0
    int32_t id;
360
0
    if ((!(aVar))) {
361
0
        id = 0;
362
0
    }
363
0
    else {
364
0
        id = (aVar)->Id();
365
0
        if ((1) == (id)) {
366
0
            (aActor)->FatalError("actor has been |delete|d");
367
0
        }
368
0
    }
369
0
    WriteIPDLParam(aMsg, aActor, id);
370
0
}
371
372
auto IPDLParamTraits<mozilla::embedding::PPrintProgressDialogParent>::Read(
373
        const IPC::Message* aMsg,
374
        PickleIterator* aIter,
375
        mozilla::ipc::IProtocol* aActor,
376
        paramType* aVar) -> bool
377
0
{
378
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PPrintProgressDialog", PPrintProgressDialogMsgStart);
379
0
    if ((actor).isNothing()) {
380
0
        return false;
381
0
    }
382
0
383
0
    (*(aVar)) = static_cast<mozilla::embedding::PPrintProgressDialogParent*>((actor).value());
384
0
    return true;
385
0
}
386
387
} // namespace ipc
388
} // namespace mozilla