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