Line data Source code
1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/gmp/PGMPChild.h"
8 : #ifdef MOZ_CRASHREPORTER
9 : # include "nsXULAppAPI.h"
10 : #endif
11 :
12 : #include "mozilla/gmp/PGMPContentChild.h"
13 : #include "mozilla/gmp/PGMPTimerChild.h"
14 : #include "mozilla/gmp/PGMPStorageChild.h"
15 :
16 : #include "nsIFile.h"
17 : #include "GeckoProfiler.h"
18 :
19 : namespace mozilla {
20 : namespace gmp {
21 :
22 :
23 0 : auto PGMPChild::ActorDestroy(ActorDestroyReason aWhy) -> void
24 : {
25 0 : }
26 :
27 0 : auto PGMPChild::ProcessingError(
28 : Result aCode,
29 : const char* aReason) -> void
30 : {
31 0 : }
32 :
33 0 : auto PGMPChild::ShouldContinueFromReplyTimeout() -> bool
34 : {
35 0 : return true;
36 : }
37 :
38 0 : auto PGMPChild::EnteredCxxStack() -> void
39 : {
40 0 : }
41 :
42 0 : auto PGMPChild::ExitedCxxStack() -> void
43 : {
44 0 : }
45 :
46 0 : auto PGMPChild::EnteredCall() -> void
47 : {
48 0 : }
49 :
50 0 : auto PGMPChild::ExitedCall() -> void
51 : {
52 0 : }
53 :
54 0 : MOZ_IMPLICIT PGMPChild::PGMPChild() :
55 : mozilla::ipc::IToplevelProtocol(PGMPMsgStart, mozilla::ipc::ChildSide),
56 : mChannel("PGMPChild", ALLOW_THIS_IN_INITIALIZER_LIST(this)),
57 0 : mState(PGMP::__Start)
58 : {
59 0 : MOZ_COUNT_CTOR(PGMPChild);
60 0 : }
61 :
62 0 : PGMPChild::~PGMPChild()
63 : {
64 0 : MOZ_COUNT_DTOR(PGMPChild);
65 0 : }
66 :
67 0 : auto PGMPChild::ManagedPGMPTimerChild(nsTArray<PGMPTimerChild*>& aArr) const -> void
68 : {
69 0 : (mManagedPGMPTimerChild).ToArray(aArr);
70 0 : }
71 :
72 0 : auto PGMPChild::ManagedPGMPTimerChild() const -> const ManagedContainer<PGMPTimerChild>&
73 : {
74 0 : return mManagedPGMPTimerChild;
75 : }
76 :
77 0 : auto PGMPChild::ManagedPGMPStorageChild(nsTArray<PGMPStorageChild*>& aArr) const -> void
78 : {
79 0 : (mManagedPGMPStorageChild).ToArray(aArr);
80 0 : }
81 :
82 0 : auto PGMPChild::ManagedPGMPStorageChild() const -> const ManagedContainer<PGMPStorageChild>&
83 : {
84 0 : return mManagedPGMPStorageChild;
85 : }
86 :
87 0 : auto PGMPChild::SendInitCrashReporter(
88 : Shmem& shmem,
89 : const NativeThreadId& threadId) -> bool
90 : {
91 0 : IPC::Message* msg__ = PGMP::Msg_InitCrashReporter(MSG_ROUTING_CONTROL);
92 :
93 0 : Write(shmem, msg__);
94 : // Sentinel = 'shmem'
95 0 : (msg__)->WriteSentinel(4252604405);
96 0 : Write(threadId, msg__);
97 : // Sentinel = 'threadId'
98 0 : (msg__)->WriteSentinel(3657055895);
99 :
100 :
101 :
102 :
103 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPChild")) {
104 0 : mozilla::ipc::LogMessageForProtocol("PGMPChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
105 : }
106 0 : AUTO_PROFILER_LABEL("PGMP::Msg_InitCrashReporter", OTHER);
107 0 : PGMP::Transition(PGMP::Msg_InitCrashReporter__ID, (&(mState)));
108 :
109 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
110 0 : return sendok__;
111 : }
112 :
113 0 : auto PGMPChild::SendPGMPTimerConstructor() -> PGMPTimerChild*
114 : {
115 0 : return SendPGMPTimerConstructor(AllocPGMPTimerChild());
116 : }
117 :
118 0 : auto PGMPChild::SendPGMPTimerConstructor(PGMPTimerChild* actor) -> PGMPTimerChild*
119 : {
120 0 : if ((!(actor))) {
121 0 : NS_WARNING("Error constructing actor PGMPTimerChild");
122 0 : return nullptr;
123 : }
124 0 : (actor)->SetManager(this);
125 0 : Register(actor);
126 0 : (actor)->SetIPCChannel(GetIPCChannel());
127 0 : (mManagedPGMPTimerChild).PutEntry(actor);
128 0 : (actor)->mState = mozilla::gmp::PGMPTimer::__Start;
129 :
130 0 : IPC::Message* msg__ = PGMP::Msg_PGMPTimerConstructor(MSG_ROUTING_CONTROL);
131 :
132 0 : Write(actor, msg__, false);
133 : // Sentinel = 'actor'
134 0 : (msg__)->WriteSentinel(875202478);
135 :
136 0 : (msg__)->set_constructor();
137 :
138 :
139 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPChild")) {
140 0 : mozilla::ipc::LogMessageForProtocol("PGMPChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
141 : }
142 0 : AUTO_PROFILER_LABEL("PGMP::Msg_PGMPTimerConstructor", OTHER);
143 0 : PGMP::Transition(PGMP::Msg_PGMPTimerConstructor__ID, (&(mState)));
144 :
145 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
146 0 : if ((!(sendok__))) {
147 0 : FatalError("constructor for actor failed");
148 0 : return nullptr;
149 : }
150 0 : return actor;
151 : }
152 :
153 0 : auto PGMPChild::SendPGMPStorageConstructor() -> PGMPStorageChild*
154 : {
155 0 : return SendPGMPStorageConstructor(AllocPGMPStorageChild());
156 : }
157 :
158 0 : auto PGMPChild::SendPGMPStorageConstructor(PGMPStorageChild* actor) -> PGMPStorageChild*
159 : {
160 0 : if ((!(actor))) {
161 0 : NS_WARNING("Error constructing actor PGMPStorageChild");
162 0 : return nullptr;
163 : }
164 0 : (actor)->SetManager(this);
165 0 : Register(actor);
166 0 : (actor)->SetIPCChannel(GetIPCChannel());
167 0 : (mManagedPGMPStorageChild).PutEntry(actor);
168 0 : (actor)->mState = mozilla::gmp::PGMPStorage::__Start;
169 :
170 0 : IPC::Message* msg__ = PGMP::Msg_PGMPStorageConstructor(MSG_ROUTING_CONTROL);
171 :
172 0 : Write(actor, msg__, false);
173 : // Sentinel = 'actor'
174 0 : (msg__)->WriteSentinel(875202478);
175 :
176 0 : (msg__)->set_constructor();
177 :
178 :
179 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPChild")) {
180 0 : mozilla::ipc::LogMessageForProtocol("PGMPChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
181 : }
182 0 : AUTO_PROFILER_LABEL("PGMP::Msg_PGMPStorageConstructor", OTHER);
183 0 : PGMP::Transition(PGMP::Msg_PGMPStorageConstructor__ID, (&(mState)));
184 :
185 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
186 0 : if ((!(sendok__))) {
187 0 : FatalError("constructor for actor failed");
188 0 : return nullptr;
189 : }
190 0 : return actor;
191 : }
192 :
193 0 : auto PGMPChild::SendPGMPContentChildDestroyed() -> bool
194 : {
195 0 : IPC::Message* msg__ = PGMP::Msg_PGMPContentChildDestroyed(MSG_ROUTING_CONTROL);
196 :
197 :
198 :
199 :
200 :
201 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPChild")) {
202 0 : mozilla::ipc::LogMessageForProtocol("PGMPChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
203 : }
204 0 : AUTO_PROFILER_LABEL("PGMP::Msg_PGMPContentChildDestroyed", OTHER);
205 0 : PGMP::Transition(PGMP::Msg_PGMPContentChildDestroyed__ID, (&(mState)));
206 :
207 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
208 0 : return sendok__;
209 : }
210 :
211 0 : auto PGMPChild::GetIPCChannel() -> MessageChannel*
212 : {
213 0 : return (&(mChannel));
214 : }
215 :
216 0 : auto PGMPChild::GetIPCChannel() const -> const MessageChannel*
217 : {
218 0 : return (&(mChannel));
219 : }
220 :
221 0 : auto PGMPChild::RemoveManagee(
222 : int32_t aProtocolId,
223 : ProtocolBase* aListener) -> void
224 : {
225 0 : switch (aProtocolId) {
226 : case PGMPTimerMsgStart:
227 : {
228 0 : PGMPTimerChild* actor = static_cast<PGMPTimerChild*>(aListener);
229 0 : auto& container = mManagedPGMPTimerChild;
230 0 : MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!");
231 :
232 0 : (container).RemoveEntry(actor);
233 0 : DeallocPGMPTimerChild(actor);
234 0 : return;
235 : }
236 : case PGMPStorageMsgStart:
237 : {
238 0 : PGMPStorageChild* actor = static_cast<PGMPStorageChild*>(aListener);
239 0 : auto& container = mManagedPGMPStorageChild;
240 0 : MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!");
241 :
242 0 : (container).RemoveEntry(actor);
243 0 : DeallocPGMPStorageChild(actor);
244 0 : return;
245 : }
246 : default:
247 : {
248 0 : FatalError("unreached");
249 0 : return;
250 : }
251 : }
252 : }
253 :
254 0 : auto PGMPChild::OnMessageReceived(const Message& msg__) -> PGMPChild::Result
255 : {
256 0 : int32_t route__ = (msg__).routing_id();
257 0 : if ((MSG_ROUTING_CONTROL) != (route__)) {
258 0 : ChannelListener* routed__ = Lookup(route__);
259 0 : if ((!(routed__))) {
260 0 : return MsgRouteError;
261 : }
262 0 : return (routed__)->OnMessageReceived(msg__);
263 : }
264 :
265 0 : switch ((msg__).type()) {
266 : case PGMP::Reply_PGMPTimerConstructor__ID:
267 : {
268 0 : return MsgProcessed;
269 : }
270 : case PGMP::Reply_PGMPStorageConstructor__ID:
271 : {
272 0 : return MsgProcessed;
273 : }
274 : case PGMP::Msg_CrashPluginNow__ID:
275 : {
276 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPChild")) {
277 0 : mozilla::ipc::LogMessageForProtocol("PGMPChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
278 : }
279 0 : AUTO_PROFILER_LABEL("PGMP::Msg_CrashPluginNow", OTHER);
280 :
281 0 : PGMP::Transition(PGMP::Msg_CrashPluginNow__ID, (&(mState)));
282 0 : if ((!(RecvCrashPluginNow()))) {
283 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
284 : // Error handled in mozilla::ipc::IPCResult
285 0 : return MsgProcessingError;
286 : }
287 :
288 0 : return MsgProcessed;
289 : }
290 : case PGMP::Msg_PreloadLibs__ID:
291 : {
292 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPChild")) {
293 0 : mozilla::ipc::LogMessageForProtocol("PGMPChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
294 : }
295 0 : AUTO_PROFILER_LABEL("PGMP::Msg_PreloadLibs", OTHER);
296 :
297 0 : PickleIterator iter__(msg__);
298 0 : nsCString libs;
299 :
300 0 : if ((!(Read((&(libs)), (&(msg__)), (&(iter__)))))) {
301 0 : FatalError("Error deserializing 'nsCString'");
302 0 : return MsgValueError;
303 : }
304 : // Sentinel = 'libs'
305 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1899335256)))) {
306 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
307 0 : return MsgValueError;
308 : }
309 0 : (msg__).EndRead(iter__, (msg__).type());
310 0 : PGMP::Transition(PGMP::Msg_PreloadLibs__ID, (&(mState)));
311 0 : if ((!(RecvPreloadLibs(mozilla::Move(libs))))) {
312 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
313 : // Error handled in mozilla::ipc::IPCResult
314 0 : return MsgProcessingError;
315 : }
316 :
317 0 : return MsgProcessed;
318 : }
319 : case PGMP::Msg_CloseActive__ID:
320 : {
321 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPChild")) {
322 0 : mozilla::ipc::LogMessageForProtocol("PGMPChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
323 : }
324 0 : AUTO_PROFILER_LABEL("PGMP::Msg_CloseActive", OTHER);
325 :
326 0 : PGMP::Transition(PGMP::Msg_CloseActive__ID, (&(mState)));
327 0 : if ((!(RecvCloseActive()))) {
328 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
329 : // Error handled in mozilla::ipc::IPCResult
330 0 : return MsgProcessingError;
331 : }
332 :
333 0 : return MsgProcessed;
334 : }
335 : case PGMP::Msg_InitGMPContentChild__ID:
336 : {
337 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPChild")) {
338 0 : mozilla::ipc::LogMessageForProtocol("PGMPChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
339 : }
340 0 : AUTO_PROFILER_LABEL("PGMP::Msg_InitGMPContentChild", OTHER);
341 :
342 0 : PickleIterator iter__(msg__);
343 0 : Endpoint<mozilla::gmp::PGMPContentChild> endpoint;
344 :
345 0 : if ((!(Read((&(endpoint)), (&(msg__)), (&(iter__)))))) {
346 0 : FatalError("Error deserializing 'Endpoint<mozilla::gmp::PGMPContentChild>'");
347 0 : return MsgValueError;
348 : }
349 : // Sentinel = 'endpoint'
350 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3610972515)))) {
351 0 : mozilla::ipc::SentinelReadError("Error deserializing 'Endpoint<mozilla::gmp::PGMPContentChild>'");
352 0 : return MsgValueError;
353 : }
354 0 : (msg__).EndRead(iter__, (msg__).type());
355 0 : PGMP::Transition(PGMP::Msg_InitGMPContentChild__ID, (&(mState)));
356 0 : if ((!(RecvInitGMPContentChild(mozilla::Move(endpoint))))) {
357 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
358 : // Error handled in mozilla::ipc::IPCResult
359 0 : return MsgProcessingError;
360 : }
361 :
362 0 : return MsgProcessed;
363 : }
364 : default:
365 : {
366 0 : return MsgNotKnown;
367 : }
368 : case SHMEM_CREATED_MESSAGE_TYPE:
369 : {
370 0 : if ((!(ShmemCreated(msg__)))) {
371 0 : return MsgPayloadError;
372 : }
373 0 : return MsgProcessed;
374 : }
375 : case SHMEM_DESTROYED_MESSAGE_TYPE:
376 : {
377 0 : if ((!(ShmemDestroyed(msg__)))) {
378 0 : return MsgPayloadError;
379 : }
380 0 : return MsgProcessed;
381 : }
382 : }
383 : }
384 :
385 0 : auto PGMPChild::OnMessageReceived(
386 : const Message& msg__,
387 : Message*& reply__) -> PGMPChild::Result
388 : {
389 0 : int32_t route__ = (msg__).routing_id();
390 0 : if ((MSG_ROUTING_CONTROL) != (route__)) {
391 0 : ChannelListener* routed__ = Lookup(route__);
392 0 : if ((!(routed__))) {
393 0 : return MsgRouteError;
394 : }
395 0 : return (routed__)->OnMessageReceived(msg__, reply__);
396 : }
397 :
398 0 : return MsgNotKnown;
399 : }
400 :
401 0 : auto PGMPChild::OnCallReceived(
402 : const Message& msg__,
403 : Message*& reply__) -> PGMPChild::Result
404 : {
405 0 : int32_t route__ = (msg__).routing_id();
406 0 : if ((MSG_ROUTING_CONTROL) != (route__)) {
407 0 : ChannelListener* routed__ = Lookup(route__);
408 0 : if ((!(routed__))) {
409 0 : return MsgRouteError;
410 : }
411 0 : return (routed__)->OnCallReceived(msg__, reply__);
412 : }
413 :
414 0 : switch ((msg__).type()) {
415 : case PGMP::Msg_StartPlugin__ID:
416 : {
417 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPChild")) {
418 0 : mozilla::ipc::LogMessageForProtocol("PGMPChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
419 : }
420 0 : AUTO_PROFILER_LABEL("PGMP::Msg_StartPlugin", OTHER);
421 :
422 0 : PickleIterator iter__(msg__);
423 0 : nsString adapter;
424 :
425 0 : if ((!(Read((&(adapter)), (&(msg__)), (&(iter__)))))) {
426 0 : FatalError("Error deserializing 'nsString'");
427 0 : return MsgValueError;
428 : }
429 : // Sentinel = 'adapter'
430 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3228599530)))) {
431 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
432 0 : return MsgValueError;
433 : }
434 0 : (msg__).EndRead(iter__, (msg__).type());
435 0 : PGMP::Transition(PGMP::Msg_StartPlugin__ID, (&(mState)));
436 0 : int32_t id__ = MSG_ROUTING_CONTROL;
437 0 : if ((!(AnswerStartPlugin(mozilla::Move(adapter))))) {
438 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
439 : // Error handled in mozilla::ipc::IPCResult
440 0 : return MsgProcessingError;
441 : }
442 :
443 0 : reply__ = PGMP::Reply_StartPlugin(id__);
444 :
445 0 : (reply__)->set_interrupt();
446 0 : (reply__)->set_reply();
447 :
448 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPChild")) {
449 0 : mozilla::ipc::LogMessageForProtocol("PGMPChild", OtherPid(), "Sending reply ", (reply__)->type(), mozilla::ipc::MessageDirection::eSending);
450 : }
451 0 : return MsgProcessed;
452 : }
453 : default:
454 : {
455 0 : return MsgNotKnown;
456 : }
457 : }
458 : }
459 :
460 0 : auto PGMPChild::GetProtocolTypeId() -> int32_t
461 : {
462 0 : return PGMPMsgStart;
463 : }
464 :
465 0 : auto PGMPChild::OnChannelClose() -> void
466 : {
467 0 : DestroySubtree(NormalShutdown);
468 0 : DeallocSubtree();
469 0 : DeallocShmems();
470 0 : DeallocPGMPChild();
471 0 : }
472 :
473 0 : auto PGMPChild::OnChannelError() -> void
474 : {
475 0 : DestroySubtree(AbnormalShutdown);
476 0 : DeallocSubtree();
477 0 : DeallocShmems();
478 0 : DeallocPGMPChild();
479 0 : }
480 :
481 0 : auto PGMPChild::ProcessNativeEventsInInterruptCall() -> void
482 : {
483 : #ifdef OS_WIN
484 : (mChannel).ProcessNativeEventsInInterruptCall();
485 : #else
486 0 : FatalError("This method is Windows-only");
487 : #endif
488 0 : }
489 :
490 0 : auto PGMPChild::ProtocolName() const -> const char*
491 : {
492 0 : return "PGMPChild";
493 : }
494 :
495 0 : auto PGMPChild::DestroySubtree(ActorDestroyReason why) -> void
496 : {
497 0 : ActorDestroyReason subtreewhy = (((why) == (Deletion)) || ((why) == (FailedConstructor)) ? AncestorDeletion : why);
498 :
499 : {
500 : // Recursively shutting down PGMPTimer kids
501 0 : nsTArray<PGMPTimerChild*> kids;
502 : // Accumulate kids into a stable structure to iterate over
503 0 : ManagedPGMPTimerChild(kids);
504 0 : for (auto& kid : kids) {
505 : // Guarding against a child removing a sibling from the list during the iteration.
506 0 : if ((mManagedPGMPTimerChild).Contains(kid)) {
507 0 : (kid)->DestroySubtree(subtreewhy);
508 : }
509 : }
510 : }
511 : {
512 : // Recursively shutting down PGMPStorage kids
513 0 : nsTArray<PGMPStorageChild*> kids;
514 : // Accumulate kids into a stable structure to iterate over
515 0 : ManagedPGMPStorageChild(kids);
516 0 : for (auto& kid : kids) {
517 : // Guarding against a child removing a sibling from the list during the iteration.
518 0 : if ((mManagedPGMPStorageChild).Contains(kid)) {
519 0 : (kid)->DestroySubtree(subtreewhy);
520 : }
521 : }
522 : }
523 :
524 : // Reject owning pending promises.
525 0 : (GetIPCChannel())->RejectPendingPromisesForActor(this);
526 :
527 : // Finally, destroy "us".
528 0 : ActorDestroy(why);
529 0 : }
530 :
531 0 : auto PGMPChild::DeallocSubtree() -> void
532 : {
533 : {
534 : // Recursively deleting PGMPTimer kids
535 0 : for (auto iter = (mManagedPGMPTimerChild).Iter(); (!((iter).Done())); (iter).Next()) {
536 0 : (((iter).Get())->GetKey())->DeallocSubtree();
537 : }
538 :
539 0 : for (auto iter = (mManagedPGMPTimerChild).Iter(); (!((iter).Done())); (iter).Next()) {
540 0 : DeallocPGMPTimerChild(((iter).Get())->GetKey());
541 : }
542 0 : (mManagedPGMPTimerChild).Clear();
543 : }
544 : {
545 : // Recursively deleting PGMPStorage kids
546 0 : for (auto iter = (mManagedPGMPStorageChild).Iter(); (!((iter).Done())); (iter).Next()) {
547 0 : (((iter).Get())->GetKey())->DeallocSubtree();
548 : }
549 :
550 0 : for (auto iter = (mManagedPGMPStorageChild).Iter(); (!((iter).Done())); (iter).Next()) {
551 0 : DeallocPGMPStorageChild(((iter).Get())->GetKey());
552 : }
553 0 : (mManagedPGMPStorageChild).Clear();
554 : }
555 0 : }
556 :
557 0 : auto PGMPChild::DeallocPGMPChild() -> void
558 : {
559 0 : }
560 :
561 0 : auto PGMPChild::Write(
562 : const PGMPTimerChild* v__,
563 : Message* msg__,
564 : bool nullable__) -> void
565 : {
566 : int32_t id;
567 0 : if ((!(v__))) {
568 0 : if ((!(nullable__))) {
569 0 : FatalError("NULL actor value passed to non-nullable param");
570 : }
571 0 : id = 0;
572 : }
573 : else {
574 0 : id = (v__)->Id();
575 0 : if ((1) == (id)) {
576 0 : FatalError("actor has been |delete|d");
577 : }
578 : }
579 :
580 0 : Write(id, msg__);
581 0 : }
582 :
583 0 : auto PGMPChild::Read(
584 : PGMPTimerChild** v__,
585 : const Message* msg__,
586 : PickleIterator* iter__,
587 : bool nullable__) -> bool
588 : {
589 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PGMPTimer", PGMPTimerMsgStart);
590 0 : if ((actor).isNothing()) {
591 0 : return false;
592 : }
593 :
594 0 : (*(v__)) = static_cast<PGMPTimerChild*>((actor).value());
595 0 : return true;
596 : }
597 :
598 0 : auto PGMPChild::Write(
599 : Shmem& v__,
600 : Message* msg__) -> void
601 : {
602 0 : IPC::WriteParam(msg__, v__);
603 0 : (v__).RevokeRights(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
604 0 : (v__).forget(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
605 0 : }
606 :
607 0 : auto PGMPChild::Read(
608 : Shmem* v__,
609 : const Message* msg__,
610 : PickleIterator* iter__) -> bool
611 : {
612 0 : Shmem tmp;
613 0 : if ((!(IPC::ReadParam(msg__, iter__, (&(tmp)))))) {
614 0 : return false;
615 : }
616 :
617 0 : Shmem::id_t shmemid = (tmp).Id(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
618 0 : Shmem::SharedMemory* rawmem = LookupSharedMemory(shmemid);
619 0 : if (rawmem) {
620 0 : (*(v__)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), rawmem, shmemid);
621 0 : return true;
622 : }
623 0 : (*(v__)) = Shmem();
624 0 : return true;
625 : }
626 :
627 0 : auto PGMPChild::Write(
628 : const PGMPStorageChild* v__,
629 : Message* msg__,
630 : bool nullable__) -> void
631 : {
632 : int32_t id;
633 0 : if ((!(v__))) {
634 0 : if ((!(nullable__))) {
635 0 : FatalError("NULL actor value passed to non-nullable param");
636 : }
637 0 : id = 0;
638 : }
639 : else {
640 0 : id = (v__)->Id();
641 0 : if ((1) == (id)) {
642 0 : FatalError("actor has been |delete|d");
643 : }
644 : }
645 :
646 0 : Write(id, msg__);
647 0 : }
648 :
649 0 : auto PGMPChild::Read(
650 : PGMPStorageChild** v__,
651 : const Message* msg__,
652 : PickleIterator* iter__,
653 : bool nullable__) -> bool
654 : {
655 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PGMPStorage", PGMPStorageMsgStart);
656 0 : if ((actor).isNothing()) {
657 0 : return false;
658 : }
659 :
660 0 : (*(v__)) = static_cast<PGMPStorageChild*>((actor).value());
661 0 : return true;
662 : }
663 :
664 :
665 :
666 : } // namespace gmp
667 : } // namespace mozilla
|