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

Generated by: LCOV version 1.7