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