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