LCOV - code coverage report
Current view: directory - objdir/ipc/ipdl - PPluginModuleChild.cpp (source / functions) Found Hit Coverage
Test: app.info Lines: 819 0 0.0 %
Date: 2012-06-02 Functions: 82 0 0.0 %

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

Generated by: LCOV version 1.7