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