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 : default:
1118 : {
1119 0 : return MsgNotKnown;
1120 : }
1121 : case SHMEM_CREATED_MESSAGE_TYPE:
1122 : {
1123 : Shmem::id_t id;
1124 0 : nsAutoPtr<Shmem::SharedMemory> rawmem(Shmem::OpenExisting(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), __msg, (&(id)), true));
1125 0 : if ((!(rawmem))) {
1126 0 : return MsgPayloadError;
1127 : }
1128 0 : (mShmemMap).AddWithID((rawmem).forget(), id);
1129 :
1130 0 : return MsgProcessed;
1131 : }
1132 : case SHMEM_DESTROYED_MESSAGE_TYPE:
1133 : {
1134 : Shmem::id_t id;
1135 0 : void* iter = 0;
1136 0 : if ((!(IPC::ReadParam((&(__msg)), (&(iter)), (&(id)))))) {
1137 0 : return MsgPayloadError;
1138 : }
1139 0 : (__msg).EndRead(iter);
1140 :
1141 0 : Shmem::SharedMemory* rawmem = LookupSharedMemory(id);
1142 0 : if ((!(rawmem))) {
1143 0 : return MsgValueError;
1144 : }
1145 0 : (mShmemMap).Remove(id);
1146 0 : Shmem::Dealloc(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), rawmem);
1147 0 : return MsgProcessed;
1148 : }
1149 : }
1150 : }
1151 :
1152 : PPluginModuleParent::Result
1153 0 : PPluginModuleParent::OnMessageReceived(
1154 : const Message& __msg,
1155 : Message*& __reply)
1156 : {
1157 0 : int32 __route = (__msg).routing_id();
1158 0 : if ((MSG_ROUTING_CONTROL) != (__route)) {
1159 0 : ChannelListener* __routed = Lookup(__route);
1160 0 : if ((!(__routed))) {
1161 0 : return MsgRouteError;
1162 : }
1163 0 : return (__routed)->OnMessageReceived(__msg, __reply);
1164 : }
1165 :
1166 0 : switch ((__msg).type()) {
1167 : case PPluginModule::Msg_GetNativeCursorsSupported__ID:
1168 : {
1169 0 : (const_cast<Message&>(__msg)).set_name("PPluginModule::Msg_GetNativeCursorsSupported");
1170 0 : if (mozilla::ipc::LoggingEnabled()) {
1171 0 : (static_cast<const PPluginModule::Msg_GetNativeCursorsSupported*>((&(__msg))))->Log("[PPluginModuleParent] Received ", stderr);
1172 : }
1173 :
1174 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Recv, PPluginModule::Msg_GetNativeCursorsSupported__ID), (&(mState)))))) {
1175 0 : NS_WARNING("bad state transition!");
1176 : }
1177 : bool supported;
1178 0 : int32 __id = MSG_ROUTING_CONTROL;
1179 0 : if ((!(RecvGetNativeCursorsSupported((&(supported)))))) {
1180 0 : return MsgProcessingError;
1181 : }
1182 :
1183 0 : __reply = new PPluginModule::Reply_GetNativeCursorsSupported();
1184 :
1185 0 : Write(supported, __reply);
1186 0 : (__reply)->set_routing_id(__id);
1187 0 : (__reply)->set_sync();
1188 0 : (__reply)->set_reply();
1189 :
1190 0 : if (mozilla::ipc::LoggingEnabled()) {
1191 0 : (static_cast<const PPluginModule::Reply_GetNativeCursorsSupported*>(__reply))->Log("[PPluginModuleParent] Sending reply ", stderr);
1192 : }
1193 0 : return MsgProcessed;
1194 : }
1195 : case PPluginModule::Msg_NPN_SetException__ID:
1196 : {
1197 0 : (const_cast<Message&>(__msg)).set_name("PPluginModule::Msg_NPN_SetException");
1198 0 : if (mozilla::ipc::LoggingEnabled()) {
1199 0 : (static_cast<const PPluginModule::Msg_NPN_SetException*>((&(__msg))))->Log("[PPluginModuleParent] Received ", stderr);
1200 : }
1201 :
1202 0 : void* __iter = 0;
1203 : PPluginScriptableObjectParent* actor;
1204 0 : nsCString message;
1205 :
1206 0 : if ((!(Read((&(actor)), (&(__msg)), (&(__iter)), true)))) {
1207 0 : FatalError("error deserializing (better message TODO)");
1208 0 : return MsgValueError;
1209 : }
1210 0 : if ((!(Read((&(message)), (&(__msg)), (&(__iter)))))) {
1211 0 : FatalError("error deserializing (better message TODO)");
1212 0 : return MsgValueError;
1213 : }
1214 0 : (__msg).EndRead(__iter);
1215 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Recv, PPluginModule::Msg_NPN_SetException__ID), (&(mState)))))) {
1216 0 : NS_WARNING("bad state transition!");
1217 : }
1218 0 : int32 __id = MSG_ROUTING_CONTROL;
1219 0 : if ((!(RecvNPN_SetException(actor, message)))) {
1220 0 : return MsgProcessingError;
1221 : }
1222 :
1223 0 : __reply = new PPluginModule::Reply_NPN_SetException();
1224 :
1225 0 : (__reply)->set_routing_id(__id);
1226 0 : (__reply)->set_sync();
1227 0 : (__reply)->set_reply();
1228 :
1229 0 : if (mozilla::ipc::LoggingEnabled()) {
1230 0 : (static_cast<const PPluginModule::Reply_NPN_SetException*>(__reply))->Log("[PPluginModuleParent] Sending reply ", stderr);
1231 : }
1232 0 : return MsgProcessed;
1233 : }
1234 : default:
1235 : {
1236 0 : return MsgNotKnown;
1237 : }
1238 : }
1239 : }
1240 :
1241 : PPluginModuleParent::Result
1242 0 : PPluginModuleParent::OnCallReceived(
1243 : const Message& __msg,
1244 : Message*& __reply)
1245 : {
1246 0 : int32 __route = (__msg).routing_id();
1247 0 : if ((MSG_ROUTING_CONTROL) != (__route)) {
1248 0 : ChannelListener* __routed = Lookup(__route);
1249 0 : if ((!(__routed))) {
1250 0 : return MsgRouteError;
1251 : }
1252 0 : return (__routed)->OnCallReceived(__msg, __reply);
1253 : }
1254 :
1255 0 : switch ((__msg).type()) {
1256 : case PPluginModule::Msg_NPN_UserAgent__ID:
1257 : {
1258 0 : (const_cast<Message&>(__msg)).set_name("PPluginModule::Msg_NPN_UserAgent");
1259 0 : if (mozilla::ipc::LoggingEnabled()) {
1260 0 : (static_cast<const PPluginModule::Msg_NPN_UserAgent*>((&(__msg))))->Log("[PPluginModuleParent] Received ", stderr);
1261 : }
1262 :
1263 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Recv, PPluginModule::Msg_NPN_UserAgent__ID), (&(mState)))))) {
1264 0 : NS_WARNING("bad state transition!");
1265 : }
1266 0 : nsCString userAgent;
1267 0 : int32 __id = MSG_ROUTING_CONTROL;
1268 0 : if ((!(AnswerNPN_UserAgent((&(userAgent)))))) {
1269 0 : return MsgProcessingError;
1270 : }
1271 :
1272 0 : __reply = new PPluginModule::Reply_NPN_UserAgent();
1273 :
1274 0 : Write(userAgent, __reply);
1275 0 : (__reply)->set_routing_id(__id);
1276 0 : (__reply)->set_rpc();
1277 0 : (__reply)->set_reply();
1278 :
1279 0 : if (mozilla::ipc::LoggingEnabled()) {
1280 0 : (static_cast<const PPluginModule::Reply_NPN_UserAgent*>(__reply))->Log("[PPluginModuleParent] Sending reply ", stderr);
1281 : }
1282 0 : return MsgProcessed;
1283 : }
1284 : case PPluginModule::Msg_NPN_GetValue_WithBoolReturn__ID:
1285 : {
1286 0 : (const_cast<Message&>(__msg)).set_name("PPluginModule::Msg_NPN_GetValue_WithBoolReturn");
1287 0 : if (mozilla::ipc::LoggingEnabled()) {
1288 0 : (static_cast<const PPluginModule::Msg_NPN_GetValue_WithBoolReturn*>((&(__msg))))->Log("[PPluginModuleParent] Received ", stderr);
1289 : }
1290 :
1291 0 : void* __iter = 0;
1292 : NPNVariable aVariable;
1293 :
1294 0 : if ((!(Read((&(aVariable)), (&(__msg)), (&(__iter)))))) {
1295 0 : FatalError("error deserializing (better message TODO)");
1296 0 : return MsgValueError;
1297 : }
1298 0 : (__msg).EndRead(__iter);
1299 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Recv, PPluginModule::Msg_NPN_GetValue_WithBoolReturn__ID), (&(mState)))))) {
1300 0 : NS_WARNING("bad state transition!");
1301 : }
1302 : NPError aError;
1303 : bool aBoolVal;
1304 0 : int32 __id = MSG_ROUTING_CONTROL;
1305 0 : if ((!(AnswerNPN_GetValue_WithBoolReturn(aVariable, (&(aError)), (&(aBoolVal)))))) {
1306 0 : return MsgProcessingError;
1307 : }
1308 :
1309 0 : __reply = new PPluginModule::Reply_NPN_GetValue_WithBoolReturn();
1310 :
1311 0 : Write(aError, __reply);
1312 0 : Write(aBoolVal, __reply);
1313 0 : (__reply)->set_routing_id(__id);
1314 0 : (__reply)->set_rpc();
1315 0 : (__reply)->set_reply();
1316 :
1317 0 : if (mozilla::ipc::LoggingEnabled()) {
1318 0 : (static_cast<const PPluginModule::Reply_NPN_GetValue_WithBoolReturn*>(__reply))->Log("[PPluginModuleParent] Sending reply ", stderr);
1319 : }
1320 0 : return MsgProcessed;
1321 : }
1322 : case PPluginModule::Msg_ProcessSomeEvents__ID:
1323 : {
1324 0 : (const_cast<Message&>(__msg)).set_name("PPluginModule::Msg_ProcessSomeEvents");
1325 0 : if (mozilla::ipc::LoggingEnabled()) {
1326 0 : (static_cast<const PPluginModule::Msg_ProcessSomeEvents*>((&(__msg))))->Log("[PPluginModuleParent] Received ", stderr);
1327 : }
1328 :
1329 0 : if ((!(PPluginModule::Transition(mState, Trigger(Trigger::Recv, PPluginModule::Msg_ProcessSomeEvents__ID), (&(mState)))))) {
1330 0 : NS_WARNING("bad state transition!");
1331 : }
1332 0 : int32 __id = MSG_ROUTING_CONTROL;
1333 0 : if ((!(AnswerProcessSomeEvents()))) {
1334 0 : return MsgProcessingError;
1335 : }
1336 :
1337 0 : __reply = new PPluginModule::Reply_ProcessSomeEvents();
1338 :
1339 0 : (__reply)->set_routing_id(__id);
1340 0 : (__reply)->set_rpc();
1341 0 : (__reply)->set_reply();
1342 :
1343 0 : if (mozilla::ipc::LoggingEnabled()) {
1344 0 : (static_cast<const PPluginModule::Reply_ProcessSomeEvents*>(__reply))->Log("[PPluginModuleParent] Sending reply ", stderr);
1345 : }
1346 0 : return MsgProcessed;
1347 : }
1348 : default:
1349 : {
1350 0 : return MsgNotKnown;
1351 : }
1352 : }
1353 : }
1354 :
1355 : void
1356 0 : PPluginModuleParent::OnProcessingError(Result code)
1357 : {
1358 0 : return ProcessingError(code);
1359 : }
1360 :
1361 : bool
1362 0 : PPluginModuleParent::OnReplyTimeout()
1363 : {
1364 0 : return ShouldContinueFromReplyTimeout();
1365 : }
1366 :
1367 : void
1368 0 : PPluginModuleParent::OnEnteredCxxStack()
1369 : {
1370 0 : return EnteredCxxStack();
1371 : }
1372 :
1373 : void
1374 0 : PPluginModuleParent::OnExitedCxxStack()
1375 : {
1376 0 : return ExitedCxxStack();
1377 : }
1378 :
1379 : void
1380 0 : PPluginModuleParent::OnEnteredCall()
1381 : {
1382 0 : return EnteredCall();
1383 : }
1384 :
1385 : void
1386 0 : PPluginModuleParent::OnExitedCall()
1387 : {
1388 0 : return ExitedCall();
1389 : }
1390 :
1391 : bool
1392 0 : PPluginModuleParent::IsOnCxxStack() const
1393 : {
1394 0 : return (mChannel).IsOnCxxStack();
1395 : }
1396 :
1397 : void
1398 0 : PPluginModuleParent::FlushPendingRPCQueue()
1399 : {
1400 0 : ((this)->mChannel).FlushPendingRPCQueue();
1401 0 : }
1402 :
1403 : void
1404 0 : PPluginModuleParent::OnChannelClose()
1405 : {
1406 0 : DestroySubtree(NormalShutdown);
1407 0 : DeallocSubtree();
1408 0 : DeallocShmems();
1409 0 : }
1410 :
1411 : void
1412 0 : PPluginModuleParent::OnChannelError()
1413 : {
1414 0 : DestroySubtree(AbnormalShutdown);
1415 0 : DeallocSubtree();
1416 0 : DeallocShmems();
1417 0 : }
1418 :
1419 : void
1420 0 : PPluginModuleParent::OnChannelConnected(int32 pid)
1421 : {
1422 0 : }
1423 :
1424 : bool
1425 0 : PPluginModuleParent::AllocShmem(
1426 : size_t aSize,
1427 : Shmem::SharedMemory::SharedMemoryType aType,
1428 : Shmem* aMem)
1429 : {
1430 : Shmem::id_t aId;
1431 0 : nsAutoPtr<Shmem::SharedMemory> rawmem(CreateSharedMemory(aSize, aType, false, (&(aId))));
1432 0 : if ((!(rawmem))) {
1433 0 : return false;
1434 : }
1435 :
1436 0 : (*(aMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), (rawmem).forget(), aId);
1437 0 : return true;
1438 : }
1439 :
1440 : bool
1441 0 : PPluginModuleParent::AllocUnsafeShmem(
1442 : size_t aSize,
1443 : Shmem::SharedMemory::SharedMemoryType aType,
1444 : Shmem* aMem)
1445 : {
1446 : Shmem::id_t aId;
1447 0 : nsAutoPtr<Shmem::SharedMemory> rawmem(CreateSharedMemory(aSize, aType, true, (&(aId))));
1448 0 : if ((!(rawmem))) {
1449 0 : return false;
1450 : }
1451 :
1452 0 : (*(aMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), (rawmem).forget(), aId);
1453 0 : return true;
1454 : }
1455 :
1456 : bool
1457 0 : PPluginModuleParent::AdoptShmem(
1458 : Shmem& aMem,
1459 : Shmem* aOutMem)
1460 : {
1461 0 : Shmem::SharedMemory* rawmem = (aMem).Segment(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
1462 0 : if (((!(rawmem))) || (IsTrackingSharedMemory(rawmem))) {
1463 0 : NS_RUNTIMEABORT("bad Shmem");
1464 : }
1465 :
1466 : Shmem::id_t aId;
1467 0 : if ((!(AdoptSharedMemory(rawmem, (&(aId)))))) {
1468 0 : return false;
1469 : }
1470 :
1471 0 : (*(aOutMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), rawmem, aId);
1472 0 : return true;
1473 : }
1474 :
1475 : bool
1476 0 : PPluginModuleParent::DeallocShmem(Shmem& aMem)
1477 : {
1478 0 : bool ok = DestroySharedMemory(aMem);
1479 0 : (aMem).forget(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
1480 0 : return ok;
1481 : }
1482 :
1483 : void
1484 0 : PPluginModuleParent::ProcessNativeEventsInRPCCall()
1485 : {
1486 : #ifdef OS_WIN
1487 : (mChannel).ProcessNativeEventsInRPCCall();
1488 : #else
1489 0 : NS_RUNTIMEABORT("This method is Windows-only");
1490 : #endif
1491 0 : }
1492 :
1493 : void
1494 0 : PPluginModuleParent::SetOtherProcess(ProcessHandle aOtherProcess)
1495 : {
1496 0 : mOtherProcess = aOtherProcess;
1497 0 : }
1498 :
1499 : base::ProcessId
1500 0 : PPluginModuleParent::OtherSidePID() const
1501 : {
1502 0 : return base::GetProcId(mOtherProcess);
1503 : }
1504 :
1505 : bool
1506 0 : PPluginModuleParent::TakeMinidump(nsILocalFile** aDump) const
1507 : {
1508 : #ifdef MOZ_CRASHREPORTER
1509 0 : return XRE_TakeMinidumpForChild(OtherSidePID(), aDump);
1510 : #else
1511 : return false;
1512 : #endif
1513 : }
1514 :
1515 : bool
1516 0 : PPluginModuleParent::BlockChild()
1517 : {
1518 0 : return (mChannel).BlockChild();
1519 : }
1520 :
1521 : bool
1522 0 : PPluginModuleParent::UnblockChild()
1523 : {
1524 0 : return (mChannel).UnblockChild();
1525 : }
1526 :
1527 : void
1528 0 : PPluginModuleParent::FatalError(const char* const msg) const
1529 : {
1530 : // Virtual method to prevent inlining.
1531 : // This give us better error reporting.
1532 : // See bug 589371
1533 :
1534 0 : NS_ERROR("IPDL error:");
1535 0 : NS_ERROR(msg);
1536 :
1537 0 : NS_ERROR("[PPluginModuleParent] killing child side as a result");
1538 :
1539 0 : if ((!(base::KillProcess(OtherProcess(), base::PROCESS_END_KILLED_BY_USER, false)))) {
1540 0 : NS_ERROR(" may have failed to kill child!");
1541 : }
1542 0 : }
1543 :
1544 : void
1545 0 : PPluginModuleParent::DestroySubtree(ActorDestroyReason why)
1546 : {
1547 0 : ActorDestroyReason subtreewhy = (((why) == (Deletion)) || ((why) == (FailedConstructor)) ? AncestorDeletion : why);
1548 :
1549 : {
1550 : // Recursively shutting down PPluginInstance kids
1551 0 : InfallibleTArray<PPluginInstanceParent*> kids = mManagedPPluginInstanceParent;
1552 0 : for (uint32 i = 0; (i) < ((kids).Length()); (++(i))) {
1553 0 : (kids[i])->DestroySubtree(subtreewhy);
1554 : }
1555 : }
1556 : {
1557 : // Recursively shutting down PPluginIdentifier kids
1558 0 : InfallibleTArray<PPluginIdentifierParent*> kids = mManagedPPluginIdentifierParent;
1559 0 : for (uint32 i = 0; (i) < ((kids).Length()); (++(i))) {
1560 0 : (kids[i])->DestroySubtree(subtreewhy);
1561 : }
1562 : }
1563 : {
1564 : // Recursively shutting down PCrashReporter kids
1565 0 : InfallibleTArray<PCrashReporterParent*> kids = mManagedPCrashReporterParent;
1566 0 : for (uint32 i = 0; (i) < ((kids).Length()); (++(i))) {
1567 0 : (kids[i])->DestroySubtree(subtreewhy);
1568 : }
1569 : }
1570 :
1571 : // Finally, destroy "us".
1572 0 : ActorDestroy(why);
1573 0 : }
1574 :
1575 : void
1576 0 : PPluginModuleParent::DeallocSubtree()
1577 : {
1578 : {
1579 : // Recursively deleting PPluginInstance kids
1580 0 : InfallibleTArray<PPluginInstanceParent*>& kids = mManagedPPluginInstanceParent;
1581 0 : for (uint32 i = 0; (i) < ((kids).Length()); (++(i))) {
1582 0 : (kids[i])->DeallocSubtree();
1583 : }
1584 :
1585 0 : for (uint32 i = 0; (i) < ((kids).Length()); (++(i))) {
1586 0 : DeallocPPluginInstance(kids[i]);
1587 : }
1588 0 : (mManagedPPluginInstanceParent).Clear();
1589 : }
1590 : {
1591 : // Recursively deleting PPluginIdentifier kids
1592 0 : InfallibleTArray<PPluginIdentifierParent*>& kids = mManagedPPluginIdentifierParent;
1593 0 : for (uint32 i = 0; (i) < ((kids).Length()); (++(i))) {
1594 0 : (kids[i])->DeallocSubtree();
1595 : }
1596 :
1597 0 : for (uint32 i = 0; (i) < ((kids).Length()); (++(i))) {
1598 0 : DeallocPPluginIdentifier(kids[i]);
1599 : }
1600 0 : (mManagedPPluginIdentifierParent).Clear();
1601 : }
1602 : {
1603 : // Recursively deleting PCrashReporter kids
1604 0 : InfallibleTArray<PCrashReporterParent*>& kids = mManagedPCrashReporterParent;
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 : DeallocPCrashReporter(kids[i]);
1611 : }
1612 0 : (mManagedPCrashReporterParent).Clear();
1613 : }
1614 0 : }
1615 :
1616 : void
1617 0 : PPluginModuleParent::DeallocShmems()
1618 : {
1619 0 : for (IDMap<SharedMemory>::const_iterator cit = (mShmemMap).begin(); (cit) != ((mShmemMap).end()); (++(cit))) {
1620 0 : Shmem::Dealloc(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), (cit)->second);
1621 : }
1622 0 : (mShmemMap).Clear();
1623 0 : }
1624 :
1625 : void
1626 0 : PPluginModuleParent::Write(
1627 : PPluginScriptableObjectParent* __v,
1628 : Message* __msg,
1629 : bool __nullable)
1630 : {
1631 : int32 id;
1632 0 : if ((!(__v))) {
1633 0 : if ((!(__nullable))) {
1634 0 : NS_RUNTIMEABORT("NULL actor value passed to non-nullable param");
1635 : }
1636 0 : id = 0;
1637 : }
1638 : else {
1639 0 : id = (__v)->mId;
1640 0 : if ((1) == (id)) {
1641 0 : NS_RUNTIMEABORT("actor has been |delete|d");
1642 : }
1643 : }
1644 :
1645 0 : Write(id, __msg);
1646 0 : }
1647 :
1648 : bool
1649 0 : PPluginModuleParent::Read(
1650 : PPluginScriptableObjectParent** __v,
1651 : const Message* __msg,
1652 : void** __iter,
1653 : bool __nullable)
1654 : {
1655 : int32 id;
1656 0 : if ((!(Read((&(id)), __msg, __iter)))) {
1657 0 : return false;
1658 : }
1659 0 : if (((1) == (id)) || (((0) == (id)) && ((!(__nullable))))) {
1660 0 : return false;
1661 : }
1662 :
1663 0 : if ((0) == (id)) {
1664 0 : (*(__v)) = 0;
1665 : }
1666 : else {
1667 0 : (*(__v)) = static_cast<PPluginScriptableObjectParent*>(Lookup(id));
1668 0 : if ((!((*(__v))))) {
1669 0 : return false;
1670 : }
1671 : }
1672 0 : return true;
1673 : }
1674 :
1675 : void
1676 0 : PPluginModuleParent::Write(
1677 : PPluginInstanceParent* __v,
1678 : Message* __msg,
1679 : bool __nullable)
1680 : {
1681 : int32 id;
1682 0 : if ((!(__v))) {
1683 0 : if ((!(__nullable))) {
1684 0 : NS_RUNTIMEABORT("NULL actor value passed to non-nullable param");
1685 : }
1686 0 : id = 0;
1687 : }
1688 : else {
1689 0 : id = (__v)->mId;
1690 0 : if ((1) == (id)) {
1691 0 : NS_RUNTIMEABORT("actor has been |delete|d");
1692 : }
1693 : }
1694 :
1695 0 : Write(id, __msg);
1696 0 : }
1697 :
1698 : bool
1699 0 : PPluginModuleParent::Read(
1700 : PPluginInstanceParent** __v,
1701 : const Message* __msg,
1702 : void** __iter,
1703 : bool __nullable)
1704 : {
1705 : int32 id;
1706 0 : if ((!(Read((&(id)), __msg, __iter)))) {
1707 0 : return false;
1708 : }
1709 0 : if (((1) == (id)) || (((0) == (id)) && ((!(__nullable))))) {
1710 0 : return false;
1711 : }
1712 :
1713 0 : if ((0) == (id)) {
1714 0 : (*(__v)) = 0;
1715 : }
1716 : else {
1717 0 : (*(__v)) = static_cast<PPluginInstanceParent*>(Lookup(id));
1718 0 : if ((!((*(__v))))) {
1719 0 : return false;
1720 : }
1721 : }
1722 0 : return true;
1723 : }
1724 :
1725 : void
1726 0 : PPluginModuleParent::Write(
1727 : PCrashReporterParent* __v,
1728 : Message* __msg,
1729 : bool __nullable)
1730 : {
1731 : int32 id;
1732 0 : if ((!(__v))) {
1733 0 : if ((!(__nullable))) {
1734 0 : NS_RUNTIMEABORT("NULL actor value passed to non-nullable param");
1735 : }
1736 0 : id = 0;
1737 : }
1738 : else {
1739 0 : id = (__v)->mId;
1740 0 : if ((1) == (id)) {
1741 0 : NS_RUNTIMEABORT("actor has been |delete|d");
1742 : }
1743 : }
1744 :
1745 0 : Write(id, __msg);
1746 0 : }
1747 :
1748 : bool
1749 0 : PPluginModuleParent::Read(
1750 : PCrashReporterParent** __v,
1751 : const Message* __msg,
1752 : void** __iter,
1753 : bool __nullable)
1754 : {
1755 : int32 id;
1756 0 : if ((!(Read((&(id)), __msg, __iter)))) {
1757 0 : return false;
1758 : }
1759 0 : if (((1) == (id)) || (((0) == (id)) && ((!(__nullable))))) {
1760 0 : return false;
1761 : }
1762 :
1763 0 : if ((0) == (id)) {
1764 0 : (*(__v)) = 0;
1765 : }
1766 : else {
1767 0 : (*(__v)) = static_cast<PCrashReporterParent*>(Lookup(id));
1768 0 : if ((!((*(__v))))) {
1769 0 : return false;
1770 : }
1771 : }
1772 0 : return true;
1773 : }
1774 :
1775 : void
1776 0 : PPluginModuleParent::Write(
1777 : PPluginIdentifierParent* __v,
1778 : Message* __msg,
1779 : bool __nullable)
1780 : {
1781 : int32 id;
1782 0 : if ((!(__v))) {
1783 0 : if ((!(__nullable))) {
1784 0 : NS_RUNTIMEABORT("NULL actor value passed to non-nullable param");
1785 : }
1786 0 : id = 0;
1787 : }
1788 : else {
1789 0 : id = (__v)->mId;
1790 0 : if ((1) == (id)) {
1791 0 : NS_RUNTIMEABORT("actor has been |delete|d");
1792 : }
1793 : }
1794 :
1795 0 : Write(id, __msg);
1796 0 : }
1797 :
1798 : bool
1799 0 : PPluginModuleParent::Read(
1800 : PPluginIdentifierParent** __v,
1801 : const Message* __msg,
1802 : void** __iter,
1803 : bool __nullable)
1804 : {
1805 : int32 id;
1806 0 : if ((!(Read((&(id)), __msg, __iter)))) {
1807 0 : return false;
1808 : }
1809 0 : if (((1) == (id)) || (((0) == (id)) && ((!(__nullable))))) {
1810 0 : return false;
1811 : }
1812 :
1813 0 : if ((0) == (id)) {
1814 0 : (*(__v)) = 0;
1815 : }
1816 : else {
1817 0 : (*(__v)) = static_cast<PPluginIdentifierParent*>(Lookup(id));
1818 0 : if ((!((*(__v))))) {
1819 0 : return false;
1820 : }
1821 : }
1822 0 : return true;
1823 : }
1824 :
1825 :
1826 :
1827 : } // namespace plugins
1828 : } // namespace mozilla
|