1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/layers/PCompositorParent.h"
8 : #ifdef MOZ_CRASHREPORTER
9 : # include "nsXULAppAPI.h"
10 : #endif
11 :
12 : #include "mozilla/layers/PLayersParent.h"
13 :
14 : typedef IPC::Message Message;
15 : typedef mozilla::ipc::RPCChannel Channel;
16 : typedef mozilla::ipc::RPCChannel::RPCListener ChannelListener;
17 : typedef base::ProcessHandle ProcessHandle;
18 : typedef mozilla::ipc::AsyncChannel AsyncChannel;
19 : typedef mozilla::ipc::SharedMemory SharedMemory;
20 : typedef mozilla::ipc::Trigger Trigger;
21 : typedef mozilla::ipc::ActorHandle ActorHandle;
22 : typedef mozilla::ipc::Shmem Shmem;
23 : typedef mozilla::LayersBackend LayersBackend;
24 : typedef mozilla::null_t null_t;
25 : using mozilla::layers::PLayersParent;
26 :
27 : namespace mozilla {
28 : namespace layers {
29 :
30 :
31 : bool
32 0 : PCompositorParent::RecvPLayersConstructor(
33 : PLayersParent* actor,
34 : const LayersBackend& backend)
35 : {
36 0 : return true;
37 : }
38 :
39 : void
40 0 : PCompositorParent::ActorDestroy(ActorDestroyReason why)
41 : {
42 0 : }
43 :
44 : void
45 0 : PCompositorParent::ProcessingError(Result code)
46 : {
47 0 : }
48 :
49 : bool
50 0 : PCompositorParent::ShouldContinueFromReplyTimeout()
51 : {
52 0 : return true;
53 : }
54 :
55 : void
56 0 : PCompositorParent::EnteredCxxStack()
57 : {
58 0 : }
59 :
60 : void
61 0 : PCompositorParent::ExitedCxxStack()
62 : {
63 0 : }
64 :
65 : void
66 0 : PCompositorParent::EnteredCall()
67 : {
68 0 : }
69 :
70 : void
71 0 : PCompositorParent::ExitedCall()
72 : {
73 0 : }
74 :
75 0 : PCompositorParent::PCompositorParent() :
76 : mChannel(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
77 : mLastRouteId(1),
78 : mLastShmemId(1),
79 0 : mState(PCompositor::__Start)
80 : {
81 0 : MOZ_COUNT_CTOR(PCompositorParent);
82 0 : }
83 :
84 0 : PCompositorParent::~PCompositorParent()
85 : {
86 0 : MOZ_COUNT_DTOR(PCompositorParent);
87 0 : }
88 :
89 : bool
90 0 : PCompositorParent::Open(
91 : Channel::Transport* aTransport,
92 : ProcessHandle aOtherProcess,
93 : MessageLoop* aThread,
94 : AsyncChannel::Side aSide)
95 : {
96 0 : mOtherProcess = aOtherProcess;
97 0 : return (mChannel).Open(aTransport, aThread, aSide);
98 : }
99 :
100 : bool
101 0 : PCompositorParent::Open(
102 : AsyncChannel* aChannel,
103 : MessageLoop* aMessageLoop,
104 : AsyncChannel::Side aSide)
105 : {
106 0 : mOtherProcess = 0;
107 0 : return (mChannel).Open(aChannel, aMessageLoop, aSide);
108 : }
109 :
110 : void
111 0 : PCompositorParent::Close()
112 : {
113 0 : (mChannel).Close();
114 0 : }
115 :
116 : void
117 0 : PCompositorParent::SetReplyTimeoutMs(int32 aTimeoutMs)
118 : {
119 0 : (mChannel).SetReplyTimeoutMs(aTimeoutMs);
120 0 : }
121 :
122 : void
123 0 : PCompositorParent::ManagedPLayersParent(InfallibleTArray<PLayersParent*>& aArr) const
124 : {
125 0 : aArr = mManagedPLayersParent;
126 0 : }
127 :
128 : const InfallibleTArray<PLayersParent*>&
129 0 : PCompositorParent::ManagedPLayersParent() const
130 : {
131 0 : return mManagedPLayersParent;
132 : }
133 :
134 : PCompositor::State
135 0 : PCompositorParent::state()
136 : {
137 0 : return mState;
138 : }
139 :
140 : int32
141 0 : PCompositorParent::Register(ChannelListener* aRouted)
142 : {
143 0 : int32 tmp = (++(mLastRouteId));
144 0 : (mActorMap).AddWithID(aRouted, tmp);
145 0 : return tmp;
146 : }
147 :
148 : int32
149 0 : PCompositorParent::RegisterID(
150 : ChannelListener* aRouted,
151 : int32 aId)
152 : {
153 0 : (mActorMap).AddWithID(aRouted, aId);
154 0 : return aId;
155 : }
156 :
157 : ChannelListener*
158 0 : PCompositorParent::Lookup(int32 aId)
159 : {
160 0 : return (mActorMap).Lookup(aId);
161 : }
162 :
163 : void
164 0 : PCompositorParent::Unregister(int32 aId)
165 : {
166 0 : return (mActorMap).Remove(aId);
167 : }
168 :
169 : void
170 0 : PCompositorParent::RemoveManagee(
171 : int32 aProtocolId,
172 : ChannelListener* aListener)
173 : {
174 0 : switch (aProtocolId) {
175 : case PLayersMsgStart:
176 : {
177 0 : PLayersParent* actor = static_cast<PLayersParent*>(aListener);
178 0 : NS_ABORT_IF_FALSE(((mManagedPLayersParent).NoIndex) != ((mManagedPLayersParent).BinaryIndexOf(actor)), "actor not managed by this!");
179 :
180 0 : (mManagedPLayersParent).RemoveElementSorted(actor);
181 0 : DeallocPLayers(actor);
182 0 : return;
183 : }
184 : default:
185 : {
186 0 : NS_RUNTIMEABORT("unreached");
187 0 : return;
188 : }
189 : }
190 : }
191 :
192 : Shmem::SharedMemory*
193 0 : PCompositorParent::CreateSharedMemory(
194 : size_t aSize,
195 : Shmem::SharedMemory::SharedMemoryType type,
196 : bool unsafe,
197 : Shmem::id_t* aId)
198 : {
199 0 : nsAutoPtr<Shmem::SharedMemory> segment(Shmem::Alloc(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), aSize, type, unsafe));
200 0 : if ((!(segment))) {
201 0 : return 0;
202 : }
203 : Shmem aShmem(
204 : Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(),
205 : (segment).get(),
206 0 : (++(mLastShmemId)));
207 0 : Message* descriptor = (aShmem).ShareTo(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), OtherProcess(), MSG_ROUTING_CONTROL);
208 0 : if ((!(descriptor))) {
209 0 : return 0;
210 : }
211 0 : if ((!((mChannel).Send(descriptor)))) {
212 : }
213 0 : (*(aId)) = (aShmem).Id(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
214 0 : (mShmemMap).AddWithID(segment, (*(aId)));
215 0 : return (segment).forget();
216 : }
217 :
218 : bool
219 0 : PCompositorParent::AdoptSharedMemory(
220 : Shmem::SharedMemory* segment,
221 : Shmem::id_t* aId)
222 : {
223 : Shmem aShmem(
224 : Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(),
225 : segment,
226 0 : (++(mLastShmemId)));
227 0 : Message* descriptor = (aShmem).ShareTo(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), OtherProcess(), MSG_ROUTING_CONTROL);
228 0 : if ((!(descriptor))) {
229 0 : return false;
230 : }
231 0 : if ((!((mChannel).Send(descriptor)))) {
232 : }
233 0 : (*(aId)) = (aShmem).Id(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
234 0 : (mShmemMap).AddWithID(segment, (*(aId)));
235 0 : (segment)->AddRef();
236 0 : return true;
237 : }
238 :
239 : Shmem::SharedMemory*
240 0 : PCompositorParent::LookupSharedMemory(Shmem::id_t aId)
241 : {
242 0 : return (mShmemMap).Lookup(aId);
243 : }
244 :
245 : bool
246 0 : PCompositorParent::IsTrackingSharedMemory(Shmem::SharedMemory* segment)
247 : {
248 0 : return (mShmemMap).HasData(segment);
249 : }
250 :
251 : bool
252 0 : PCompositorParent::DestroySharedMemory(Shmem& aShmem)
253 : {
254 0 : Shmem::id_t aId = (aShmem).Id(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
255 0 : Shmem::SharedMemory* segment = LookupSharedMemory(aId);
256 0 : if ((!(segment))) {
257 0 : return false;
258 : }
259 0 : Message* descriptor = (aShmem).UnshareFrom(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), OtherProcess(), MSG_ROUTING_CONTROL);
260 :
261 0 : (mShmemMap).Remove(aId);
262 0 : Shmem::Dealloc(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), segment);
263 :
264 0 : return (descriptor) && ((mChannel).Send(descriptor));
265 : }
266 :
267 : ProcessHandle
268 0 : PCompositorParent::OtherProcess() const
269 : {
270 0 : return mOtherProcess;
271 : }
272 :
273 : AsyncChannel*
274 0 : PCompositorParent::GetIPCChannel()
275 : {
276 0 : return (&(mChannel));
277 : }
278 :
279 : PCompositorParent::Result
280 0 : PCompositorParent::OnMessageReceived(const Message& __msg)
281 : {
282 0 : int32 __route = (__msg).routing_id();
283 0 : if ((MSG_ROUTING_CONTROL) != (__route)) {
284 0 : ChannelListener* __routed = Lookup(__route);
285 0 : if ((!(__routed))) {
286 0 : return MsgRouteError;
287 : }
288 0 : return (__routed)->OnMessageReceived(__msg);
289 : }
290 :
291 0 : switch ((__msg).type()) {
292 : default:
293 : {
294 0 : return MsgNotKnown;
295 : }
296 : case SHMEM_CREATED_MESSAGE_TYPE:
297 : {
298 : Shmem::id_t id;
299 0 : nsAutoPtr<Shmem::SharedMemory> rawmem(Shmem::OpenExisting(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), __msg, (&(id)), true));
300 0 : if ((!(rawmem))) {
301 0 : return MsgPayloadError;
302 : }
303 0 : (mShmemMap).AddWithID((rawmem).forget(), id);
304 :
305 0 : return MsgProcessed;
306 : }
307 : case SHMEM_DESTROYED_MESSAGE_TYPE:
308 : {
309 : Shmem::id_t id;
310 0 : void* iter = 0;
311 0 : if ((!(IPC::ReadParam((&(__msg)), (&(iter)), (&(id)))))) {
312 0 : return MsgPayloadError;
313 : }
314 0 : (__msg).EndRead(iter);
315 :
316 0 : Shmem::SharedMemory* rawmem = LookupSharedMemory(id);
317 0 : if ((!(rawmem))) {
318 0 : return MsgValueError;
319 : }
320 0 : (mShmemMap).Remove(id);
321 0 : Shmem::Dealloc(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), rawmem);
322 0 : return MsgProcessed;
323 : }
324 : }
325 : }
326 :
327 : PCompositorParent::Result
328 0 : PCompositorParent::OnMessageReceived(
329 : const Message& __msg,
330 : Message*& __reply)
331 : {
332 0 : int32 __route = (__msg).routing_id();
333 0 : if ((MSG_ROUTING_CONTROL) != (__route)) {
334 0 : ChannelListener* __routed = Lookup(__route);
335 0 : if ((!(__routed))) {
336 0 : return MsgRouteError;
337 : }
338 0 : return (__routed)->OnMessageReceived(__msg, __reply);
339 : }
340 :
341 0 : switch ((__msg).type()) {
342 : case PCompositor::Msg_Stop__ID:
343 : {
344 0 : (const_cast<Message&>(__msg)).set_name("PCompositor::Msg_Stop");
345 0 : if (mozilla::ipc::LoggingEnabled()) {
346 0 : (static_cast<const PCompositor::Msg_Stop*>((&(__msg))))->Log("[PCompositorParent] Received ", stderr);
347 : }
348 :
349 0 : if ((!(PCompositor::Transition(mState, Trigger(Trigger::Recv, PCompositor::Msg_Stop__ID), (&(mState)))))) {
350 0 : NS_WARNING("bad state transition!");
351 : }
352 0 : int32 __id = MSG_ROUTING_CONTROL;
353 0 : if ((!(RecvStop()))) {
354 0 : return MsgProcessingError;
355 : }
356 :
357 0 : __reply = new PCompositor::Reply_Stop();
358 :
359 0 : (__reply)->set_routing_id(__id);
360 0 : (__reply)->set_sync();
361 0 : (__reply)->set_reply();
362 :
363 0 : if (mozilla::ipc::LoggingEnabled()) {
364 0 : (static_cast<const PCompositor::Reply_Stop*>(__reply))->Log("[PCompositorParent] Sending reply ", stderr);
365 : }
366 0 : return MsgProcessed;
367 : }
368 : case PCompositor::Msg_PLayersConstructor__ID:
369 : {
370 0 : (const_cast<Message&>(__msg)).set_name("PCompositor::Msg_PLayersConstructor");
371 0 : if (mozilla::ipc::LoggingEnabled()) {
372 0 : (static_cast<const PCompositor::Msg_PLayersConstructor*>((&(__msg))))->Log("[PCompositorParent] Received ", stderr);
373 : }
374 :
375 0 : void* __iter = 0;
376 : ActorHandle __handle;
377 : PLayersParent* actor;
378 : LayersBackend backend;
379 :
380 0 : if ((!(Read((&(__handle)), (&(__msg)), (&(__iter)))))) {
381 0 : FatalError("error deserializing (better message TODO)");
382 0 : return MsgValueError;
383 : }
384 0 : if ((!(Read((&(backend)), (&(__msg)), (&(__iter)))))) {
385 0 : FatalError("error deserializing (better message TODO)");
386 0 : return MsgValueError;
387 : }
388 0 : (__msg).EndRead(__iter);
389 0 : if ((!(PCompositor::Transition(mState, Trigger(Trigger::Recv, PCompositor::Msg_PLayersConstructor__ID), (&(mState)))))) {
390 0 : NS_WARNING("bad state transition!");
391 : }
392 0 : actor = AllocPLayers(backend);
393 0 : if ((!(actor))) {
394 0 : return MsgValueError;
395 : }
396 0 : (actor)->mId = RegisterID(actor, (__handle).mId);
397 0 : (actor)->mManager = this;
398 0 : (actor)->mChannel = (&(mChannel));
399 0 : (mManagedPLayersParent).InsertElementSorted(actor);
400 0 : (actor)->mState = mozilla::layers::PLayers::__Start;
401 :
402 0 : int32 __id = MSG_ROUTING_CONTROL;
403 0 : if ((!(RecvPLayersConstructor(actor, backend)))) {
404 0 : return MsgProcessingError;
405 : }
406 0 : __reply = new PCompositor::Reply_PLayersConstructor();
407 :
408 0 : (__reply)->set_routing_id(__id);
409 0 : (__reply)->set_sync();
410 0 : (__reply)->set_reply();
411 :
412 0 : if (mozilla::ipc::LoggingEnabled()) {
413 0 : (static_cast<const PCompositor::Reply_PLayersConstructor*>(__reply))->Log("[PCompositorParent] Sending reply ", stderr);
414 : }
415 :
416 0 : return MsgProcessed;
417 : }
418 : default:
419 : {
420 0 : return MsgNotKnown;
421 : }
422 : }
423 : }
424 :
425 : PCompositorParent::Result
426 0 : PCompositorParent::OnCallReceived(
427 : const Message& __msg,
428 : Message*& __reply)
429 : {
430 0 : int32 __route = (__msg).routing_id();
431 0 : if ((MSG_ROUTING_CONTROL) != (__route)) {
432 0 : ChannelListener* __routed = Lookup(__route);
433 0 : if ((!(__routed))) {
434 0 : return MsgRouteError;
435 : }
436 0 : return (__routed)->OnCallReceived(__msg, __reply);
437 : }
438 :
439 0 : return MsgNotKnown;
440 : }
441 :
442 : void
443 0 : PCompositorParent::OnProcessingError(Result code)
444 : {
445 0 : return ProcessingError(code);
446 : }
447 :
448 : bool
449 0 : PCompositorParent::OnReplyTimeout()
450 : {
451 0 : return ShouldContinueFromReplyTimeout();
452 : }
453 :
454 : void
455 0 : PCompositorParent::OnEnteredCxxStack()
456 : {
457 0 : return EnteredCxxStack();
458 : }
459 :
460 : void
461 0 : PCompositorParent::OnExitedCxxStack()
462 : {
463 0 : return ExitedCxxStack();
464 : }
465 :
466 : void
467 0 : PCompositorParent::OnEnteredCall()
468 : {
469 0 : return EnteredCall();
470 : }
471 :
472 : void
473 0 : PCompositorParent::OnExitedCall()
474 : {
475 0 : return ExitedCall();
476 : }
477 :
478 : bool
479 0 : PCompositorParent::IsOnCxxStack() const
480 : {
481 0 : return (mChannel).IsOnCxxStack();
482 : }
483 :
484 : void
485 0 : PCompositorParent::FlushPendingRPCQueue()
486 : {
487 0 : ((this)->mChannel).FlushPendingRPCQueue();
488 0 : }
489 :
490 : void
491 0 : PCompositorParent::OnChannelClose()
492 : {
493 0 : DestroySubtree(NormalShutdown);
494 0 : DeallocSubtree();
495 0 : DeallocShmems();
496 0 : }
497 :
498 : void
499 0 : PCompositorParent::OnChannelError()
500 : {
501 0 : DestroySubtree(AbnormalShutdown);
502 0 : DeallocSubtree();
503 0 : DeallocShmems();
504 0 : }
505 :
506 : void
507 0 : PCompositorParent::OnChannelConnected(int32 pid)
508 : {
509 0 : }
510 :
511 : bool
512 0 : PCompositorParent::AllocShmem(
513 : size_t aSize,
514 : Shmem::SharedMemory::SharedMemoryType aType,
515 : Shmem* aMem)
516 : {
517 : Shmem::id_t aId;
518 0 : nsAutoPtr<Shmem::SharedMemory> rawmem(CreateSharedMemory(aSize, aType, false, (&(aId))));
519 0 : if ((!(rawmem))) {
520 0 : return false;
521 : }
522 :
523 0 : (*(aMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), (rawmem).forget(), aId);
524 0 : return true;
525 : }
526 :
527 : bool
528 0 : PCompositorParent::AllocUnsafeShmem(
529 : size_t aSize,
530 : Shmem::SharedMemory::SharedMemoryType aType,
531 : Shmem* aMem)
532 : {
533 : Shmem::id_t aId;
534 0 : nsAutoPtr<Shmem::SharedMemory> rawmem(CreateSharedMemory(aSize, aType, true, (&(aId))));
535 0 : if ((!(rawmem))) {
536 0 : return false;
537 : }
538 :
539 0 : (*(aMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), (rawmem).forget(), aId);
540 0 : return true;
541 : }
542 :
543 : bool
544 0 : PCompositorParent::AdoptShmem(
545 : Shmem& aMem,
546 : Shmem* aOutMem)
547 : {
548 0 : Shmem::SharedMemory* rawmem = (aMem).Segment(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
549 0 : if (((!(rawmem))) || (IsTrackingSharedMemory(rawmem))) {
550 0 : NS_RUNTIMEABORT("bad Shmem");
551 : }
552 :
553 : Shmem::id_t aId;
554 0 : if ((!(AdoptSharedMemory(rawmem, (&(aId)))))) {
555 0 : return false;
556 : }
557 :
558 0 : (*(aOutMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), rawmem, aId);
559 0 : return true;
560 : }
561 :
562 : bool
563 0 : PCompositorParent::DeallocShmem(Shmem& aMem)
564 : {
565 0 : bool ok = DestroySharedMemory(aMem);
566 0 : (aMem).forget(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
567 0 : return ok;
568 : }
569 :
570 : void
571 0 : PCompositorParent::ProcessNativeEventsInRPCCall()
572 : {
573 : #ifdef OS_WIN
574 : (mChannel).ProcessNativeEventsInRPCCall();
575 : #else
576 0 : NS_RUNTIMEABORT("This method is Windows-only");
577 : #endif
578 0 : }
579 :
580 : void
581 0 : PCompositorParent::SetOtherProcess(ProcessHandle aOtherProcess)
582 : {
583 0 : mOtherProcess = aOtherProcess;
584 0 : }
585 :
586 : base::ProcessId
587 0 : PCompositorParent::OtherSidePID() const
588 : {
589 0 : return base::GetProcId(mOtherProcess);
590 : }
591 :
592 : bool
593 0 : PCompositorParent::TakeMinidump(nsILocalFile** aDump) const
594 : {
595 : #ifdef MOZ_CRASHREPORTER
596 0 : return XRE_TakeMinidumpForChild(OtherSidePID(), aDump);
597 : #else
598 : return false;
599 : #endif
600 : }
601 :
602 : bool
603 0 : PCompositorParent::BlockChild()
604 : {
605 0 : return (mChannel).BlockChild();
606 : }
607 :
608 : bool
609 0 : PCompositorParent::UnblockChild()
610 : {
611 0 : return (mChannel).UnblockChild();
612 : }
613 :
614 : void
615 0 : PCompositorParent::FatalError(const char* const msg) const
616 : {
617 : // Virtual method to prevent inlining.
618 : // This give us better error reporting.
619 : // See bug 589371
620 :
621 0 : NS_ERROR("IPDL error:");
622 0 : NS_ERROR(msg);
623 :
624 0 : NS_ERROR("[PCompositorParent] killing child side as a result");
625 :
626 0 : if ((!(base::KillProcess(OtherProcess(), base::PROCESS_END_KILLED_BY_USER, false)))) {
627 0 : NS_ERROR(" may have failed to kill child!");
628 : }
629 0 : }
630 :
631 : void
632 0 : PCompositorParent::DestroySubtree(ActorDestroyReason why)
633 : {
634 0 : ActorDestroyReason subtreewhy = (((why) == (Deletion)) || ((why) == (FailedConstructor)) ? AncestorDeletion : why);
635 :
636 : {
637 : // Recursively shutting down PLayers kids
638 0 : InfallibleTArray<PLayersParent*> kids = mManagedPLayersParent;
639 0 : for (uint32 i = 0; (i) < ((kids).Length()); (++(i))) {
640 0 : (kids[i])->DestroySubtree(subtreewhy);
641 : }
642 : }
643 :
644 : // Finally, destroy "us".
645 0 : ActorDestroy(why);
646 0 : }
647 :
648 : void
649 0 : PCompositorParent::DeallocSubtree()
650 : {
651 : {
652 : // Recursively deleting PLayers kids
653 0 : InfallibleTArray<PLayersParent*>& kids = mManagedPLayersParent;
654 0 : for (uint32 i = 0; (i) < ((kids).Length()); (++(i))) {
655 0 : (kids[i])->DeallocSubtree();
656 : }
657 :
658 0 : for (uint32 i = 0; (i) < ((kids).Length()); (++(i))) {
659 0 : DeallocPLayers(kids[i]);
660 : }
661 0 : (mManagedPLayersParent).Clear();
662 : }
663 0 : }
664 :
665 : void
666 0 : PCompositorParent::DeallocShmems()
667 : {
668 0 : for (IDMap<SharedMemory>::const_iterator cit = (mShmemMap).begin(); (cit) != ((mShmemMap).end()); (++(cit))) {
669 0 : Shmem::Dealloc(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), (cit)->second);
670 : }
671 0 : (mShmemMap).Clear();
672 0 : }
673 :
674 : void
675 0 : PCompositorParent::Write(
676 : PLayersParent* __v,
677 : Message* __msg,
678 : bool __nullable)
679 : {
680 : int32 id;
681 0 : if ((!(__v))) {
682 0 : if ((!(__nullable))) {
683 0 : NS_RUNTIMEABORT("NULL actor value passed to non-nullable param");
684 : }
685 0 : id = 0;
686 : }
687 : else {
688 0 : id = (__v)->mId;
689 0 : if ((1) == (id)) {
690 0 : NS_RUNTIMEABORT("actor has been |delete|d");
691 : }
692 : }
693 :
694 0 : Write(id, __msg);
695 0 : }
696 :
697 : bool
698 0 : PCompositorParent::Read(
699 : PLayersParent** __v,
700 : const Message* __msg,
701 : void** __iter,
702 : bool __nullable)
703 : {
704 : int32 id;
705 0 : if ((!(Read((&(id)), __msg, __iter)))) {
706 0 : return false;
707 : }
708 0 : if (((1) == (id)) || (((0) == (id)) && ((!(__nullable))))) {
709 0 : return false;
710 : }
711 :
712 0 : if ((0) == (id)) {
713 0 : (*(__v)) = 0;
714 : }
715 : else {
716 0 : (*(__v)) = static_cast<PLayersParent*>(Lookup(id));
717 0 : if ((!((*(__v))))) {
718 0 : return false;
719 : }
720 : }
721 0 : return true;
722 : }
723 :
724 :
725 :
726 : } // namespace layers
727 : } // namespace mozilla
|