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

       1                 : //
       2                 : // Automatically generated by ipdlc.
       3                 : // Edit at your own risk
       4                 : //
       5                 : 
       6                 : 
       7                 : #include "mozilla/plugins/PPluginSurfaceParent.h"
       8                 : 
       9                 : #include "mozilla/plugins/PPluginInstanceParent.h"
      10                 : 
      11                 : typedef IPC::Message Message;
      12                 : typedef mozilla::ipc::RPCChannel Channel;
      13                 : typedef mozilla::ipc::RPCChannel::RPCListener ChannelListener;
      14                 : typedef base::ProcessHandle ProcessHandle;
      15                 : typedef mozilla::ipc::AsyncChannel AsyncChannel;
      16                 : typedef mozilla::ipc::SharedMemory SharedMemory;
      17                 : typedef mozilla::ipc::Trigger Trigger;
      18                 : typedef mozilla::ipc::ActorHandle ActorHandle;
      19                 : typedef mozilla::ipc::Shmem Shmem;
      20                 : using mozilla::plugins::PPluginInstanceParent;
      21                 : 
      22                 : namespace mozilla {
      23                 : namespace plugins {
      24                 : 
      25                 : 
      26                 : bool
      27               0 : PPluginSurfaceParent::Recv__delete__()
      28                 : {
      29               0 :     return true;
      30                 : }
      31                 : 
      32                 : void
      33               0 : PPluginSurfaceParent::ActorDestroy(ActorDestroyReason why)
      34                 : {
      35               0 : }
      36                 : 
      37               0 : PPluginSurfaceParent::PPluginSurfaceParent() :
      38                 :     mId(0),
      39               0 :     mState(PPluginSurface::__Dead)
      40                 : {
      41               0 :     MOZ_COUNT_CTOR(PPluginSurfaceParent);
      42               0 : }
      43                 : 
      44               0 : PPluginSurfaceParent::~PPluginSurfaceParent()
      45                 : {
      46               0 :     MOZ_COUNT_DTOR(PPluginSurfaceParent);
      47               0 : }
      48                 : 
      49                 : PPluginInstanceParent*
      50               0 : PPluginSurfaceParent::Manager()
      51                 : {
      52               0 :     return static_cast<PPluginInstanceParent*>(mManager);
      53                 : }
      54                 : 
      55                 : PPluginSurface::State
      56               0 : PPluginSurfaceParent::state()
      57                 : {
      58               0 :     return mState;
      59                 : }
      60                 : 
      61                 : int32
      62               0 : PPluginSurfaceParent::Register(ChannelListener* aRouted)
      63                 : {
      64               0 :     return (mManager)->Register(aRouted);
      65                 : }
      66                 : 
      67                 : int32
      68               0 : PPluginSurfaceParent::RegisterID(
      69                 :         ChannelListener* aRouted,
      70                 :         int32 aId)
      71                 : {
      72               0 :     return (mManager)->RegisterID(aRouted, aId);
      73                 : }
      74                 : 
      75                 : ChannelListener*
      76               0 : PPluginSurfaceParent::Lookup(int32 aId)
      77                 : {
      78               0 :     return (mManager)->Lookup(aId);
      79                 : }
      80                 : 
      81                 : void
      82               0 : PPluginSurfaceParent::Unregister(int32 aId)
      83                 : {
      84               0 :     return (mManager)->Unregister(aId);
      85                 : }
      86                 : 
      87                 : void
      88               0 : PPluginSurfaceParent::RemoveManagee(
      89                 :         int32 aProtocolId,
      90                 :         ChannelListener* aListener)
      91                 : {
      92               0 :     NS_RUNTIMEABORT("unreached");
      93                 :     return;
      94                 : }
      95                 : 
      96                 : Shmem::SharedMemory*
      97               0 : PPluginSurfaceParent::CreateSharedMemory(
      98                 :         size_t aSize,
      99                 :         Shmem::SharedMemory::SharedMemoryType type,
     100                 :         bool unsafe,
     101                 :         Shmem::id_t* aId)
     102                 : {
     103               0 :     return (mManager)->CreateSharedMemory(aSize, type, unsafe, aId);
     104                 : }
     105                 : 
     106                 : bool
     107               0 : PPluginSurfaceParent::AdoptSharedMemory(
     108                 :         Shmem::SharedMemory* segment,
     109                 :         Shmem::id_t* aId)
     110                 : {
     111               0 :     return (mManager)->AdoptSharedMemory(segment, aId);
     112                 : }
     113                 : 
     114                 : Shmem::SharedMemory*
     115               0 : PPluginSurfaceParent::LookupSharedMemory(Shmem::id_t aId)
     116                 : {
     117               0 :     return (mManager)->LookupSharedMemory(aId);
     118                 : }
     119                 : 
     120                 : bool
     121               0 : PPluginSurfaceParent::IsTrackingSharedMemory(Shmem::SharedMemory* segment)
     122                 : {
     123               0 :     return (mManager)->IsTrackingSharedMemory(segment);
     124                 : }
     125                 : 
     126                 : bool
     127               0 : PPluginSurfaceParent::DestroySharedMemory(Shmem& aShmem)
     128                 : {
     129               0 :     return (mManager)->DestroySharedMemory(aShmem);
     130                 : }
     131                 : 
     132                 : ProcessHandle
     133               0 : PPluginSurfaceParent::OtherProcess() const
     134                 : {
     135               0 :     return (mManager)->OtherProcess();
     136                 : }
     137                 : 
     138                 : AsyncChannel*
     139               0 : PPluginSurfaceParent::GetIPCChannel()
     140                 : {
     141               0 :     return mChannel;
     142                 : }
     143                 : 
     144                 : PPluginSurfaceParent::Result
     145               0 : PPluginSurfaceParent::OnMessageReceived(const Message& __msg)
     146                 : {
     147               0 :     switch ((__msg).type()) {
     148                 :     case PPluginSurface::Msg___delete____ID:
     149                 :         {
     150               0 :             (const_cast<Message&>(__msg)).set_name("PPluginSurface::Msg___delete__");
     151               0 :             if (mozilla::ipc::LoggingEnabled()) {
     152               0 :                 (static_cast<const PPluginSurface::Msg___delete__*>((&(__msg))))->Log("[PPluginSurfaceParent] Received ", stderr);
     153                 :             }
     154                 : 
     155               0 :             void* __iter = 0;
     156                 :             PPluginSurfaceParent* actor;
     157                 : 
     158               0 :             if ((!(Read((&(actor)), (&(__msg)), (&(__iter)), false)))) {
     159               0 :                 FatalError("error deserializing (better message TODO)");
     160               0 :                 return MsgValueError;
     161                 :             }
     162               0 :             (__msg).EndRead(__iter);
     163               0 :             if ((!(PPluginSurface::Transition(mState, Trigger(Trigger::Recv, PPluginSurface::Msg___delete____ID), (&(mState)))))) {
     164               0 :                 NS_WARNING("bad state transition!");
     165                 :             }
     166               0 :             if ((!(Recv__delete__()))) {
     167               0 :                 return MsgProcessingError;
     168                 :             }
     169                 : 
     170               0 :             (actor)->DestroySubtree(Deletion);
     171               0 :             (actor)->DeallocSubtree();
     172               0 :             ((actor)->mManager)->RemoveManagee(PPluginSurfaceMsgStart, actor);
     173                 : 
     174                 : 
     175               0 :             return MsgProcessed;
     176                 :         }
     177                 :     default:
     178                 :         {
     179               0 :             return MsgNotKnown;
     180                 :         }
     181                 :     }
     182                 : }
     183                 : 
     184                 : PPluginSurfaceParent::Result
     185               0 : PPluginSurfaceParent::OnMessageReceived(
     186                 :         const Message& __msg,
     187                 :         Message*& __reply)
     188                 : {
     189               0 :     return MsgNotKnown;
     190                 : }
     191                 : 
     192                 : PPluginSurfaceParent::Result
     193               0 : PPluginSurfaceParent::OnCallReceived(
     194                 :         const Message& __msg,
     195                 :         Message*& __reply)
     196                 : {
     197               0 :     return MsgNotKnown;
     198                 : }
     199                 : 
     200                 : void
     201               0 : PPluginSurfaceParent::OnProcessingError(Result code)
     202                 : {
     203               0 :     NS_RUNTIMEABORT("`OnProcessingError' called on non-toplevel actor");
     204               0 : }
     205                 : 
     206                 : bool
     207               0 : PPluginSurfaceParent::OnReplyTimeout()
     208                 : {
     209               0 :     NS_RUNTIMEABORT("`OnReplyTimeout' called on non-toplevel actor");
     210               0 :     return false;
     211                 : }
     212                 : 
     213                 : void
     214               0 : PPluginSurfaceParent::OnChannelClose()
     215                 : {
     216               0 :     NS_RUNTIMEABORT("`OnClose' called on non-toplevel actor");
     217               0 : }
     218                 : 
     219                 : void
     220               0 : PPluginSurfaceParent::OnChannelError()
     221                 : {
     222               0 :     NS_RUNTIMEABORT("`OnError' called on non-toplevel actor");
     223               0 : }
     224                 : 
     225                 : void
     226               0 : PPluginSurfaceParent::OnChannelConnected(int32 pid)
     227                 : {
     228               0 :     NS_RUNTIMEABORT("'OnConnected' called on non-toplevel actor");
     229               0 : }
     230                 : 
     231                 : bool
     232               0 : PPluginSurfaceParent::AllocShmem(
     233                 :         size_t aSize,
     234                 :         Shmem::SharedMemory::SharedMemoryType aType,
     235                 :         Shmem* aMem)
     236                 : {
     237                 :     Shmem::id_t aId;
     238               0 :     nsAutoPtr<Shmem::SharedMemory> rawmem(CreateSharedMemory(aSize, aType, false, (&(aId))));
     239               0 :     if ((!(rawmem))) {
     240               0 :         return false;
     241                 :     }
     242                 : 
     243               0 :     (*(aMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), (rawmem).forget(), aId);
     244               0 :     return true;
     245                 : }
     246                 : 
     247                 : bool
     248               0 : PPluginSurfaceParent::AllocUnsafeShmem(
     249                 :         size_t aSize,
     250                 :         Shmem::SharedMemory::SharedMemoryType aType,
     251                 :         Shmem* aMem)
     252                 : {
     253                 :     Shmem::id_t aId;
     254               0 :     nsAutoPtr<Shmem::SharedMemory> rawmem(CreateSharedMemory(aSize, aType, true, (&(aId))));
     255               0 :     if ((!(rawmem))) {
     256               0 :         return false;
     257                 :     }
     258                 : 
     259               0 :     (*(aMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), (rawmem).forget(), aId);
     260               0 :     return true;
     261                 : }
     262                 : 
     263                 : bool
     264               0 : PPluginSurfaceParent::AdoptShmem(
     265                 :         Shmem& aMem,
     266                 :         Shmem* aOutMem)
     267                 : {
     268               0 :     Shmem::SharedMemory* rawmem = (aMem).Segment(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
     269               0 :     if (((!(rawmem))) || (IsTrackingSharedMemory(rawmem))) {
     270               0 :         NS_RUNTIMEABORT("bad Shmem");
     271                 :     }
     272                 : 
     273                 :     Shmem::id_t aId;
     274               0 :     if ((!(AdoptSharedMemory(rawmem, (&(aId)))))) {
     275               0 :         return false;
     276                 :     }
     277                 : 
     278               0 :     (*(aOutMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), rawmem, aId);
     279               0 :     return true;
     280                 : }
     281                 : 
     282                 : bool
     283               0 : PPluginSurfaceParent::DeallocShmem(Shmem& aMem)
     284                 : {
     285               0 :     bool ok = DestroySharedMemory(aMem);
     286               0 :     (aMem).forget(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
     287               0 :     return ok;
     288                 : }
     289                 : 
     290                 : void
     291               0 : PPluginSurfaceParent::FatalError(const char* const msg) const
     292                 : {
     293                 :     // Virtual method to prevent inlining.
     294                 :     // This give us better error reporting.
     295                 :     // See bug 589371
     296                 : 
     297               0 :     NS_ERROR("IPDL error:");
     298               0 :     NS_ERROR(msg);
     299                 : 
     300               0 :     NS_ERROR("[PPluginSurfaceParent] killing child side as a result");
     301                 : 
     302               0 :     if ((!(base::KillProcess(OtherProcess(), base::PROCESS_END_KILLED_BY_USER, false)))) {
     303               0 :         NS_ERROR("  may have failed to kill child!");
     304                 :     }
     305               0 : }
     306                 : 
     307                 : void
     308               0 : PPluginSurfaceParent::DestroySubtree(ActorDestroyReason why)
     309                 : {
     310                 :     // Unregister from our manager.
     311               0 :     Unregister(mId);
     312               0 :     mId = 1;
     313                 : 
     314                 :     // Finally, destroy "us".
     315               0 :     ActorDestroy(why);
     316               0 : }
     317                 : 
     318                 : void
     319               0 : PPluginSurfaceParent::DeallocSubtree()
     320                 : {
     321               0 : }
     322                 : 
     323                 : void
     324               0 : PPluginSurfaceParent::Write(
     325                 :         PPluginSurfaceParent* __v,
     326                 :         Message* __msg,
     327                 :         bool __nullable)
     328                 : {
     329                 :     int32 id;
     330               0 :     if ((!(__v))) {
     331               0 :         if ((!(__nullable))) {
     332               0 :             NS_RUNTIMEABORT("NULL actor value passed to non-nullable param");
     333                 :         }
     334               0 :         id = 0;
     335                 :     }
     336                 :     else {
     337               0 :         id = (__v)->mId;
     338               0 :         if ((1) == (id)) {
     339               0 :             NS_RUNTIMEABORT("actor has been |delete|d");
     340                 :         }
     341                 :     }
     342                 : 
     343               0 :     Write(id, __msg);
     344               0 : }
     345                 : 
     346                 : bool
     347               0 : PPluginSurfaceParent::Read(
     348                 :         PPluginSurfaceParent** __v,
     349                 :         const Message* __msg,
     350                 :         void** __iter,
     351                 :         bool __nullable)
     352                 : {
     353                 :     int32 id;
     354               0 :     if ((!(Read((&(id)), __msg, __iter)))) {
     355               0 :         return false;
     356                 :     }
     357               0 :     if (((1) == (id)) || (((0) == (id)) && ((!(__nullable))))) {
     358               0 :         return false;
     359                 :     }
     360                 : 
     361               0 :     if ((0) == (id)) {
     362               0 :         (*(__v)) = 0;
     363                 :     }
     364                 :     else {
     365               0 :         (*(__v)) = static_cast<PPluginSurfaceParent*>(Lookup(id));
     366               0 :         if ((!((*(__v))))) {
     367               0 :             return false;
     368                 :         }
     369                 :     }
     370               0 :     return true;
     371                 : }
     372                 : 
     373                 : 
     374                 : 
     375                 : } // namespace plugins
     376                 : } // namespace mozilla

Generated by: LCOV version 1.7