1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/plugins/PPluginModuleChild.h"
8 : #ifdef MOZ_CRASHREPORTER
9 : # include "nsXULAppAPI.h"
10 : #endif
11 :
12 : #include "mozilla/plugins/PPluginIdentifierChild.h"
13 : #include "mozilla/plugins/PPluginInstanceChild.h"
14 : #include "mozilla/plugins/PPluginScriptableObjectChild.h"
15 : #include "mozilla/dom/PCrashReporterChild.h"
16 :
17 : typedef IPC::Message Message;
18 : typedef mozilla::ipc::RPCChannel Channel;
19 : typedef mozilla::ipc::RPCChannel::RPCListener ChannelListener;
20 : typedef base::ProcessHandle ProcessHandle;
21 : typedef mozilla::ipc::AsyncChannel AsyncChannel;
22 : typedef mozilla::ipc::SharedMemory SharedMemory;
23 : typedef mozilla::ipc::Trigger Trigger;
24 : typedef mozilla::ipc::ActorHandle ActorHandle;
25 : typedef mozilla::ipc::Shmem Shmem;
26 : typedef base::FileDescriptor FileDescriptor;
27 : typedef mozilla::dom::NativeThreadId NativeThreadId;
28 : typedef mac_plugin_interposing::NSCursorInfo NSCursorInfo;
29 : using mozilla::plugins::PPluginIdentifierChild;
30 : using mozilla::plugins::PPluginInstanceChild;
31 : using mozilla::plugins::PPluginScriptableObjectChild;
32 : using mozilla::dom::PCrashReporterChild;
33 :
34 : namespace mozilla {
35 : namespace plugins {
36 :
37 :
38 : bool
39 0 : PPluginModuleChild::RecvPPluginIdentifierConstructor(
40 : PPluginIdentifierChild* actor,
41 : const nsCString& aString,
42 : const int32_t& aInt,
43 : const bool& temporary)
44 : {
45 0 : return true;
46 : }
47 :
48 : bool
49 0 : PPluginModuleChild::AnswerPPluginInstanceConstructor(
50 : PPluginInstanceChild* actor,
51 : const nsCString& aMimeType,
52 : const uint16_t& aMode,
53 : const InfallibleTArray<nsCString>& aNames,
54 : const InfallibleTArray<nsCString>& aValues,
55 : NPError* rv)
56 : {
57 0 : return true;
58 : }
59 :
60 : bool
61 0 : PPluginModuleChild::AnswerPCrashReporterConstructor(
62 : PCrashReporterChild* actor,
63 : NativeThreadId* tid,
64 : PRUint32* processType)
65 : {
66 0 : return true;
67 : }
68 :
69 : void
70 0 : PPluginModuleChild::ActorDestroy(ActorDestroyReason why)
71 : {
72 0 : }
73 :
74 : void
75 0 : PPluginModuleChild::ProcessingError(Result code)
76 : {
77 0 : }
78 :
79 : bool
80 0 : PPluginModuleChild::ShouldContinueFromReplyTimeout()
81 : {
82 0 : return true;
83 : }
84 :
85 : void
86 0 : PPluginModuleChild::EnteredCxxStack()
87 : {
88 0 : }
89 :
90 : void
91 0 : PPluginModuleChild::ExitedCxxStack()
92 : {
93 0 : }
94 :
95 : void
96 0 : PPluginModuleChild::EnteredCall()
97 : {
98 0 : }
99 :
100 : void
101 0 : PPluginModuleChild::ExitedCall()
102 : {
103 0 : }
104 :
105 0 : PPluginModuleChild::PPluginModuleChild() :
106 : mChannel(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
107 : mLastRouteId(0),
108 : mLastShmemId(0),
109 0 : mState(PPluginModule::__Start)
110 : {
111 0 : MOZ_COUNT_CTOR(PPluginModuleChild);
112 0 : }
113 :
114 0 : PPluginModuleChild::~PPluginModuleChild()
115 : {
116 0 : MOZ_COUNT_DTOR(PPluginModuleChild);
117 0 : }
118 :
119 : bool
120 0 : PPluginModuleChild::Open(
121 : Channel::Transport* aTransport,
122 : ProcessHandle aOtherProcess,
123 : MessageLoop* aThread,
124 : AsyncChannel::Side aSide)
125 : {
126 0 : mOtherProcess = aOtherProcess;
127 0 : return (mChannel).Open(aTransport, aThread, aSide);
128 : }
129 :
130 : bool
131 0 : PPluginModuleChild::Open(
132 : AsyncChannel* aChannel,
133 : MessageLoop* aMessageLoop,
134 : AsyncChannel::Side aSide)
135 : {
136 0 : mOtherProcess = 0;
137 0 : return (mChannel).Open(aChannel, aMessageLoop, aSide);
138 : }
139 :
140 : void
141 0 : PPluginModuleChild::Close()
142 : {
143 0 : (mChannel).Close();
144 0 : }
145 :
146 : void
147 0 : PPluginModuleChild::SetReplyTimeoutMs(int32 aTimeoutMs)
148 : {
149 0 : (mChannel).SetReplyTimeoutMs(aTimeoutMs);
150 0 : }
151 :
152 : void
153 0 : PPluginModuleChild::ManagedPPluginInstanceChild(InfallibleTArray<PPluginInstanceChild*>& aArr) const
154 : {
155 0 : aArr = mManagedPPluginInstanceChild;
156 0 : }
157 :
158 : const InfallibleTArray<PPluginInstanceChild*>&
159 0 : PPluginModuleChild::ManagedPPluginInstanceChild() const
160 : {
161 0 : return mManagedPPluginInstanceChild;
162 : }
163 :
164 : void
165 0 : PPluginModuleChild::ManagedPPluginIdentifierChild(InfallibleTArray<PPluginIdentifierChild*>& aArr) const
166 : {
167 0 : aArr = mManagedPPluginIdentifierChild;
168 0 : }
169 :
170 : const InfallibleTArray<PPluginIdentifierChild*>&
171 0 : PPluginModuleChild::ManagedPPluginIdentifierChild() const
172 : {
173 0 : return mManagedPPluginIdentifierChild;
174 : }
175 :
176 : void
177 0 : PPluginModuleChild::ManagedPCrashReporterChild(InfallibleTArray<PCrashReporterChild*>& aArr) const
178 : {
179 0 : aArr = mManagedPCrashReporterChild;
180 0 : }
181 :
182 : const InfallibleTArray<PCrashReporterChild*>&
183 0 : PPluginModuleChild::ManagedPCrashReporterChild() const
184 : {
185 0 : return mManagedPCrashReporterChild;
186 : }
187 :
188 : PPluginModule::State
189 0 : PPluginModuleChild::state()
190 : {
191 0 : return mState;
192 : }
193 :
194 : PPluginIdentifierChild*
195 0 : PPluginModuleChild::SendPPluginIdentifierConstructor(
196 : const nsCString& aString,
197 : const int32_t& aInt,
198 : const bool& temporary)
199 : {
200 0 : return SendPPluginIdentifierConstructor(AllocPPluginIdentifier(aString, aInt, temporary), aString, aInt, temporary);
201 : }
202 :
203 : PPluginIdentifierChild*
204 0 : PPluginModuleChild::SendPPluginIdentifierConstructor(
205 : PPluginIdentifierChild* actor,
206 : const nsCString& aString,
207 : const int32_t& aInt,
208 : const bool& temporary)
209 : {
210 0 : if ((!(actor))) {
211 0 : return 0;
212 : }
213 0 : (actor)->mId = Register(actor);
214 0 : (actor)->mManager = this;
215 0 : (actor)->mChannel = (&(mChannel));
216 0 : (mManagedPPluginIdentifierChild).InsertElementSorted(actor);
217 0 : (actor)->mState = mozilla::plugins::PPluginIdentifier::__Start;
218 :
219 0 : PPluginModule::Msg_PPluginIdentifierConstructor* __msg = new PPluginModule::Msg_PPluginIdentifierConstructor();
220 :
221 0 : Write(actor, __msg, false);
222 0 : Write(aString, __msg);
223 0 : Write(aInt, __msg);
224 0 : Write(temporary, __msg);
225 :
226 0 : (__msg)->set_routing_id(MSG_ROUTING_CONTROL);
227 :
228 :
229 0 : if (mozilla::ipc::LoggingEnabled()) {
230 0 : (__msg)->Log("[PPluginModuleChild] Sending ", stderr);
231 : }
232 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Recv, PPluginModule::Msg_PPluginIdentifierConstructor__ID), (&(mState)))))) {
233 0 : NS_WARNING("bad state transition!");
234 : }
235 :
236 0 : bool __sendok = (mChannel).Send(__msg);
237 0 : if ((!(__sendok))) {
238 0 : (actor)->DestroySubtree(FailedConstructor);
239 0 : (actor)->DeallocSubtree();
240 0 : ((actor)->mManager)->RemoveManagee(PPluginIdentifierMsgStart, actor);
241 0 : return 0;
242 : }
243 0 : return actor;
244 : }
245 :
246 : bool
247 0 : PPluginModuleChild::SendProcessNativeEventsInRPCCall()
248 : {
249 0 : PPluginModule::Msg_ProcessNativeEventsInRPCCall* __msg = new PPluginModule::Msg_ProcessNativeEventsInRPCCall();
250 :
251 :
252 0 : (__msg)->set_routing_id(MSG_ROUTING_CONTROL);
253 :
254 :
255 :
256 0 : if (mozilla::ipc::LoggingEnabled()) {
257 0 : (__msg)->Log("[PPluginModuleChild] Sending ", stderr);
258 : }
259 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Recv, PPluginModule::Msg_ProcessNativeEventsInRPCCall__ID), (&(mState)))))) {
260 0 : NS_WARNING("bad state transition!");
261 : }
262 :
263 0 : bool __sendok = (mChannel).Send(__msg);
264 0 : return __sendok;
265 : }
266 :
267 : bool
268 0 : PPluginModuleChild::SendBackUpXResources(const FileDescriptor& aXSocketFd)
269 : {
270 0 : PPluginModule::Msg_BackUpXResources* __msg = new PPluginModule::Msg_BackUpXResources();
271 :
272 0 : Write(aXSocketFd, __msg);
273 :
274 0 : (__msg)->set_routing_id(MSG_ROUTING_CONTROL);
275 :
276 :
277 :
278 0 : if (mozilla::ipc::LoggingEnabled()) {
279 0 : (__msg)->Log("[PPluginModuleChild] Sending ", stderr);
280 : }
281 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Recv, PPluginModule::Msg_BackUpXResources__ID), (&(mState)))))) {
282 0 : NS_WARNING("bad state transition!");
283 : }
284 :
285 0 : bool __sendok = (mChannel).Send(__msg);
286 0 : return __sendok;
287 : }
288 :
289 : bool
290 0 : PPluginModuleChild::CallNPN_UserAgent(nsCString* userAgent)
291 : {
292 0 : PPluginModule::Msg_NPN_UserAgent* __msg = new PPluginModule::Msg_NPN_UserAgent();
293 :
294 :
295 0 : (__msg)->set_routing_id(MSG_ROUTING_CONTROL);
296 0 : (__msg)->set_rpc();
297 :
298 :
299 0 : Message __reply;
300 :
301 0 : if (mozilla::ipc::LoggingEnabled()) {
302 0 : (__msg)->Log("[PPluginModuleChild] Sending ", stderr);
303 : }
304 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Recv, PPluginModule::Msg_NPN_UserAgent__ID), (&(mState)))))) {
305 0 : NS_WARNING("bad state transition!");
306 : }
307 :
308 0 : bool __sendok = (mChannel).Call(__msg, (&(__reply)));
309 0 : if ((!(__sendok))) {
310 0 : return false;
311 : }
312 :
313 0 : if (mozilla::ipc::LoggingEnabled()) {
314 0 : (static_cast<const PPluginModule::Reply_NPN_UserAgent*>((&(__reply))))->Log("[PPluginModuleChild] Received reply ", stderr);
315 : }
316 :
317 0 : void* __iter = 0;
318 0 : if ((!(Read(userAgent, (&(__reply)), (&(__iter)))))) {
319 0 : FatalError("error deserializing (better message TODO)");
320 0 : return false;
321 : }
322 0 : (__reply).EndRead(__iter);
323 :
324 0 : return true;
325 : }
326 :
327 : bool
328 0 : PPluginModuleChild::CallNPN_GetValue_WithBoolReturn(
329 : const NPNVariable& aVariable,
330 : NPError* aError,
331 : bool* aBoolVal)
332 : {
333 0 : PPluginModule::Msg_NPN_GetValue_WithBoolReturn* __msg = new PPluginModule::Msg_NPN_GetValue_WithBoolReturn();
334 :
335 0 : Write(aVariable, __msg);
336 :
337 0 : (__msg)->set_routing_id(MSG_ROUTING_CONTROL);
338 0 : (__msg)->set_rpc();
339 :
340 :
341 0 : Message __reply;
342 :
343 0 : if (mozilla::ipc::LoggingEnabled()) {
344 0 : (__msg)->Log("[PPluginModuleChild] Sending ", stderr);
345 : }
346 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Recv, PPluginModule::Msg_NPN_GetValue_WithBoolReturn__ID), (&(mState)))))) {
347 0 : NS_WARNING("bad state transition!");
348 : }
349 :
350 0 : bool __sendok = (mChannel).Call(__msg, (&(__reply)));
351 0 : if ((!(__sendok))) {
352 0 : return false;
353 : }
354 :
355 0 : if (mozilla::ipc::LoggingEnabled()) {
356 0 : (static_cast<const PPluginModule::Reply_NPN_GetValue_WithBoolReturn*>((&(__reply))))->Log("[PPluginModuleChild] Received reply ", stderr);
357 : }
358 :
359 0 : void* __iter = 0;
360 0 : if ((!(Read(aError, (&(__reply)), (&(__iter)))))) {
361 0 : FatalError("error deserializing (better message TODO)");
362 0 : return false;
363 : }
364 0 : if ((!(Read(aBoolVal, (&(__reply)), (&(__iter)))))) {
365 0 : FatalError("error deserializing (better message TODO)");
366 0 : return false;
367 : }
368 0 : (__reply).EndRead(__iter);
369 :
370 0 : return true;
371 : }
372 :
373 : bool
374 0 : PPluginModuleChild::CallProcessSomeEvents()
375 : {
376 0 : PPluginModule::Msg_ProcessSomeEvents* __msg = new PPluginModule::Msg_ProcessSomeEvents();
377 :
378 :
379 0 : (__msg)->set_routing_id(MSG_ROUTING_CONTROL);
380 0 : (__msg)->set_rpc();
381 :
382 :
383 0 : Message __reply;
384 :
385 0 : if (mozilla::ipc::LoggingEnabled()) {
386 0 : (__msg)->Log("[PPluginModuleChild] Sending ", stderr);
387 : }
388 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Recv, PPluginModule::Msg_ProcessSomeEvents__ID), (&(mState)))))) {
389 0 : NS_WARNING("bad state transition!");
390 : }
391 :
392 0 : bool __sendok = (mChannel).Call(__msg, (&(__reply)));
393 0 : if ((!(__sendok))) {
394 0 : return false;
395 : }
396 :
397 0 : if (mozilla::ipc::LoggingEnabled()) {
398 0 : (static_cast<const PPluginModule::Reply_ProcessSomeEvents*>((&(__reply))))->Log("[PPluginModuleChild] Received reply ", stderr);
399 : }
400 :
401 0 : return true;
402 : }
403 :
404 : bool
405 0 : PPluginModuleChild::SendPluginShowWindow(
406 : const uint32_t& aWindowId,
407 : const bool& aModal,
408 : const int32_t& aX,
409 : const int32_t& aY,
410 : const size_t& aWidth,
411 : const size_t& aHeight)
412 : {
413 0 : PPluginModule::Msg_PluginShowWindow* __msg = new PPluginModule::Msg_PluginShowWindow();
414 :
415 0 : Write(aWindowId, __msg);
416 0 : Write(aModal, __msg);
417 0 : Write(aX, __msg);
418 0 : Write(aY, __msg);
419 0 : Write(aWidth, __msg);
420 0 : Write(aHeight, __msg);
421 :
422 0 : (__msg)->set_routing_id(MSG_ROUTING_CONTROL);
423 :
424 :
425 :
426 0 : if (mozilla::ipc::LoggingEnabled()) {
427 0 : (__msg)->Log("[PPluginModuleChild] Sending ", stderr);
428 : }
429 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Recv, PPluginModule::Msg_PluginShowWindow__ID), (&(mState)))))) {
430 0 : NS_WARNING("bad state transition!");
431 : }
432 :
433 0 : bool __sendok = (mChannel).Send(__msg);
434 0 : return __sendok;
435 : }
436 :
437 : bool
438 0 : PPluginModuleChild::SendPluginHideWindow(const uint32_t& aWindowId)
439 : {
440 0 : PPluginModule::Msg_PluginHideWindow* __msg = new PPluginModule::Msg_PluginHideWindow();
441 :
442 0 : Write(aWindowId, __msg);
443 :
444 0 : (__msg)->set_routing_id(MSG_ROUTING_CONTROL);
445 :
446 :
447 :
448 0 : if (mozilla::ipc::LoggingEnabled()) {
449 0 : (__msg)->Log("[PPluginModuleChild] Sending ", stderr);
450 : }
451 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Recv, PPluginModule::Msg_PluginHideWindow__ID), (&(mState)))))) {
452 0 : NS_WARNING("bad state transition!");
453 : }
454 :
455 0 : bool __sendok = (mChannel).Send(__msg);
456 0 : return __sendok;
457 : }
458 :
459 : bool
460 0 : PPluginModuleChild::SendSetCursor(const NSCursorInfo& cursorInfo)
461 : {
462 0 : PPluginModule::Msg_SetCursor* __msg = new PPluginModule::Msg_SetCursor();
463 :
464 0 : Write(cursorInfo, __msg);
465 :
466 0 : (__msg)->set_routing_id(MSG_ROUTING_CONTROL);
467 :
468 :
469 :
470 0 : if (mozilla::ipc::LoggingEnabled()) {
471 0 : (__msg)->Log("[PPluginModuleChild] Sending ", stderr);
472 : }
473 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Recv, PPluginModule::Msg_SetCursor__ID), (&(mState)))))) {
474 0 : NS_WARNING("bad state transition!");
475 : }
476 :
477 0 : bool __sendok = (mChannel).Send(__msg);
478 0 : return __sendok;
479 : }
480 :
481 : bool
482 0 : PPluginModuleChild::SendShowCursor(const bool& show)
483 : {
484 0 : PPluginModule::Msg_ShowCursor* __msg = new PPluginModule::Msg_ShowCursor();
485 :
486 0 : Write(show, __msg);
487 :
488 0 : (__msg)->set_routing_id(MSG_ROUTING_CONTROL);
489 :
490 :
491 :
492 0 : if (mozilla::ipc::LoggingEnabled()) {
493 0 : (__msg)->Log("[PPluginModuleChild] Sending ", stderr);
494 : }
495 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Recv, PPluginModule::Msg_ShowCursor__ID), (&(mState)))))) {
496 0 : NS_WARNING("bad state transition!");
497 : }
498 :
499 0 : bool __sendok = (mChannel).Send(__msg);
500 0 : return __sendok;
501 : }
502 :
503 : bool
504 0 : PPluginModuleChild::SendPushCursor(const NSCursorInfo& cursorInfo)
505 : {
506 0 : PPluginModule::Msg_PushCursor* __msg = new PPluginModule::Msg_PushCursor();
507 :
508 0 : Write(cursorInfo, __msg);
509 :
510 0 : (__msg)->set_routing_id(MSG_ROUTING_CONTROL);
511 :
512 :
513 :
514 0 : if (mozilla::ipc::LoggingEnabled()) {
515 0 : (__msg)->Log("[PPluginModuleChild] Sending ", stderr);
516 : }
517 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Recv, PPluginModule::Msg_PushCursor__ID), (&(mState)))))) {
518 0 : NS_WARNING("bad state transition!");
519 : }
520 :
521 0 : bool __sendok = (mChannel).Send(__msg);
522 0 : return __sendok;
523 : }
524 :
525 : bool
526 0 : PPluginModuleChild::SendPopCursor()
527 : {
528 0 : PPluginModule::Msg_PopCursor* __msg = new PPluginModule::Msg_PopCursor();
529 :
530 :
531 0 : (__msg)->set_routing_id(MSG_ROUTING_CONTROL);
532 :
533 :
534 :
535 0 : if (mozilla::ipc::LoggingEnabled()) {
536 0 : (__msg)->Log("[PPluginModuleChild] Sending ", stderr);
537 : }
538 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Recv, PPluginModule::Msg_PopCursor__ID), (&(mState)))))) {
539 0 : NS_WARNING("bad state transition!");
540 : }
541 :
542 0 : bool __sendok = (mChannel).Send(__msg);
543 0 : return __sendok;
544 : }
545 :
546 : bool
547 0 : PPluginModuleChild::SendGetNativeCursorsSupported(bool* supported)
548 : {
549 0 : PPluginModule::Msg_GetNativeCursorsSupported* __msg = new PPluginModule::Msg_GetNativeCursorsSupported();
550 :
551 :
552 0 : (__msg)->set_routing_id(MSG_ROUTING_CONTROL);
553 0 : (__msg)->set_sync();
554 :
555 :
556 0 : Message __reply;
557 :
558 0 : if (mozilla::ipc::LoggingEnabled()) {
559 0 : (__msg)->Log("[PPluginModuleChild] Sending ", stderr);
560 : }
561 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Recv, PPluginModule::Msg_GetNativeCursorsSupported__ID), (&(mState)))))) {
562 0 : NS_WARNING("bad state transition!");
563 : }
564 :
565 0 : bool __sendok = (mChannel).Send(__msg, (&(__reply)));
566 0 : if ((!(__sendok))) {
567 0 : return false;
568 : }
569 :
570 0 : if (mozilla::ipc::LoggingEnabled()) {
571 0 : (static_cast<const PPluginModule::Reply_GetNativeCursorsSupported*>((&(__reply))))->Log("[PPluginModuleChild] Received reply ", stderr);
572 : }
573 :
574 0 : void* __iter = 0;
575 0 : if ((!(Read(supported, (&(__reply)), (&(__iter)))))) {
576 0 : FatalError("error deserializing (better message TODO)");
577 0 : return false;
578 : }
579 0 : (__reply).EndRead(__iter);
580 :
581 0 : return true;
582 : }
583 :
584 : bool
585 0 : PPluginModuleChild::SendNPN_SetException(
586 : PPluginScriptableObjectChild* actor,
587 : const nsCString& message)
588 : {
589 0 : PPluginModule::Msg_NPN_SetException* __msg = new PPluginModule::Msg_NPN_SetException();
590 :
591 0 : Write(actor, __msg, true);
592 0 : Write(message, __msg);
593 :
594 0 : (__msg)->set_routing_id(MSG_ROUTING_CONTROL);
595 0 : (__msg)->set_sync();
596 :
597 :
598 0 : Message __reply;
599 :
600 0 : if (mozilla::ipc::LoggingEnabled()) {
601 0 : (__msg)->Log("[PPluginModuleChild] Sending ", stderr);
602 : }
603 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Recv, PPluginModule::Msg_NPN_SetException__ID), (&(mState)))))) {
604 0 : NS_WARNING("bad state transition!");
605 : }
606 :
607 0 : bool __sendok = (mChannel).Send(__msg, (&(__reply)));
608 0 : if ((!(__sendok))) {
609 0 : return false;
610 : }
611 :
612 0 : if (mozilla::ipc::LoggingEnabled()) {
613 0 : (static_cast<const PPluginModule::Reply_NPN_SetException*>((&(__reply))))->Log("[PPluginModuleChild] Received reply ", stderr);
614 : }
615 :
616 0 : return true;
617 : }
618 :
619 : bool
620 0 : PPluginModuleChild::SendNPN_ReloadPlugins(const bool& aReloadPages)
621 : {
622 0 : PPluginModule::Msg_NPN_ReloadPlugins* __msg = new PPluginModule::Msg_NPN_ReloadPlugins();
623 :
624 0 : Write(aReloadPages, __msg);
625 :
626 0 : (__msg)->set_routing_id(MSG_ROUTING_CONTROL);
627 :
628 :
629 :
630 0 : if (mozilla::ipc::LoggingEnabled()) {
631 0 : (__msg)->Log("[PPluginModuleChild] Sending ", stderr);
632 : }
633 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Recv, PPluginModule::Msg_NPN_ReloadPlugins__ID), (&(mState)))))) {
634 0 : NS_WARNING("bad state transition!");
635 : }
636 :
637 0 : bool __sendok = (mChannel).Send(__msg);
638 0 : return __sendok;
639 : }
640 :
641 : int32
642 0 : PPluginModuleChild::Register(ChannelListener* aRouted)
643 : {
644 0 : int32 tmp = (--(mLastRouteId));
645 0 : (mActorMap).AddWithID(aRouted, tmp);
646 0 : return tmp;
647 : }
648 :
649 : int32
650 0 : PPluginModuleChild::RegisterID(
651 : ChannelListener* aRouted,
652 : int32 aId)
653 : {
654 0 : (mActorMap).AddWithID(aRouted, aId);
655 0 : return aId;
656 : }
657 :
658 : ChannelListener*
659 0 : PPluginModuleChild::Lookup(int32 aId)
660 : {
661 0 : return (mActorMap).Lookup(aId);
662 : }
663 :
664 : void
665 0 : PPluginModuleChild::Unregister(int32 aId)
666 : {
667 0 : return (mActorMap).Remove(aId);
668 : }
669 :
670 : void
671 0 : PPluginModuleChild::RemoveManagee(
672 : int32 aProtocolId,
673 : ChannelListener* aListener)
674 : {
675 0 : switch (aProtocolId) {
676 : case PPluginInstanceMsgStart:
677 : {
678 0 : PPluginInstanceChild* actor = static_cast<PPluginInstanceChild*>(aListener);
679 0 : NS_ABORT_IF_FALSE(((mManagedPPluginInstanceChild).NoIndex) != ((mManagedPPluginInstanceChild).BinaryIndexOf(actor)), "actor not managed by this!");
680 :
681 0 : (mManagedPPluginInstanceChild).RemoveElementSorted(actor);
682 0 : DeallocPPluginInstance(actor);
683 0 : return;
684 : }
685 : case PPluginIdentifierMsgStart:
686 : {
687 0 : PPluginIdentifierChild* actor = static_cast<PPluginIdentifierChild*>(aListener);
688 0 : NS_ABORT_IF_FALSE(((mManagedPPluginIdentifierChild).NoIndex) != ((mManagedPPluginIdentifierChild).BinaryIndexOf(actor)), "actor not managed by this!");
689 :
690 0 : (mManagedPPluginIdentifierChild).RemoveElementSorted(actor);
691 0 : DeallocPPluginIdentifier(actor);
692 0 : return;
693 : }
694 : case PCrashReporterMsgStart:
695 : {
696 0 : PCrashReporterChild* actor = static_cast<PCrashReporterChild*>(aListener);
697 0 : NS_ABORT_IF_FALSE(((mManagedPCrashReporterChild).NoIndex) != ((mManagedPCrashReporterChild).BinaryIndexOf(actor)), "actor not managed by this!");
698 :
699 0 : (mManagedPCrashReporterChild).RemoveElementSorted(actor);
700 0 : DeallocPCrashReporter(actor);
701 0 : return;
702 : }
703 : default:
704 : {
705 0 : NS_RUNTIMEABORT("unreached");
706 0 : return;
707 : }
708 : }
709 : }
710 :
711 : Shmem::SharedMemory*
712 0 : PPluginModuleChild::CreateSharedMemory(
713 : size_t aSize,
714 : Shmem::SharedMemory::SharedMemoryType type,
715 : bool unsafe,
716 : Shmem::id_t* aId)
717 : {
718 0 : nsAutoPtr<Shmem::SharedMemory> segment(Shmem::Alloc(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), aSize, type, unsafe));
719 0 : if ((!(segment))) {
720 0 : return 0;
721 : }
722 : Shmem aShmem(
723 : Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(),
724 : (segment).get(),
725 0 : (--(mLastShmemId)));
726 0 : Message* descriptor = (aShmem).ShareTo(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), OtherProcess(), MSG_ROUTING_CONTROL);
727 0 : if ((!(descriptor))) {
728 0 : return 0;
729 : }
730 0 : if ((!((mChannel).Send(descriptor)))) {
731 : }
732 0 : (*(aId)) = (aShmem).Id(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
733 0 : (mShmemMap).AddWithID(segment, (*(aId)));
734 0 : return (segment).forget();
735 : }
736 :
737 : bool
738 0 : PPluginModuleChild::AdoptSharedMemory(
739 : Shmem::SharedMemory* segment,
740 : Shmem::id_t* aId)
741 : {
742 : Shmem aShmem(
743 : Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(),
744 : segment,
745 0 : (--(mLastShmemId)));
746 0 : Message* descriptor = (aShmem).ShareTo(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), OtherProcess(), MSG_ROUTING_CONTROL);
747 0 : if ((!(descriptor))) {
748 0 : return false;
749 : }
750 0 : if ((!((mChannel).Send(descriptor)))) {
751 : }
752 0 : (*(aId)) = (aShmem).Id(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
753 0 : (mShmemMap).AddWithID(segment, (*(aId)));
754 0 : (segment)->AddRef();
755 0 : return true;
756 : }
757 :
758 : Shmem::SharedMemory*
759 0 : PPluginModuleChild::LookupSharedMemory(Shmem::id_t aId)
760 : {
761 0 : return (mShmemMap).Lookup(aId);
762 : }
763 :
764 : bool
765 0 : PPluginModuleChild::IsTrackingSharedMemory(Shmem::SharedMemory* segment)
766 : {
767 0 : return (mShmemMap).HasData(segment);
768 : }
769 :
770 : bool
771 0 : PPluginModuleChild::DestroySharedMemory(Shmem& aShmem)
772 : {
773 0 : Shmem::id_t aId = (aShmem).Id(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
774 0 : Shmem::SharedMemory* segment = LookupSharedMemory(aId);
775 0 : if ((!(segment))) {
776 0 : return false;
777 : }
778 0 : Message* descriptor = (aShmem).UnshareFrom(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), OtherProcess(), MSG_ROUTING_CONTROL);
779 :
780 0 : (mShmemMap).Remove(aId);
781 0 : Shmem::Dealloc(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), segment);
782 :
783 0 : return (descriptor) && ((mChannel).Send(descriptor));
784 : }
785 :
786 : ProcessHandle
787 0 : PPluginModuleChild::OtherProcess() const
788 : {
789 0 : return mOtherProcess;
790 : }
791 :
792 : AsyncChannel*
793 0 : PPluginModuleChild::GetIPCChannel()
794 : {
795 0 : return (&(mChannel));
796 : }
797 :
798 : PPluginModuleChild::Result
799 0 : PPluginModuleChild::OnMessageReceived(const Message& __msg)
800 : {
801 0 : int32 __route = (__msg).routing_id();
802 0 : if ((MSG_ROUTING_CONTROL) != (__route)) {
803 0 : ChannelListener* __routed = Lookup(__route);
804 0 : if ((!(__routed))) {
805 0 : return MsgRouteError;
806 : }
807 0 : return (__routed)->OnMessageReceived(__msg);
808 : }
809 :
810 0 : switch ((__msg).type()) {
811 : case PPluginModule::Reply_PPluginIdentifierConstructor__ID:
812 : {
813 0 : return MsgProcessed;
814 : }
815 : case PPluginModule::Msg_PPluginIdentifierConstructor__ID:
816 : {
817 0 : (const_cast<Message&>(__msg)).set_name("PPluginModule::Msg_PPluginIdentifierConstructor");
818 0 : if (mozilla::ipc::LoggingEnabled()) {
819 0 : (static_cast<const PPluginModule::Msg_PPluginIdentifierConstructor*>((&(__msg))))->Log("[PPluginModuleChild] Received ", stderr);
820 : }
821 :
822 0 : void* __iter = 0;
823 : ActorHandle __handle;
824 : PPluginIdentifierChild* actor;
825 0 : nsCString aString;
826 : int32_t aInt;
827 : bool temporary;
828 :
829 0 : if ((!(Read((&(__handle)), (&(__msg)), (&(__iter)))))) {
830 0 : FatalError("error deserializing (better message TODO)");
831 0 : return MsgValueError;
832 : }
833 0 : if ((!(Read((&(aString)), (&(__msg)), (&(__iter)))))) {
834 0 : FatalError("error deserializing (better message TODO)");
835 0 : return MsgValueError;
836 : }
837 0 : if ((!(Read((&(aInt)), (&(__msg)), (&(__iter)))))) {
838 0 : FatalError("error deserializing (better message TODO)");
839 0 : return MsgValueError;
840 : }
841 0 : if ((!(Read((&(temporary)), (&(__msg)), (&(__iter)))))) {
842 0 : FatalError("error deserializing (better message TODO)");
843 0 : return MsgValueError;
844 : }
845 0 : (__msg).EndRead(__iter);
846 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Send, PPluginModule::Msg_PPluginIdentifierConstructor__ID), (&(mState)))))) {
847 0 : NS_WARNING("bad state transition!");
848 : }
849 0 : actor = AllocPPluginIdentifier(aString, aInt, temporary);
850 0 : if ((!(actor))) {
851 0 : return MsgValueError;
852 : }
853 0 : (actor)->mId = RegisterID(actor, (__handle).mId);
854 0 : (actor)->mManager = this;
855 0 : (actor)->mChannel = (&(mChannel));
856 0 : (mManagedPPluginIdentifierChild).InsertElementSorted(actor);
857 0 : (actor)->mState = mozilla::plugins::PPluginIdentifier::__Start;
858 :
859 0 : if ((!(RecvPPluginIdentifierConstructor(actor, aString, aInt, temporary)))) {
860 0 : return MsgProcessingError;
861 : }
862 :
863 0 : return MsgProcessed;
864 : }
865 : case PPluginModule::Msg_ProcessNativeEventsInRPCCall__ID:
866 : {
867 0 : (const_cast<Message&>(__msg)).set_name("PPluginModule::Msg_ProcessNativeEventsInRPCCall");
868 0 : if (mozilla::ipc::LoggingEnabled()) {
869 0 : (static_cast<const PPluginModule::Msg_ProcessNativeEventsInRPCCall*>((&(__msg))))->Log("[PPluginModuleChild] Received ", stderr);
870 : }
871 :
872 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Send, PPluginModule::Msg_ProcessNativeEventsInRPCCall__ID), (&(mState)))))) {
873 0 : NS_WARNING("bad state transition!");
874 : }
875 0 : if ((!(RecvProcessNativeEventsInRPCCall()))) {
876 0 : return MsgProcessingError;
877 : }
878 :
879 0 : return MsgProcessed;
880 : }
881 : case PPluginModule::Msg_SetAudioSessionData__ID:
882 : {
883 0 : (const_cast<Message&>(__msg)).set_name("PPluginModule::Msg_SetAudioSessionData");
884 0 : if (mozilla::ipc::LoggingEnabled()) {
885 0 : (static_cast<const PPluginModule::Msg_SetAudioSessionData*>((&(__msg))))->Log("[PPluginModuleChild] Received ", stderr);
886 : }
887 :
888 0 : void* __iter = 0;
889 : nsID aID;
890 0 : nsString aDisplayName;
891 0 : nsString aIconPath;
892 :
893 0 : if ((!(Read((&(aID)), (&(__msg)), (&(__iter)))))) {
894 0 : FatalError("error deserializing (better message TODO)");
895 0 : return MsgValueError;
896 : }
897 0 : if ((!(Read((&(aDisplayName)), (&(__msg)), (&(__iter)))))) {
898 0 : FatalError("error deserializing (better message TODO)");
899 0 : return MsgValueError;
900 : }
901 0 : if ((!(Read((&(aIconPath)), (&(__msg)), (&(__iter)))))) {
902 0 : FatalError("error deserializing (better message TODO)");
903 0 : return MsgValueError;
904 : }
905 0 : (__msg).EndRead(__iter);
906 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Send, PPluginModule::Msg_SetAudioSessionData__ID), (&(mState)))))) {
907 0 : NS_WARNING("bad state transition!");
908 : }
909 0 : if ((!(RecvSetAudioSessionData(aID, aDisplayName, aIconPath)))) {
910 0 : return MsgProcessingError;
911 : }
912 :
913 0 : return MsgProcessed;
914 : }
915 : case PPluginModule::Msg_SetParentHangTimeout__ID:
916 : {
917 0 : (const_cast<Message&>(__msg)).set_name("PPluginModule::Msg_SetParentHangTimeout");
918 0 : if (mozilla::ipc::LoggingEnabled()) {
919 0 : (static_cast<const PPluginModule::Msg_SetParentHangTimeout*>((&(__msg))))->Log("[PPluginModuleChild] Received ", stderr);
920 : }
921 :
922 0 : void* __iter = 0;
923 : uint32_t seconds;
924 :
925 0 : if ((!(Read((&(seconds)), (&(__msg)), (&(__iter)))))) {
926 0 : FatalError("error deserializing (better message TODO)");
927 0 : return MsgValueError;
928 : }
929 0 : (__msg).EndRead(__iter);
930 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Send, PPluginModule::Msg_SetParentHangTimeout__ID), (&(mState)))))) {
931 0 : NS_WARNING("bad state transition!");
932 : }
933 0 : if ((!(RecvSetParentHangTimeout(seconds)))) {
934 0 : return MsgProcessingError;
935 : }
936 :
937 0 : return MsgProcessed;
938 : }
939 : default:
940 : {
941 0 : return MsgNotKnown;
942 : }
943 : case SHMEM_CREATED_MESSAGE_TYPE:
944 : {
945 : Shmem::id_t id;
946 0 : nsAutoPtr<Shmem::SharedMemory> rawmem(Shmem::OpenExisting(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), __msg, (&(id)), true));
947 0 : if ((!(rawmem))) {
948 0 : return MsgPayloadError;
949 : }
950 0 : (mShmemMap).AddWithID((rawmem).forget(), id);
951 :
952 0 : return MsgProcessed;
953 : }
954 : case SHMEM_DESTROYED_MESSAGE_TYPE:
955 : {
956 : Shmem::id_t id;
957 0 : void* iter = 0;
958 0 : if ((!(IPC::ReadParam((&(__msg)), (&(iter)), (&(id)))))) {
959 0 : return MsgPayloadError;
960 : }
961 0 : (__msg).EndRead(iter);
962 :
963 0 : Shmem::SharedMemory* rawmem = LookupSharedMemory(id);
964 0 : if ((!(rawmem))) {
965 0 : return MsgValueError;
966 : }
967 0 : (mShmemMap).Remove(id);
968 0 : Shmem::Dealloc(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), rawmem);
969 0 : return MsgProcessed;
970 : }
971 : }
972 : }
973 :
974 : PPluginModuleChild::Result
975 0 : PPluginModuleChild::OnMessageReceived(
976 : const Message& __msg,
977 : Message*& __reply)
978 : {
979 0 : int32 __route = (__msg).routing_id();
980 0 : if ((MSG_ROUTING_CONTROL) != (__route)) {
981 0 : ChannelListener* __routed = Lookup(__route);
982 0 : if ((!(__routed))) {
983 0 : return MsgRouteError;
984 : }
985 0 : return (__routed)->OnMessageReceived(__msg, __reply);
986 : }
987 :
988 0 : return MsgNotKnown;
989 : }
990 :
991 : PPluginModuleChild::Result
992 0 : PPluginModuleChild::OnCallReceived(
993 : const Message& __msg,
994 : Message*& __reply)
995 : {
996 0 : int32 __route = (__msg).routing_id();
997 0 : if ((MSG_ROUTING_CONTROL) != (__route)) {
998 0 : ChannelListener* __routed = Lookup(__route);
999 0 : if ((!(__routed))) {
1000 0 : return MsgRouteError;
1001 : }
1002 0 : return (__routed)->OnCallReceived(__msg, __reply);
1003 : }
1004 :
1005 0 : switch ((__msg).type()) {
1006 : case PPluginModule::Msg_NP_GetEntryPoints__ID:
1007 : {
1008 0 : (const_cast<Message&>(__msg)).set_name("PPluginModule::Msg_NP_GetEntryPoints");
1009 0 : if (mozilla::ipc::LoggingEnabled()) {
1010 0 : (static_cast<const PPluginModule::Msg_NP_GetEntryPoints*>((&(__msg))))->Log("[PPluginModuleChild] Received ", stderr);
1011 : }
1012 :
1013 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Send, PPluginModule::Msg_NP_GetEntryPoints__ID), (&(mState)))))) {
1014 0 : NS_WARNING("bad state transition!");
1015 : }
1016 : NPError rv;
1017 0 : int32 __id = MSG_ROUTING_CONTROL;
1018 0 : if ((!(AnswerNP_GetEntryPoints((&(rv)))))) {
1019 0 : return MsgProcessingError;
1020 : }
1021 :
1022 0 : __reply = new PPluginModule::Reply_NP_GetEntryPoints();
1023 :
1024 0 : Write(rv, __reply);
1025 0 : (__reply)->set_routing_id(__id);
1026 0 : (__reply)->set_rpc();
1027 0 : (__reply)->set_reply();
1028 :
1029 0 : if (mozilla::ipc::LoggingEnabled()) {
1030 0 : (static_cast<const PPluginModule::Reply_NP_GetEntryPoints*>(__reply))->Log("[PPluginModuleChild] Sending reply ", stderr);
1031 : }
1032 0 : return MsgProcessed;
1033 : }
1034 : case PPluginModule::Msg_NP_Initialize__ID:
1035 : {
1036 0 : (const_cast<Message&>(__msg)).set_name("PPluginModule::Msg_NP_Initialize");
1037 0 : if (mozilla::ipc::LoggingEnabled()) {
1038 0 : (static_cast<const PPluginModule::Msg_NP_Initialize*>((&(__msg))))->Log("[PPluginModuleChild] Received ", stderr);
1039 : }
1040 :
1041 0 : void* __iter = 0;
1042 : uint32_t aFlags;
1043 :
1044 0 : if ((!(Read((&(aFlags)), (&(__msg)), (&(__iter)))))) {
1045 0 : FatalError("error deserializing (better message TODO)");
1046 0 : return MsgValueError;
1047 : }
1048 0 : (__msg).EndRead(__iter);
1049 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Send, PPluginModule::Msg_NP_Initialize__ID), (&(mState)))))) {
1050 0 : NS_WARNING("bad state transition!");
1051 : }
1052 : NPError rv;
1053 0 : int32 __id = MSG_ROUTING_CONTROL;
1054 0 : if ((!(AnswerNP_Initialize(aFlags, (&(rv)))))) {
1055 0 : return MsgProcessingError;
1056 : }
1057 :
1058 0 : __reply = new PPluginModule::Reply_NP_Initialize();
1059 :
1060 0 : Write(rv, __reply);
1061 0 : (__reply)->set_routing_id(__id);
1062 0 : (__reply)->set_rpc();
1063 0 : (__reply)->set_reply();
1064 :
1065 0 : if (mozilla::ipc::LoggingEnabled()) {
1066 0 : (static_cast<const PPluginModule::Reply_NP_Initialize*>(__reply))->Log("[PPluginModuleChild] Sending reply ", stderr);
1067 : }
1068 0 : return MsgProcessed;
1069 : }
1070 : case PPluginModule::Msg_PPluginInstanceConstructor__ID:
1071 : {
1072 0 : (const_cast<Message&>(__msg)).set_name("PPluginModule::Msg_PPluginInstanceConstructor");
1073 0 : if (mozilla::ipc::LoggingEnabled()) {
1074 0 : (static_cast<const PPluginModule::Msg_PPluginInstanceConstructor*>((&(__msg))))->Log("[PPluginModuleChild] Received ", stderr);
1075 : }
1076 :
1077 0 : void* __iter = 0;
1078 : ActorHandle __handle;
1079 : PPluginInstanceChild* actor;
1080 0 : nsCString aMimeType;
1081 : uint16_t aMode;
1082 0 : InfallibleTArray<nsCString> aNames;
1083 0 : InfallibleTArray<nsCString> aValues;
1084 :
1085 0 : if ((!(Read((&(__handle)), (&(__msg)), (&(__iter)))))) {
1086 0 : FatalError("error deserializing (better message TODO)");
1087 0 : return MsgValueError;
1088 : }
1089 0 : if ((!(Read((&(aMimeType)), (&(__msg)), (&(__iter)))))) {
1090 0 : FatalError("error deserializing (better message TODO)");
1091 0 : return MsgValueError;
1092 : }
1093 0 : if ((!(Read((&(aMode)), (&(__msg)), (&(__iter)))))) {
1094 0 : FatalError("error deserializing (better message TODO)");
1095 0 : return MsgValueError;
1096 : }
1097 0 : if ((!(Read((&(aNames)), (&(__msg)), (&(__iter)))))) {
1098 0 : FatalError("error deserializing (better message TODO)");
1099 0 : return MsgValueError;
1100 : }
1101 0 : if ((!(Read((&(aValues)), (&(__msg)), (&(__iter)))))) {
1102 0 : FatalError("error deserializing (better message TODO)");
1103 0 : return MsgValueError;
1104 : }
1105 0 : (__msg).EndRead(__iter);
1106 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Send, PPluginModule::Msg_PPluginInstanceConstructor__ID), (&(mState)))))) {
1107 0 : NS_WARNING("bad state transition!");
1108 : }
1109 : NPError rv;
1110 0 : actor = AllocPPluginInstance(aMimeType, aMode, aNames, aValues, (&(rv)));
1111 0 : if ((!(actor))) {
1112 0 : return MsgValueError;
1113 : }
1114 0 : (actor)->mId = RegisterID(actor, (__handle).mId);
1115 0 : (actor)->mManager = this;
1116 0 : (actor)->mChannel = (&(mChannel));
1117 0 : (mManagedPPluginInstanceChild).InsertElementSorted(actor);
1118 0 : (actor)->mState = mozilla::plugins::PPluginInstance::__Start;
1119 :
1120 0 : int32 __id = MSG_ROUTING_CONTROL;
1121 0 : if ((!(AnswerPPluginInstanceConstructor(actor, aMimeType, aMode, aNames, aValues, (&(rv)))))) {
1122 0 : return MsgProcessingError;
1123 : }
1124 0 : __reply = new PPluginModule::Reply_PPluginInstanceConstructor();
1125 :
1126 0 : Write(rv, __reply);
1127 0 : (__reply)->set_routing_id(__id);
1128 0 : (__reply)->set_rpc();
1129 0 : (__reply)->set_reply();
1130 :
1131 0 : if (mozilla::ipc::LoggingEnabled()) {
1132 0 : (static_cast<const PPluginModule::Reply_PPluginInstanceConstructor*>(__reply))->Log("[PPluginModuleChild] Sending reply ", stderr);
1133 : }
1134 :
1135 0 : return MsgProcessed;
1136 : }
1137 : case PPluginModule::Msg_NP_Shutdown__ID:
1138 : {
1139 0 : (const_cast<Message&>(__msg)).set_name("PPluginModule::Msg_NP_Shutdown");
1140 0 : if (mozilla::ipc::LoggingEnabled()) {
1141 0 : (static_cast<const PPluginModule::Msg_NP_Shutdown*>((&(__msg))))->Log("[PPluginModuleChild] Received ", stderr);
1142 : }
1143 :
1144 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Send, PPluginModule::Msg_NP_Shutdown__ID), (&(mState)))))) {
1145 0 : NS_WARNING("bad state transition!");
1146 : }
1147 : NPError rv;
1148 0 : int32 __id = MSG_ROUTING_CONTROL;
1149 0 : if ((!(AnswerNP_Shutdown((&(rv)))))) {
1150 0 : return MsgProcessingError;
1151 : }
1152 :
1153 0 : __reply = new PPluginModule::Reply_NP_Shutdown();
1154 :
1155 0 : Write(rv, __reply);
1156 0 : (__reply)->set_routing_id(__id);
1157 0 : (__reply)->set_rpc();
1158 0 : (__reply)->set_reply();
1159 :
1160 0 : if (mozilla::ipc::LoggingEnabled()) {
1161 0 : (static_cast<const PPluginModule::Reply_NP_Shutdown*>(__reply))->Log("[PPluginModuleChild] Sending reply ", stderr);
1162 : }
1163 0 : return MsgProcessed;
1164 : }
1165 : case PPluginModule::Msg_OptionalFunctionsSupported__ID:
1166 : {
1167 0 : (const_cast<Message&>(__msg)).set_name("PPluginModule::Msg_OptionalFunctionsSupported");
1168 0 : if (mozilla::ipc::LoggingEnabled()) {
1169 0 : (static_cast<const PPluginModule::Msg_OptionalFunctionsSupported*>((&(__msg))))->Log("[PPluginModuleChild] Received ", stderr);
1170 : }
1171 :
1172 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Send, PPluginModule::Msg_OptionalFunctionsSupported__ID), (&(mState)))))) {
1173 0 : NS_WARNING("bad state transition!");
1174 : }
1175 : bool aURLRedirectNotify;
1176 : bool aClearSiteData;
1177 : bool aGetSitesWithData;
1178 0 : int32 __id = MSG_ROUTING_CONTROL;
1179 0 : if ((!(AnswerOptionalFunctionsSupported((&(aURLRedirectNotify)), (&(aClearSiteData)), (&(aGetSitesWithData)))))) {
1180 0 : return MsgProcessingError;
1181 : }
1182 :
1183 0 : __reply = new PPluginModule::Reply_OptionalFunctionsSupported();
1184 :
1185 0 : Write(aURLRedirectNotify, __reply);
1186 0 : Write(aClearSiteData, __reply);
1187 0 : Write(aGetSitesWithData, __reply);
1188 0 : (__reply)->set_routing_id(__id);
1189 0 : (__reply)->set_rpc();
1190 0 : (__reply)->set_reply();
1191 :
1192 0 : if (mozilla::ipc::LoggingEnabled()) {
1193 0 : (static_cast<const PPluginModule::Reply_OptionalFunctionsSupported*>(__reply))->Log("[PPluginModuleChild] Sending reply ", stderr);
1194 : }
1195 0 : return MsgProcessed;
1196 : }
1197 : case PPluginModule::Msg_NPP_ClearSiteData__ID:
1198 : {
1199 0 : (const_cast<Message&>(__msg)).set_name("PPluginModule::Msg_NPP_ClearSiteData");
1200 0 : if (mozilla::ipc::LoggingEnabled()) {
1201 0 : (static_cast<const PPluginModule::Msg_NPP_ClearSiteData*>((&(__msg))))->Log("[PPluginModuleChild] Received ", stderr);
1202 : }
1203 :
1204 0 : void* __iter = 0;
1205 0 : nsCString site;
1206 : uint64_t flags;
1207 : uint64_t maxAge;
1208 :
1209 0 : if ((!(Read((&(site)), (&(__msg)), (&(__iter)))))) {
1210 0 : FatalError("error deserializing (better message TODO)");
1211 0 : return MsgValueError;
1212 : }
1213 0 : if ((!(Read((&(flags)), (&(__msg)), (&(__iter)))))) {
1214 0 : FatalError("error deserializing (better message TODO)");
1215 0 : return MsgValueError;
1216 : }
1217 0 : if ((!(Read((&(maxAge)), (&(__msg)), (&(__iter)))))) {
1218 0 : FatalError("error deserializing (better message TODO)");
1219 0 : return MsgValueError;
1220 : }
1221 0 : (__msg).EndRead(__iter);
1222 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Send, PPluginModule::Msg_NPP_ClearSiteData__ID), (&(mState)))))) {
1223 0 : NS_WARNING("bad state transition!");
1224 : }
1225 : NPError rv;
1226 0 : int32 __id = MSG_ROUTING_CONTROL;
1227 0 : if ((!(AnswerNPP_ClearSiteData(site, flags, maxAge, (&(rv)))))) {
1228 0 : return MsgProcessingError;
1229 : }
1230 :
1231 0 : __reply = new PPluginModule::Reply_NPP_ClearSiteData();
1232 :
1233 0 : Write(rv, __reply);
1234 0 : (__reply)->set_routing_id(__id);
1235 0 : (__reply)->set_rpc();
1236 0 : (__reply)->set_reply();
1237 :
1238 0 : if (mozilla::ipc::LoggingEnabled()) {
1239 0 : (static_cast<const PPluginModule::Reply_NPP_ClearSiteData*>(__reply))->Log("[PPluginModuleChild] Sending reply ", stderr);
1240 : }
1241 0 : return MsgProcessed;
1242 : }
1243 : case PPluginModule::Msg_NPP_GetSitesWithData__ID:
1244 : {
1245 0 : (const_cast<Message&>(__msg)).set_name("PPluginModule::Msg_NPP_GetSitesWithData");
1246 0 : if (mozilla::ipc::LoggingEnabled()) {
1247 0 : (static_cast<const PPluginModule::Msg_NPP_GetSitesWithData*>((&(__msg))))->Log("[PPluginModuleChild] Received ", stderr);
1248 : }
1249 :
1250 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Send, PPluginModule::Msg_NPP_GetSitesWithData__ID), (&(mState)))))) {
1251 0 : NS_WARNING("bad state transition!");
1252 : }
1253 0 : InfallibleTArray<nsCString> sites;
1254 0 : int32 __id = MSG_ROUTING_CONTROL;
1255 0 : if ((!(AnswerNPP_GetSitesWithData((&(sites)))))) {
1256 0 : return MsgProcessingError;
1257 : }
1258 :
1259 0 : __reply = new PPluginModule::Reply_NPP_GetSitesWithData();
1260 :
1261 0 : Write(sites, __reply);
1262 0 : (__reply)->set_routing_id(__id);
1263 0 : (__reply)->set_rpc();
1264 0 : (__reply)->set_reply();
1265 :
1266 0 : if (mozilla::ipc::LoggingEnabled()) {
1267 0 : (static_cast<const PPluginModule::Reply_NPP_GetSitesWithData*>(__reply))->Log("[PPluginModuleChild] Sending reply ", stderr);
1268 : }
1269 0 : return MsgProcessed;
1270 : }
1271 : case PPluginModule::Msg_PCrashReporterConstructor__ID:
1272 : {
1273 0 : (const_cast<Message&>(__msg)).set_name("PPluginModule::Msg_PCrashReporterConstructor");
1274 0 : if (mozilla::ipc::LoggingEnabled()) {
1275 0 : (static_cast<const PPluginModule::Msg_PCrashReporterConstructor*>((&(__msg))))->Log("[PPluginModuleChild] Received ", stderr);
1276 : }
1277 :
1278 0 : void* __iter = 0;
1279 : ActorHandle __handle;
1280 : PCrashReporterChild* actor;
1281 :
1282 0 : if ((!(Read((&(__handle)), (&(__msg)), (&(__iter)))))) {
1283 0 : FatalError("error deserializing (better message TODO)");
1284 0 : return MsgValueError;
1285 : }
1286 0 : (__msg).EndRead(__iter);
1287 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Send, PPluginModule::Msg_PCrashReporterConstructor__ID), (&(mState)))))) {
1288 0 : NS_WARNING("bad state transition!");
1289 : }
1290 : NativeThreadId tid;
1291 : PRUint32 processType;
1292 0 : actor = AllocPCrashReporter((&(tid)), (&(processType)));
1293 0 : if ((!(actor))) {
1294 0 : return MsgValueError;
1295 : }
1296 0 : (actor)->mId = RegisterID(actor, (__handle).mId);
1297 0 : (actor)->mManager = this;
1298 0 : (actor)->mChannel = (&(mChannel));
1299 0 : (mManagedPCrashReporterChild).InsertElementSorted(actor);
1300 0 : (actor)->mState = mozilla::dom::PCrashReporter::__Start;
1301 :
1302 0 : int32 __id = MSG_ROUTING_CONTROL;
1303 0 : if ((!(AnswerPCrashReporterConstructor(actor, (&(tid)), (&(processType)))))) {
1304 0 : return MsgProcessingError;
1305 : }
1306 0 : __reply = new PPluginModule::Reply_PCrashReporterConstructor();
1307 :
1308 0 : Write(tid, __reply);
1309 0 : Write(processType, __reply);
1310 0 : (__reply)->set_routing_id(__id);
1311 0 : (__reply)->set_rpc();
1312 0 : (__reply)->set_reply();
1313 :
1314 0 : if (mozilla::ipc::LoggingEnabled()) {
1315 0 : (static_cast<const PPluginModule::Reply_PCrashReporterConstructor*>(__reply))->Log("[PPluginModuleChild] Sending reply ", stderr);
1316 : }
1317 :
1318 0 : return MsgProcessed;
1319 : }
1320 : default:
1321 : {
1322 0 : return MsgNotKnown;
1323 : }
1324 : }
1325 : }
1326 :
1327 : void
1328 0 : PPluginModuleChild::OnProcessingError(Result code)
1329 : {
1330 0 : return ProcessingError(code);
1331 : }
1332 :
1333 : bool
1334 0 : PPluginModuleChild::OnReplyTimeout()
1335 : {
1336 0 : return ShouldContinueFromReplyTimeout();
1337 : }
1338 :
1339 : void
1340 0 : PPluginModuleChild::OnEnteredCxxStack()
1341 : {
1342 0 : return EnteredCxxStack();
1343 : }
1344 :
1345 : void
1346 0 : PPluginModuleChild::OnExitedCxxStack()
1347 : {
1348 0 : return ExitedCxxStack();
1349 : }
1350 :
1351 : void
1352 0 : PPluginModuleChild::OnEnteredCall()
1353 : {
1354 0 : return EnteredCall();
1355 : }
1356 :
1357 : void
1358 0 : PPluginModuleChild::OnExitedCall()
1359 : {
1360 0 : return ExitedCall();
1361 : }
1362 :
1363 : bool
1364 0 : PPluginModuleChild::IsOnCxxStack() const
1365 : {
1366 0 : return (mChannel).IsOnCxxStack();
1367 : }
1368 :
1369 : void
1370 0 : PPluginModuleChild::FlushPendingRPCQueue()
1371 : {
1372 0 : ((this)->mChannel).FlushPendingRPCQueue();
1373 0 : }
1374 :
1375 : void
1376 0 : PPluginModuleChild::OnChannelClose()
1377 : {
1378 0 : DestroySubtree(NormalShutdown);
1379 0 : DeallocSubtree();
1380 0 : DeallocShmems();
1381 0 : }
1382 :
1383 : void
1384 0 : PPluginModuleChild::OnChannelError()
1385 : {
1386 0 : DestroySubtree(AbnormalShutdown);
1387 0 : DeallocSubtree();
1388 0 : DeallocShmems();
1389 0 : }
1390 :
1391 : void
1392 0 : PPluginModuleChild::OnChannelConnected(int32 pid)
1393 : {
1394 0 : }
1395 :
1396 : bool
1397 0 : PPluginModuleChild::AllocShmem(
1398 : size_t aSize,
1399 : Shmem::SharedMemory::SharedMemoryType aType,
1400 : Shmem* aMem)
1401 : {
1402 : Shmem::id_t aId;
1403 0 : nsAutoPtr<Shmem::SharedMemory> rawmem(CreateSharedMemory(aSize, aType, false, (&(aId))));
1404 0 : if ((!(rawmem))) {
1405 0 : return false;
1406 : }
1407 :
1408 0 : (*(aMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), (rawmem).forget(), aId);
1409 0 : return true;
1410 : }
1411 :
1412 : bool
1413 0 : PPluginModuleChild::AllocUnsafeShmem(
1414 : size_t aSize,
1415 : Shmem::SharedMemory::SharedMemoryType aType,
1416 : Shmem* aMem)
1417 : {
1418 : Shmem::id_t aId;
1419 0 : nsAutoPtr<Shmem::SharedMemory> rawmem(CreateSharedMemory(aSize, aType, true, (&(aId))));
1420 0 : if ((!(rawmem))) {
1421 0 : return false;
1422 : }
1423 :
1424 0 : (*(aMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), (rawmem).forget(), aId);
1425 0 : return true;
1426 : }
1427 :
1428 : bool
1429 0 : PPluginModuleChild::AdoptShmem(
1430 : Shmem& aMem,
1431 : Shmem* aOutMem)
1432 : {
1433 0 : Shmem::SharedMemory* rawmem = (aMem).Segment(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
1434 0 : if (((!(rawmem))) || (IsTrackingSharedMemory(rawmem))) {
1435 0 : NS_RUNTIMEABORT("bad Shmem");
1436 : }
1437 :
1438 : Shmem::id_t aId;
1439 0 : if ((!(AdoptSharedMemory(rawmem, (&(aId)))))) {
1440 0 : return false;
1441 : }
1442 :
1443 0 : (*(aOutMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), rawmem, aId);
1444 0 : return true;
1445 : }
1446 :
1447 : bool
1448 0 : PPluginModuleChild::DeallocShmem(Shmem& aMem)
1449 : {
1450 0 : bool ok = DestroySharedMemory(aMem);
1451 0 : (aMem).forget(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
1452 0 : return ok;
1453 : }
1454 :
1455 : void
1456 0 : PPluginModuleChild::ProcessNativeEventsInRPCCall()
1457 : {
1458 : #ifdef OS_WIN
1459 : (mChannel).ProcessNativeEventsInRPCCall();
1460 : #else
1461 0 : NS_RUNTIMEABORT("This method is Windows-only");
1462 : #endif
1463 0 : }
1464 :
1465 : void
1466 0 : PPluginModuleChild::FatalError(const char* const msg) const
1467 : {
1468 : // Virtual method to prevent inlining.
1469 : // This give us better error reporting.
1470 : // See bug 589371
1471 :
1472 0 : NS_ERROR("IPDL error:");
1473 0 : NS_ERROR(msg);
1474 :
1475 0 : NS_RUNTIMEABORT("[PPluginModuleChild] abort()ing as a result");
1476 0 : }
1477 :
1478 : void
1479 0 : PPluginModuleChild::DestroySubtree(ActorDestroyReason why)
1480 : {
1481 0 : ActorDestroyReason subtreewhy = (((why) == (Deletion)) || ((why) == (FailedConstructor)) ? AncestorDeletion : why);
1482 :
1483 : {
1484 : // Recursively shutting down PPluginInstance kids
1485 0 : InfallibleTArray<PPluginInstanceChild*> kids = mManagedPPluginInstanceChild;
1486 0 : for (uint32 i = 0; (i) < ((kids).Length()); (++(i))) {
1487 0 : (kids[i])->DestroySubtree(subtreewhy);
1488 : }
1489 : }
1490 : {
1491 : // Recursively shutting down PPluginIdentifier kids
1492 0 : InfallibleTArray<PPluginIdentifierChild*> kids = mManagedPPluginIdentifierChild;
1493 0 : for (uint32 i = 0; (i) < ((kids).Length()); (++(i))) {
1494 0 : (kids[i])->DestroySubtree(subtreewhy);
1495 : }
1496 : }
1497 : {
1498 : // Recursively shutting down PCrashReporter kids
1499 0 : InfallibleTArray<PCrashReporterChild*> kids = mManagedPCrashReporterChild;
1500 0 : for (uint32 i = 0; (i) < ((kids).Length()); (++(i))) {
1501 0 : (kids[i])->DestroySubtree(subtreewhy);
1502 : }
1503 : }
1504 :
1505 : // Finally, destroy "us".
1506 0 : ActorDestroy(why);
1507 0 : }
1508 :
1509 : void
1510 0 : PPluginModuleChild::DeallocSubtree()
1511 : {
1512 : {
1513 : // Recursively deleting PPluginInstance kids
1514 0 : InfallibleTArray<PPluginInstanceChild*>& kids = mManagedPPluginInstanceChild;
1515 0 : for (uint32 i = 0; (i) < ((kids).Length()); (++(i))) {
1516 0 : (kids[i])->DeallocSubtree();
1517 : }
1518 :
1519 0 : for (uint32 i = 0; (i) < ((kids).Length()); (++(i))) {
1520 0 : DeallocPPluginInstance(kids[i]);
1521 : }
1522 0 : (mManagedPPluginInstanceChild).Clear();
1523 : }
1524 : {
1525 : // Recursively deleting PPluginIdentifier kids
1526 0 : InfallibleTArray<PPluginIdentifierChild*>& kids = mManagedPPluginIdentifierChild;
1527 0 : for (uint32 i = 0; (i) < ((kids).Length()); (++(i))) {
1528 0 : (kids[i])->DeallocSubtree();
1529 : }
1530 :
1531 0 : for (uint32 i = 0; (i) < ((kids).Length()); (++(i))) {
1532 0 : DeallocPPluginIdentifier(kids[i]);
1533 : }
1534 0 : (mManagedPPluginIdentifierChild).Clear();
1535 : }
1536 : {
1537 : // Recursively deleting PCrashReporter kids
1538 0 : InfallibleTArray<PCrashReporterChild*>& kids = mManagedPCrashReporterChild;
1539 0 : for (uint32 i = 0; (i) < ((kids).Length()); (++(i))) {
1540 0 : (kids[i])->DeallocSubtree();
1541 : }
1542 :
1543 0 : for (uint32 i = 0; (i) < ((kids).Length()); (++(i))) {
1544 0 : DeallocPCrashReporter(kids[i]);
1545 : }
1546 0 : (mManagedPCrashReporterChild).Clear();
1547 : }
1548 0 : }
1549 :
1550 : void
1551 0 : PPluginModuleChild::DeallocShmems()
1552 : {
1553 0 : for (IDMap<SharedMemory>::const_iterator cit = (mShmemMap).begin(); (cit) != ((mShmemMap).end()); (++(cit))) {
1554 0 : Shmem::Dealloc(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), (cit)->second);
1555 : }
1556 0 : (mShmemMap).Clear();
1557 0 : }
1558 :
1559 : void
1560 0 : PPluginModuleChild::Write(
1561 : PPluginScriptableObjectChild* __v,
1562 : Message* __msg,
1563 : bool __nullable)
1564 : {
1565 : int32 id;
1566 0 : if ((!(__v))) {
1567 0 : if ((!(__nullable))) {
1568 0 : NS_RUNTIMEABORT("NULL actor value passed to non-nullable param");
1569 : }
1570 0 : id = 0;
1571 : }
1572 : else {
1573 0 : id = (__v)->mId;
1574 0 : if ((1) == (id)) {
1575 0 : NS_RUNTIMEABORT("actor has been |delete|d");
1576 : }
1577 : }
1578 :
1579 0 : Write(id, __msg);
1580 0 : }
1581 :
1582 : bool
1583 0 : PPluginModuleChild::Read(
1584 : PPluginScriptableObjectChild** __v,
1585 : const Message* __msg,
1586 : void** __iter,
1587 : bool __nullable)
1588 : {
1589 : int32 id;
1590 0 : if ((!(Read((&(id)), __msg, __iter)))) {
1591 0 : return false;
1592 : }
1593 0 : if (((1) == (id)) || (((0) == (id)) && ((!(__nullable))))) {
1594 0 : return false;
1595 : }
1596 :
1597 0 : if ((0) == (id)) {
1598 0 : (*(__v)) = 0;
1599 : }
1600 : else {
1601 0 : (*(__v)) = static_cast<PPluginScriptableObjectChild*>(Lookup(id));
1602 0 : if ((!((*(__v))))) {
1603 0 : return false;
1604 : }
1605 : }
1606 0 : return true;
1607 : }
1608 :
1609 : void
1610 0 : PPluginModuleChild::Write(
1611 : PPluginInstanceChild* __v,
1612 : Message* __msg,
1613 : bool __nullable)
1614 : {
1615 : int32 id;
1616 0 : if ((!(__v))) {
1617 0 : if ((!(__nullable))) {
1618 0 : NS_RUNTIMEABORT("NULL actor value passed to non-nullable param");
1619 : }
1620 0 : id = 0;
1621 : }
1622 : else {
1623 0 : id = (__v)->mId;
1624 0 : if ((1) == (id)) {
1625 0 : NS_RUNTIMEABORT("actor has been |delete|d");
1626 : }
1627 : }
1628 :
1629 0 : Write(id, __msg);
1630 0 : }
1631 :
1632 : bool
1633 0 : PPluginModuleChild::Read(
1634 : PPluginInstanceChild** __v,
1635 : const Message* __msg,
1636 : void** __iter,
1637 : bool __nullable)
1638 : {
1639 : int32 id;
1640 0 : if ((!(Read((&(id)), __msg, __iter)))) {
1641 0 : return false;
1642 : }
1643 0 : if (((1) == (id)) || (((0) == (id)) && ((!(__nullable))))) {
1644 0 : return false;
1645 : }
1646 :
1647 0 : if ((0) == (id)) {
1648 0 : (*(__v)) = 0;
1649 : }
1650 : else {
1651 0 : (*(__v)) = static_cast<PPluginInstanceChild*>(Lookup(id));
1652 0 : if ((!((*(__v))))) {
1653 0 : return false;
1654 : }
1655 : }
1656 0 : return true;
1657 : }
1658 :
1659 : void
1660 0 : PPluginModuleChild::Write(
1661 : PCrashReporterChild* __v,
1662 : Message* __msg,
1663 : bool __nullable)
1664 : {
1665 : int32 id;
1666 0 : if ((!(__v))) {
1667 0 : if ((!(__nullable))) {
1668 0 : NS_RUNTIMEABORT("NULL actor value passed to non-nullable param");
1669 : }
1670 0 : id = 0;
1671 : }
1672 : else {
1673 0 : id = (__v)->mId;
1674 0 : if ((1) == (id)) {
1675 0 : NS_RUNTIMEABORT("actor has been |delete|d");
1676 : }
1677 : }
1678 :
1679 0 : Write(id, __msg);
1680 0 : }
1681 :
1682 : bool
1683 0 : PPluginModuleChild::Read(
1684 : PCrashReporterChild** __v,
1685 : const Message* __msg,
1686 : void** __iter,
1687 : bool __nullable)
1688 : {
1689 : int32 id;
1690 0 : if ((!(Read((&(id)), __msg, __iter)))) {
1691 0 : return false;
1692 : }
1693 0 : if (((1) == (id)) || (((0) == (id)) && ((!(__nullable))))) {
1694 0 : return false;
1695 : }
1696 :
1697 0 : if ((0) == (id)) {
1698 0 : (*(__v)) = 0;
1699 : }
1700 : else {
1701 0 : (*(__v)) = static_cast<PCrashReporterChild*>(Lookup(id));
1702 0 : if ((!((*(__v))))) {
1703 0 : return false;
1704 : }
1705 : }
1706 0 : return true;
1707 : }
1708 :
1709 : void
1710 0 : PPluginModuleChild::Write(
1711 : PPluginIdentifierChild* __v,
1712 : Message* __msg,
1713 : bool __nullable)
1714 : {
1715 : int32 id;
1716 0 : if ((!(__v))) {
1717 0 : if ((!(__nullable))) {
1718 0 : NS_RUNTIMEABORT("NULL actor value passed to non-nullable param");
1719 : }
1720 0 : id = 0;
1721 : }
1722 : else {
1723 0 : id = (__v)->mId;
1724 0 : if ((1) == (id)) {
1725 0 : NS_RUNTIMEABORT("actor has been |delete|d");
1726 : }
1727 : }
1728 :
1729 0 : Write(id, __msg);
1730 0 : }
1731 :
1732 : bool
1733 0 : PPluginModuleChild::Read(
1734 : PPluginIdentifierChild** __v,
1735 : const Message* __msg,
1736 : void** __iter,
1737 : bool __nullable)
1738 : {
1739 : int32 id;
1740 0 : if ((!(Read((&(id)), __msg, __iter)))) {
1741 0 : return false;
1742 : }
1743 0 : if (((1) == (id)) || (((0) == (id)) && ((!(__nullable))))) {
1744 0 : return false;
1745 : }
1746 :
1747 0 : if ((0) == (id)) {
1748 0 : (*(__v)) = 0;
1749 : }
1750 : else {
1751 0 : (*(__v)) = static_cast<PPluginIdentifierChild*>(Lookup(id));
1752 0 : if ((!((*(__v))))) {
1753 0 : return false;
1754 : }
1755 : }
1756 0 : return true;
1757 : }
1758 :
1759 :
1760 :
1761 : } // namespace plugins
1762 : } // namespace mozilla
|