Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PPrintingChild.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/PPrintingChild.h"
8
9
#include "mozilla/dom/PContentChild.h"
10
#include "mozilla/dom/PBrowserChild.h"
11
#include "mozilla/embedding/PPrintProgressDialogChild.h"
12
#include "mozilla/embedding/PPrintSettingsDialogChild.h"
13
#include "mozilla/layout/PRemotePrintJobChild.h"
14
15
#include "nsIFile.h"
16
#include "GeckoProfiler.h"
17
18
namespace mozilla {
19
namespace embedding {
20
21
22
auto PPrintingChild::RecvPRemotePrintJobConstructor(PRemotePrintJobChild* actor) -> mozilla::ipc::IPCResult
23
0
{
24
0
    return IPC_OK();
25
0
}
26
27
auto PPrintingChild::Recv__delete__() -> mozilla::ipc::IPCResult
28
0
{
29
0
    return IPC_OK();
30
0
}
31
32
auto PPrintingChild::ActorDestroy(ActorDestroyReason aWhy) -> void
33
0
{
34
0
}
35
36
MOZ_IMPLICIT PPrintingChild::PPrintingChild() :
37
    mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
38
    mLivenessState(mozilla::ipc::LivenessState::Dead)
39
0
{
40
0
    MOZ_COUNT_CTOR(PPrintingChild);
41
0
}
42
43
PPrintingChild::~PPrintingChild()
44
0
{
45
0
    MOZ_COUNT_DTOR(PPrintingChild);
46
0
}
47
48
auto PPrintingChild::Manager() const -> PContentChild*
49
0
{
50
0
    return static_cast<PContentChild*>(IProtocol::Manager());
51
0
}
52
53
auto PPrintingChild::ManagedPPrintProgressDialogChild(nsTArray<PPrintProgressDialogChild*>& aArr) const -> void
54
0
{
55
0
    (mManagedPPrintProgressDialogChild).ToArray(aArr);
56
0
}
57
58
auto PPrintingChild::ManagedPPrintProgressDialogChild() const -> const ManagedContainer<PPrintProgressDialogChild>&
59
0
{
60
0
    return mManagedPPrintProgressDialogChild;
61
0
}
62
63
auto PPrintingChild::ManagedPPrintSettingsDialogChild(nsTArray<PPrintSettingsDialogChild*>& aArr) const -> void
64
0
{
65
0
    (mManagedPPrintSettingsDialogChild).ToArray(aArr);
66
0
}
67
68
auto PPrintingChild::ManagedPPrintSettingsDialogChild() const -> const ManagedContainer<PPrintSettingsDialogChild>&
69
0
{
70
0
    return mManagedPPrintSettingsDialogChild;
71
0
}
72
73
auto PPrintingChild::ManagedPRemotePrintJobChild(nsTArray<PRemotePrintJobChild*>& aArr) const -> void
74
0
{
75
0
    (mManagedPRemotePrintJobChild).ToArray(aArr);
76
0
}
77
78
auto PPrintingChild::ManagedPRemotePrintJobChild() const -> const ManagedContainer<PRemotePrintJobChild>&
79
0
{
80
0
    return mManagedPRemotePrintJobChild;
81
0
}
82
83
auto PPrintingChild::SendShowProgress(
84
        PBrowserChild* browser,
85
        PPrintProgressDialogChild* printProgressDialog,
86
        PRemotePrintJobChild* remotePrintJob,
87
        const bool& isForPrinting) -> bool
88
0
{
89
0
    IPC::Message* msg__ = PPrinting::Msg_ShowProgress(Id());
90
0
91
0
    MOZ_RELEASE_ASSERT(browser, "NULL actor value passed to non-nullable param");
92
0
    WriteIPDLParam(msg__, this, browser);
93
0
    // Sentinel = 'browser'
94
0
    (msg__)->WriteSentinel(2836343679);
95
0
    MOZ_RELEASE_ASSERT(printProgressDialog, "NULL actor value passed to non-nullable param");
96
0
    WriteIPDLParam(msg__, this, printProgressDialog);
97
0
    // Sentinel = 'printProgressDialog'
98
0
    (msg__)->WriteSentinel(1704049755);
99
0
    WriteIPDLParam(msg__, this, remotePrintJob);
100
0
    // Sentinel = 'remotePrintJob'
101
0
    (msg__)->WriteSentinel(2408336150);
102
0
    WriteIPDLParam(msg__, this, isForPrinting);
103
0
    // Sentinel = 'isForPrinting'
104
0
    (msg__)->WriteSentinel(2165625195);
105
0
106
0
107
0
108
0
109
0
    if (mozilla::ipc::LoggingEnabledFor("PPrintingChild")) {
110
0
        mozilla::ipc::LogMessageForProtocol("PPrintingChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
111
0
    }
112
0
    AUTO_PROFILER_LABEL("PPrinting::Msg_ShowProgress", OTHER);
113
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
114
0
        mozilla::ipc::LogicError("Transition error");
115
0
    }
116
0
117
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
118
0
    return sendok__;
119
0
}
120
121
auto PPrintingChild::SendShowPrintDialog(
122
        PPrintSettingsDialogChild* dialog,
123
        PBrowserChild* browser,
124
        const PrintData& settings) -> bool
125
0
{
126
0
    IPC::Message* msg__ = PPrinting::Msg_ShowPrintDialog(Id());
127
0
128
0
    MOZ_RELEASE_ASSERT(dialog, "NULL actor value passed to non-nullable param");
129
0
    WriteIPDLParam(msg__, this, dialog);
130
0
    // Sentinel = 'dialog'
131
0
    (msg__)->WriteSentinel(4200953590);
132
0
    WriteIPDLParam(msg__, this, browser);
133
0
    // Sentinel = 'browser'
134
0
    (msg__)->WriteSentinel(2836343679);
135
0
    WriteIPDLParam(msg__, this, settings);
136
0
    // Sentinel = 'settings'
137
0
    (msg__)->WriteSentinel(2402913383);
138
0
139
0
140
0
141
0
142
0
    if (mozilla::ipc::LoggingEnabledFor("PPrintingChild")) {
143
0
        mozilla::ipc::LogMessageForProtocol("PPrintingChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
144
0
    }
145
0
    AUTO_PROFILER_LABEL("PPrinting::Msg_ShowPrintDialog", OTHER);
146
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
147
0
        mozilla::ipc::LogicError("Transition error");
148
0
    }
149
0
150
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
151
0
    return sendok__;
152
0
}
153
154
auto PPrintingChild::SendPPrintProgressDialogConstructor() -> PPrintProgressDialogChild*
155
0
{
156
0
    return SendPPrintProgressDialogConstructor(AllocPPrintProgressDialogChild());
157
0
}
158
159
auto PPrintingChild::SendPPrintProgressDialogConstructor(PPrintProgressDialogChild* actor) -> PPrintProgressDialogChild*
160
0
{
161
0
    if ((!(actor))) {
162
0
        NS_WARNING("Error constructing actor PPrintProgressDialogChild");
163
0
        return nullptr;
164
0
    }
165
0
    (actor)->SetManagerAndRegister(this);
166
0
    (mManagedPPrintProgressDialogChild).PutEntry(actor);
167
0
    (actor)->mLivenessState = mozilla::ipc::LivenessState::Start;
168
0
169
0
    IPC::Message* msg__ = PPrinting::Msg_PPrintProgressDialogConstructor(Id());
170
0
171
0
    MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param");
172
0
    WriteIPDLParam(msg__, this, actor);
173
0
    // Sentinel = 'actor'
174
0
    (msg__)->WriteSentinel(875202478);
175
0
176
0
177
0
178
0
    if (mozilla::ipc::LoggingEnabledFor("PPrintingChild")) {
179
0
        mozilla::ipc::LogMessageForProtocol("PPrintingChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
180
0
    }
181
0
    AUTO_PROFILER_LABEL("PPrinting::Msg_PPrintProgressDialogConstructor", OTHER);
182
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
183
0
        mozilla::ipc::LogicError("Transition error");
184
0
    }
185
0
186
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
187
0
    if ((!(sendok__))) {
188
0
        FatalError("constructor for actor failed");
189
0
        return nullptr;
190
0
    }
191
0
    return actor;
192
0
}
193
194
auto PPrintingChild::SendPPrintSettingsDialogConstructor() -> PPrintSettingsDialogChild*
195
0
{
196
0
    return SendPPrintSettingsDialogConstructor(AllocPPrintSettingsDialogChild());
197
0
}
198
199
auto PPrintingChild::SendPPrintSettingsDialogConstructor(PPrintSettingsDialogChild* actor) -> PPrintSettingsDialogChild*
200
0
{
201
0
    if ((!(actor))) {
202
0
        NS_WARNING("Error constructing actor PPrintSettingsDialogChild");
203
0
        return nullptr;
204
0
    }
205
0
    (actor)->SetManagerAndRegister(this);
206
0
    (mManagedPPrintSettingsDialogChild).PutEntry(actor);
207
0
    (actor)->mLivenessState = mozilla::ipc::LivenessState::Start;
208
0
209
0
    IPC::Message* msg__ = PPrinting::Msg_PPrintSettingsDialogConstructor(Id());
210
0
211
0
    MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param");
212
0
    WriteIPDLParam(msg__, this, actor);
213
0
    // Sentinel = 'actor'
214
0
    (msg__)->WriteSentinel(875202478);
215
0
216
0
217
0
218
0
    if (mozilla::ipc::LoggingEnabledFor("PPrintingChild")) {
219
0
        mozilla::ipc::LogMessageForProtocol("PPrintingChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
220
0
    }
221
0
    AUTO_PROFILER_LABEL("PPrinting::Msg_PPrintSettingsDialogConstructor", 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
    if ((!(sendok__))) {
228
0
        FatalError("constructor for actor failed");
229
0
        return nullptr;
230
0
    }
231
0
    return actor;
232
0
}
233
234
auto PPrintingChild::SendSavePrintSettings(
235
        const PrintData& settings,
236
        const bool& usePrinterNamePrefix,
237
        const uint32_t& flags,
238
        nsresult* rv) -> bool
239
0
{
240
0
    IPC::Message* msg__ = PPrinting::Msg_SavePrintSettings(Id());
241
0
242
0
    WriteIPDLParam(msg__, this, settings);
243
0
    // Sentinel = 'settings'
244
0
    (msg__)->WriteSentinel(2402913383);
245
0
    WriteIPDLParam(msg__, this, usePrinterNamePrefix);
246
0
    // Sentinel = 'usePrinterNamePrefix'
247
0
    (msg__)->WriteSentinel(1614756826);
248
0
    WriteIPDLParam(msg__, this, flags);
249
0
    // Sentinel = 'flags'
250
0
    (msg__)->WriteSentinel(2550519284);
251
0
252
0
253
0
254
0
    Message reply__;
255
0
256
0
    if (mozilla::ipc::LoggingEnabledFor("PPrintingChild")) {
257
0
        mozilla::ipc::LogMessageForProtocol("PPrintingChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
258
0
    }
259
0
    AUTO_PROFILER_LABEL("PPrinting::Msg_SavePrintSettings", OTHER);
260
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
261
0
        mozilla::ipc::LogicError("Transition error");
262
0
    }
263
0
264
0
    bool sendok__;
265
0
    {
266
0
        AUTO_PROFILER_TRACING("IPC", "PPrinting::Msg_SavePrintSettings");
267
0
        sendok__ = (GetIPCChannel())->Send(msg__, (&(reply__)));
268
0
    }
269
0
    if ((!(sendok__))) {
270
0
        return false;
271
0
    }
272
0
273
0
    if (mozilla::ipc::LoggingEnabledFor("PPrintingChild")) {
274
0
        mozilla::ipc::LogMessageForProtocol("PPrintingChild", OtherPid(), "Received reply ", ((&(reply__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
275
0
    }
276
0
277
0
    PickleIterator iter__(reply__);
278
0
279
0
    if ((!(ReadIPDLParam((&(reply__)), (&(iter__)), this, rv)))) {
280
0
        FatalError("Error deserializing 'nsresult'");
281
0
        return false;
282
0
    }
283
0
    // Sentinel = 'rv'
284
0
    if ((!(((&(reply__)))->ReadSentinel((&(iter__)), 702481058)))) {
285
0
        mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
286
0
        return false;
287
0
    }
288
0
    (reply__).EndRead(iter__, (reply__).type());
289
0
290
0
    return true;
291
0
}
292
293
auto PPrintingChild::RemoveManagee(
294
        int32_t aProtocolId,
295
        IProtocol* aListener) -> void
296
0
{
297
0
    switch (aProtocolId) {
298
0
    case PPrintProgressDialogMsgStart:
299
0
        {
300
0
            PPrintProgressDialogChild* actor = static_cast<PPrintProgressDialogChild*>(aListener);
301
0
            auto& container = mManagedPPrintProgressDialogChild;
302
0
            MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!");
303
0
304
0
            (container).RemoveEntry(actor);
305
0
            DeallocPPrintProgressDialogChild(actor);
306
0
            return;
307
0
        }
308
0
    case PPrintSettingsDialogMsgStart:
309
0
        {
310
0
            PPrintSettingsDialogChild* actor = static_cast<PPrintSettingsDialogChild*>(aListener);
311
0
            auto& container = mManagedPPrintSettingsDialogChild;
312
0
            MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!");
313
0
314
0
            (container).RemoveEntry(actor);
315
0
            DeallocPPrintSettingsDialogChild(actor);
316
0
            return;
317
0
        }
318
0
    case PRemotePrintJobMsgStart:
319
0
        {
320
0
            PRemotePrintJobChild* actor = static_cast<PRemotePrintJobChild*>(aListener);
321
0
            auto& container = mManagedPRemotePrintJobChild;
322
0
            MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!");
323
0
324
0
            (container).RemoveEntry(actor);
325
0
            DeallocPRemotePrintJobChild(actor);
326
0
            return;
327
0
        }
328
0
    default:
329
0
        {
330
0
            FatalError("unreached");
331
0
            return;
332
0
        }
333
0
    }
334
0
}
335
336
auto PPrintingChild::OnMessageReceived(const Message& msg__) -> PPrintingChild::Result
337
0
{
338
0
    switch ((msg__).type()) {
339
0
    case PPrinting::Reply_PPrintProgressDialogConstructor__ID:
340
0
        {
341
0
            return MsgProcessed;
342
0
        }
343
0
    case PPrinting::Reply_PPrintSettingsDialogConstructor__ID:
344
0
        {
345
0
            return MsgProcessed;
346
0
        }
347
0
    case PPrinting::Msg_PRemotePrintJobConstructor__ID:
348
0
        {
349
0
            if (mozilla::ipc::LoggingEnabledFor("PPrintingChild")) {
350
0
                mozilla::ipc::LogMessageForProtocol("PPrintingChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
351
0
            }
352
0
            AUTO_PROFILER_LABEL("PPrinting::Msg_PRemotePrintJobConstructor", OTHER);
353
0
354
0
            PickleIterator iter__(msg__);
355
0
            ActorHandle handle__;
356
0
            PRemotePrintJobChild* actor;
357
0
358
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(handle__)))))) {
359
0
                FatalError("Error deserializing 'ActorHandle'");
360
0
                return MsgValueError;
361
0
            }
362
0
            // Sentinel = 'actor'
363
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
364
0
                mozilla::ipc::SentinelReadError("Error deserializing 'ActorHandle'");
365
0
                return MsgValueError;
366
0
            }
367
0
            (msg__).EndRead(iter__, (msg__).type());
368
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
369
0
                FatalError("Transition error");
370
0
                return MsgValueError;
371
0
            }
372
0
            actor = AllocPRemotePrintJobChild();
373
0
            if ((!(actor))) {
374
0
                NS_WARNING("Error constructing actor PRemotePrintJobChild");
375
0
                return MsgValueError;
376
0
            }
377
0
            (actor)->SetManagerAndRegister(this, (handle__).mId);
378
0
            (mManagedPRemotePrintJobChild).PutEntry(actor);
379
0
            (actor)->mLivenessState = mozilla::ipc::LivenessState::Start;
380
0
381
0
            if ((!(RecvPRemotePrintJobConstructor(actor)))) {
382
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
383
0
                // Error handled in mozilla::ipc::IPCResult
384
0
                return MsgProcessingError;
385
0
            }
386
0
387
0
            return MsgProcessed;
388
0
        }
389
0
    case PPrinting::Msg___delete____ID:
390
0
        {
391
0
            if (mozilla::ipc::LoggingEnabledFor("PPrintingChild")) {
392
0
                mozilla::ipc::LogMessageForProtocol("PPrintingChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
393
0
            }
394
0
            AUTO_PROFILER_LABEL("PPrinting::Msg___delete__", OTHER);
395
0
396
0
            PickleIterator iter__(msg__);
397
0
            PPrintingChild* actor;
398
0
399
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) {
400
0
                FatalError("Error deserializing 'PPrintingChild'");
401
0
                return MsgValueError;
402
0
            }
403
0
            if ((!((*((&(actor))))))) {
404
0
                FatalError("Error deserializing 'PPrintingChild'");
405
0
                return MsgValueError;
406
0
            }
407
0
            // Sentinel = 'actor'
408
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
409
0
                mozilla::ipc::SentinelReadError("Error deserializing 'PPrintingChild'");
410
0
                return MsgValueError;
411
0
            }
412
0
            (msg__).EndRead(iter__, (msg__).type());
413
0
            if ((!(StateTransition(true, (&(mLivenessState)))))) {
414
0
                FatalError("Transition error");
415
0
                return MsgValueError;
416
0
            }
417
0
            if ((!(Recv__delete__()))) {
418
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
419
0
                // Error handled in mozilla::ipc::IPCResult
420
0
                return MsgProcessingError;
421
0
            }
422
0
423
0
424
0
            IProtocol* mgr = (actor)->Manager();
425
0
            (actor)->DestroySubtree(Deletion);
426
0
            (actor)->DeallocSubtree();
427
0
            (mgr)->RemoveManagee(PPrintingMsgStart, actor);
428
0
429
0
            return MsgProcessed;
430
0
        }
431
0
    default:
432
0
        {
433
0
            return MsgNotKnown;
434
0
        }
435
0
    }
436
0
}
437
438
auto PPrintingChild::OnMessageReceived(
439
        const Message& msg__,
440
        Message*& reply__) -> PPrintingChild::Result
441
0
{
442
0
    return MsgNotKnown;
443
0
}
444
445
auto PPrintingChild::OnCallReceived(
446
        const Message& msg__,
447
        Message*& reply__) -> PPrintingChild::Result
448
0
{
449
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
450
0
    return MsgNotKnown;
451
0
}
452
453
auto PPrintingChild::GetProtocolTypeId() -> int32_t
454
0
{
455
0
    return PPrintingMsgStart;
456
0
}
457
458
auto PPrintingChild::DestroySubtree(ActorDestroyReason why) -> void
459
0
{
460
0
    // Unregister from our manager.
461
0
    Unregister(Id());
462
0
463
0
    ActorDestroyReason subtreewhy = (((why) == (Deletion)) || ((why) == (FailedConstructor)) ? AncestorDeletion : why);
464
0
465
0
    {
466
0
        // Recursively shutting down PPrintProgressDialog kids
467
0
        nsTArray<PPrintProgressDialogChild*> kids;
468
0
        // Accumulate kids into a stable structure to iterate over
469
0
        ManagedPPrintProgressDialogChild(kids);
470
0
        for (auto& kid : kids) {
471
0
            // Guarding against a child removing a sibling from the list during the iteration.
472
0
            if ((mManagedPPrintProgressDialogChild).Contains(kid)) {
473
0
                (kid)->DestroySubtree(subtreewhy);
474
0
            }
475
0
        }
476
0
    }
477
0
    {
478
0
        // Recursively shutting down PPrintSettingsDialog kids
479
0
        nsTArray<PPrintSettingsDialogChild*> kids;
480
0
        // Accumulate kids into a stable structure to iterate over
481
0
        ManagedPPrintSettingsDialogChild(kids);
482
0
        for (auto& kid : kids) {
483
0
            // Guarding against a child removing a sibling from the list during the iteration.
484
0
            if ((mManagedPPrintSettingsDialogChild).Contains(kid)) {
485
0
                (kid)->DestroySubtree(subtreewhy);
486
0
            }
487
0
        }
488
0
    }
489
0
    {
490
0
        // Recursively shutting down PRemotePrintJob kids
491
0
        nsTArray<PRemotePrintJobChild*> kids;
492
0
        // Accumulate kids into a stable structure to iterate over
493
0
        ManagedPRemotePrintJobChild(kids);
494
0
        for (auto& kid : kids) {
495
0
            // Guarding against a child removing a sibling from the list during the iteration.
496
0
            if ((mManagedPRemotePrintJobChild).Contains(kid)) {
497
0
                (kid)->DestroySubtree(subtreewhy);
498
0
            }
499
0
        }
500
0
    }
501
0
502
0
    // Reject owning pending responses.
503
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
504
0
505
0
    // Finally, destroy "us".
506
0
    ActorDestroy(why);
507
0
}
508
509
auto PPrintingChild::DeallocSubtree() -> void
510
0
{
511
0
    {
512
0
        // Recursively deleting PPrintProgressDialog kids
513
0
        for (auto iter = (mManagedPPrintProgressDialogChild).Iter(); (!((iter).Done())); (iter).Next()) {
514
0
            (((iter).Get())->GetKey())->DeallocSubtree();
515
0
        }
516
0
517
0
        for (auto iter = (mManagedPPrintProgressDialogChild).Iter(); (!((iter).Done())); (iter).Next()) {
518
0
            DeallocPPrintProgressDialogChild(((iter).Get())->GetKey());
519
0
        }
520
0
        (mManagedPPrintProgressDialogChild).Clear();
521
0
    }
522
0
    {
523
0
        // Recursively deleting PPrintSettingsDialog kids
524
0
        for (auto iter = (mManagedPPrintSettingsDialogChild).Iter(); (!((iter).Done())); (iter).Next()) {
525
0
            (((iter).Get())->GetKey())->DeallocSubtree();
526
0
        }
527
0
528
0
        for (auto iter = (mManagedPPrintSettingsDialogChild).Iter(); (!((iter).Done())); (iter).Next()) {
529
0
            DeallocPPrintSettingsDialogChild(((iter).Get())->GetKey());
530
0
        }
531
0
        (mManagedPPrintSettingsDialogChild).Clear();
532
0
    }
533
0
    {
534
0
        // Recursively deleting PRemotePrintJob kids
535
0
        for (auto iter = (mManagedPRemotePrintJobChild).Iter(); (!((iter).Done())); (iter).Next()) {
536
0
            (((iter).Get())->GetKey())->DeallocSubtree();
537
0
        }
538
0
539
0
        for (auto iter = (mManagedPRemotePrintJobChild).Iter(); (!((iter).Done())); (iter).Next()) {
540
0
            DeallocPRemotePrintJobChild(((iter).Get())->GetKey());
541
0
        }
542
0
        (mManagedPRemotePrintJobChild).Clear();
543
0
    }
544
0
}
545
546
547
548
} // namespace embedding
549
} // namespace mozilla
550
namespace mozilla {
551
namespace ipc {
552
auto IPDLParamTraits<mozilla::embedding::PPrintingChild>::Write(
553
        IPC::Message* aMsg,
554
        mozilla::ipc::IProtocol* aActor,
555
        const paramType& aVar) -> void
556
0
{
557
0
    int32_t id;
558
0
    if ((!(aVar))) {
559
0
        id = 0;
560
0
    }
561
0
    else {
562
0
        id = (aVar)->Id();
563
0
        if ((1) == (id)) {
564
0
            (aActor)->FatalError("actor has been |delete|d");
565
0
        }
566
0
    }
567
0
    WriteIPDLParam(aMsg, aActor, id);
568
0
}
569
570
auto IPDLParamTraits<mozilla::embedding::PPrintingChild>::Read(
571
        const IPC::Message* aMsg,
572
        PickleIterator* aIter,
573
        mozilla::ipc::IProtocol* aActor,
574
        paramType* aVar) -> bool
575
0
{
576
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PPrinting", PPrintingMsgStart);
577
0
    if ((actor).isNothing()) {
578
0
        return false;
579
0
    }
580
0
581
0
    (*(aVar)) = static_cast<mozilla::embedding::PPrintingChild*>((actor).value());
582
0
    return true;
583
0
}
584
585
} // namespace ipc
586
} // namespace mozilla