LCOV - code coverage report
Current view: top level - obj-x86_64-pc-linux-gnu/ipc/ipdl - PGMPContentParent.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 0 348 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 47 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //
       2             : // Automatically generated by ipdlc.
       3             : // Edit at your own risk
       4             : //
       5             : 
       6             : 
       7             : #include "mozilla/gmp/PGMPContentParent.h"
       8             : #ifdef MOZ_CRASHREPORTER
       9             : #  include "nsXULAppAPI.h"
      10             : #endif
      11             : 
      12             : #include "mozilla/gmp/PGMPVideoDecoderParent.h"
      13             : #include "mozilla/gmp/PGMPVideoEncoderParent.h"
      14             : #include "mozilla/gmp/PGMPDecryptorParent.h"
      15             : #include "mozilla/gmp/PChromiumCDMParent.h"
      16             : 
      17             : #include "nsIFile.h"
      18             : #include "GeckoProfiler.h"
      19             : 
      20             : namespace mozilla {
      21             : namespace gmp {
      22             : 
      23             : 
      24             : 
      25           0 : auto PGMPContentParent::ProcessingError(
      26             :         Result aCode,
      27             :         const char* aReason) -> void
      28             : {
      29           0 : }
      30             : 
      31           0 : auto PGMPContentParent::ShouldContinueFromReplyTimeout() -> bool
      32             : {
      33           0 :     return true;
      34             : }
      35             : 
      36           0 : auto PGMPContentParent::EnteredCxxStack() -> void
      37             : {
      38           0 : }
      39             : 
      40           0 : auto PGMPContentParent::ExitedCxxStack() -> void
      41             : {
      42           0 : }
      43             : 
      44           0 : auto PGMPContentParent::EnteredCall() -> void
      45             : {
      46           0 : }
      47             : 
      48           0 : auto PGMPContentParent::ExitedCall() -> void
      49             : {
      50           0 : }
      51             : 
      52           0 : MOZ_IMPLICIT PGMPContentParent::PGMPContentParent() :
      53             :     mozilla::ipc::IToplevelProtocol(PGMPContentMsgStart, mozilla::ipc::ParentSide),
      54             :     mChannel("PGMPContentParent", ALLOW_THIS_IN_INITIALIZER_LIST(this)),
      55           0 :     mState(PGMPContent::__Start)
      56             : {
      57           0 :     MOZ_COUNT_CTOR(PGMPContentParent);
      58           0 : }
      59             : 
      60           0 : PGMPContentParent::~PGMPContentParent()
      61             : {
      62           0 :     MOZ_COUNT_DTOR(PGMPContentParent);
      63           0 : }
      64             : 
      65           0 : auto PGMPContentParent::ManagedPGMPDecryptorParent(nsTArray<PGMPDecryptorParent*>& aArr) const -> void
      66             : {
      67           0 :     (mManagedPGMPDecryptorParent).ToArray(aArr);
      68           0 : }
      69             : 
      70           0 : auto PGMPContentParent::ManagedPGMPDecryptorParent() const -> const ManagedContainer<PGMPDecryptorParent>&
      71             : {
      72           0 :     return mManagedPGMPDecryptorParent;
      73             : }
      74             : 
      75           0 : auto PGMPContentParent::ManagedPGMPVideoDecoderParent(nsTArray<PGMPVideoDecoderParent*>& aArr) const -> void
      76             : {
      77           0 :     (mManagedPGMPVideoDecoderParent).ToArray(aArr);
      78           0 : }
      79             : 
      80           0 : auto PGMPContentParent::ManagedPGMPVideoDecoderParent() const -> const ManagedContainer<PGMPVideoDecoderParent>&
      81             : {
      82           0 :     return mManagedPGMPVideoDecoderParent;
      83             : }
      84             : 
      85           0 : auto PGMPContentParent::ManagedPGMPVideoEncoderParent(nsTArray<PGMPVideoEncoderParent*>& aArr) const -> void
      86             : {
      87           0 :     (mManagedPGMPVideoEncoderParent).ToArray(aArr);
      88           0 : }
      89             : 
      90           0 : auto PGMPContentParent::ManagedPGMPVideoEncoderParent() const -> const ManagedContainer<PGMPVideoEncoderParent>&
      91             : {
      92           0 :     return mManagedPGMPVideoEncoderParent;
      93             : }
      94             : 
      95           0 : auto PGMPContentParent::ManagedPChromiumCDMParent(nsTArray<PChromiumCDMParent*>& aArr) const -> void
      96             : {
      97           0 :     (mManagedPChromiumCDMParent).ToArray(aArr);
      98           0 : }
      99             : 
     100           0 : auto PGMPContentParent::ManagedPChromiumCDMParent() const -> const ManagedContainer<PChromiumCDMParent>&
     101             : {
     102           0 :     return mManagedPChromiumCDMParent;
     103             : }
     104             : 
     105           0 : auto PGMPContentParent::SendPGMPDecryptorConstructor() -> PGMPDecryptorParent*
     106             : {
     107           0 :     return SendPGMPDecryptorConstructor(AllocPGMPDecryptorParent());
     108             : }
     109             : 
     110           0 : auto PGMPContentParent::SendPGMPDecryptorConstructor(PGMPDecryptorParent* actor) -> PGMPDecryptorParent*
     111             : {
     112           0 :     if ((!(actor))) {
     113           0 :         NS_WARNING("Error constructing actor PGMPDecryptorParent");
     114           0 :         return nullptr;
     115             :     }
     116           0 :     (actor)->SetManager(this);
     117           0 :     Register(actor);
     118           0 :     (actor)->SetIPCChannel(GetIPCChannel());
     119           0 :     (mManagedPGMPDecryptorParent).PutEntry(actor);
     120           0 :     (actor)->mState = mozilla::gmp::PGMPDecryptor::__Start;
     121             : 
     122           0 :     IPC::Message* msg__ = PGMPContent::Msg_PGMPDecryptorConstructor(MSG_ROUTING_CONTROL);
     123             : 
     124           0 :     Write(actor, msg__, false);
     125             :     // Sentinel = 'actor'
     126           0 :     (msg__)->WriteSentinel(875202478);
     127             : 
     128           0 :     (msg__)->set_constructor();
     129             : 
     130             : 
     131           0 :     if (mozilla::ipc::LoggingEnabledFor("PGMPContentParent")) {
     132           0 :         mozilla::ipc::LogMessageForProtocol("PGMPContentParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
     133             :     }
     134           0 :     AUTO_PROFILER_LABEL("PGMPContent::Msg_PGMPDecryptorConstructor", OTHER);
     135           0 :     PGMPContent::Transition(PGMPContent::Msg_PGMPDecryptorConstructor__ID, (&(mState)));
     136             : 
     137           0 :     bool sendok__ = (GetIPCChannel())->Send(msg__);
     138           0 :     if ((!(sendok__))) {
     139           0 :         IProtocol* mgr = (actor)->Manager();
     140           0 :         (actor)->DestroySubtree(FailedConstructor);
     141           0 :         (actor)->DeallocSubtree();
     142           0 :         (mgr)->RemoveManagee(PGMPDecryptorMsgStart, actor);
     143           0 :         return nullptr;
     144             :     }
     145           0 :     return actor;
     146             : }
     147             : 
     148           0 : auto PGMPContentParent::SendPGMPVideoDecoderConstructor(const uint32_t& aDecryptorId) -> PGMPVideoDecoderParent*
     149             : {
     150           0 :     return SendPGMPVideoDecoderConstructor(AllocPGMPVideoDecoderParent(aDecryptorId), aDecryptorId);
     151             : }
     152             : 
     153           0 : auto PGMPContentParent::SendPGMPVideoDecoderConstructor(
     154             :         PGMPVideoDecoderParent* actor,
     155             :         const uint32_t& aDecryptorId) -> PGMPVideoDecoderParent*
     156             : {
     157           0 :     if ((!(actor))) {
     158           0 :         NS_WARNING("Error constructing actor PGMPVideoDecoderParent");
     159           0 :         return nullptr;
     160             :     }
     161           0 :     (actor)->SetManager(this);
     162           0 :     Register(actor);
     163           0 :     (actor)->SetIPCChannel(GetIPCChannel());
     164           0 :     (mManagedPGMPVideoDecoderParent).PutEntry(actor);
     165           0 :     (actor)->mState = mozilla::gmp::PGMPVideoDecoder::__Start;
     166             : 
     167           0 :     IPC::Message* msg__ = PGMPContent::Msg_PGMPVideoDecoderConstructor(MSG_ROUTING_CONTROL);
     168             : 
     169           0 :     Write(actor, msg__, false);
     170             :     // Sentinel = 'actor'
     171           0 :     (msg__)->WriteSentinel(875202478);
     172           0 :     Write(aDecryptorId, msg__);
     173             :     // Sentinel = 'aDecryptorId'
     174           0 :     (msg__)->WriteSentinel(2779641256);
     175             : 
     176           0 :     (msg__)->set_constructor();
     177             : 
     178             : 
     179           0 :     if (mozilla::ipc::LoggingEnabledFor("PGMPContentParent")) {
     180           0 :         mozilla::ipc::LogMessageForProtocol("PGMPContentParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
     181             :     }
     182           0 :     AUTO_PROFILER_LABEL("PGMPContent::Msg_PGMPVideoDecoderConstructor", OTHER);
     183           0 :     PGMPContent::Transition(PGMPContent::Msg_PGMPVideoDecoderConstructor__ID, (&(mState)));
     184             : 
     185           0 :     bool sendok__ = (GetIPCChannel())->Send(msg__);
     186           0 :     if ((!(sendok__))) {
     187           0 :         IProtocol* mgr = (actor)->Manager();
     188           0 :         (actor)->DestroySubtree(FailedConstructor);
     189           0 :         (actor)->DeallocSubtree();
     190           0 :         (mgr)->RemoveManagee(PGMPVideoDecoderMsgStart, actor);
     191           0 :         return nullptr;
     192             :     }
     193           0 :     return actor;
     194             : }
     195             : 
     196           0 : auto PGMPContentParent::SendPGMPVideoEncoderConstructor() -> PGMPVideoEncoderParent*
     197             : {
     198           0 :     return SendPGMPVideoEncoderConstructor(AllocPGMPVideoEncoderParent());
     199             : }
     200             : 
     201           0 : auto PGMPContentParent::SendPGMPVideoEncoderConstructor(PGMPVideoEncoderParent* actor) -> PGMPVideoEncoderParent*
     202             : {
     203           0 :     if ((!(actor))) {
     204           0 :         NS_WARNING("Error constructing actor PGMPVideoEncoderParent");
     205           0 :         return nullptr;
     206             :     }
     207           0 :     (actor)->SetManager(this);
     208           0 :     Register(actor);
     209           0 :     (actor)->SetIPCChannel(GetIPCChannel());
     210           0 :     (mManagedPGMPVideoEncoderParent).PutEntry(actor);
     211           0 :     (actor)->mState = mozilla::gmp::PGMPVideoEncoder::__Start;
     212             : 
     213           0 :     IPC::Message* msg__ = PGMPContent::Msg_PGMPVideoEncoderConstructor(MSG_ROUTING_CONTROL);
     214             : 
     215           0 :     Write(actor, msg__, false);
     216             :     // Sentinel = 'actor'
     217           0 :     (msg__)->WriteSentinel(875202478);
     218             : 
     219           0 :     (msg__)->set_constructor();
     220             : 
     221             : 
     222           0 :     if (mozilla::ipc::LoggingEnabledFor("PGMPContentParent")) {
     223           0 :         mozilla::ipc::LogMessageForProtocol("PGMPContentParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
     224             :     }
     225           0 :     AUTO_PROFILER_LABEL("PGMPContent::Msg_PGMPVideoEncoderConstructor", OTHER);
     226           0 :     PGMPContent::Transition(PGMPContent::Msg_PGMPVideoEncoderConstructor__ID, (&(mState)));
     227             : 
     228           0 :     bool sendok__ = (GetIPCChannel())->Send(msg__);
     229           0 :     if ((!(sendok__))) {
     230           0 :         IProtocol* mgr = (actor)->Manager();
     231           0 :         (actor)->DestroySubtree(FailedConstructor);
     232           0 :         (actor)->DeallocSubtree();
     233           0 :         (mgr)->RemoveManagee(PGMPVideoEncoderMsgStart, actor);
     234           0 :         return nullptr;
     235             :     }
     236           0 :     return actor;
     237             : }
     238             : 
     239           0 : auto PGMPContentParent::SendPChromiumCDMConstructor() -> PChromiumCDMParent*
     240             : {
     241           0 :     return SendPChromiumCDMConstructor(AllocPChromiumCDMParent());
     242             : }
     243             : 
     244           0 : auto PGMPContentParent::SendPChromiumCDMConstructor(PChromiumCDMParent* actor) -> PChromiumCDMParent*
     245             : {
     246           0 :     if ((!(actor))) {
     247           0 :         NS_WARNING("Error constructing actor PChromiumCDMParent");
     248           0 :         return nullptr;
     249             :     }
     250           0 :     (actor)->SetManager(this);
     251           0 :     Register(actor);
     252           0 :     (actor)->SetIPCChannel(GetIPCChannel());
     253           0 :     (mManagedPChromiumCDMParent).PutEntry(actor);
     254           0 :     (actor)->mState = mozilla::gmp::PChromiumCDM::__Start;
     255             : 
     256           0 :     IPC::Message* msg__ = PGMPContent::Msg_PChromiumCDMConstructor(MSG_ROUTING_CONTROL);
     257             : 
     258           0 :     Write(actor, msg__, false);
     259             :     // Sentinel = 'actor'
     260           0 :     (msg__)->WriteSentinel(875202478);
     261             : 
     262           0 :     (msg__)->set_constructor();
     263             : 
     264             : 
     265           0 :     if (mozilla::ipc::LoggingEnabledFor("PGMPContentParent")) {
     266           0 :         mozilla::ipc::LogMessageForProtocol("PGMPContentParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
     267             :     }
     268           0 :     AUTO_PROFILER_LABEL("PGMPContent::Msg_PChromiumCDMConstructor", OTHER);
     269           0 :     PGMPContent::Transition(PGMPContent::Msg_PChromiumCDMConstructor__ID, (&(mState)));
     270             : 
     271           0 :     bool sendok__ = (GetIPCChannel())->Send(msg__);
     272           0 :     if ((!(sendok__))) {
     273           0 :         IProtocol* mgr = (actor)->Manager();
     274           0 :         (actor)->DestroySubtree(FailedConstructor);
     275           0 :         (actor)->DeallocSubtree();
     276           0 :         (mgr)->RemoveManagee(PChromiumCDMMsgStart, actor);
     277           0 :         return nullptr;
     278             :     }
     279           0 :     return actor;
     280             : }
     281             : 
     282           0 : auto PGMPContentParent::GetIPCChannel() -> MessageChannel*
     283             : {
     284           0 :     return (&(mChannel));
     285             : }
     286             : 
     287           0 : auto PGMPContentParent::GetIPCChannel() const -> const MessageChannel*
     288             : {
     289           0 :     return (&(mChannel));
     290             : }
     291             : 
     292           0 : auto PGMPContentParent::RemoveManagee(
     293             :         int32_t aProtocolId,
     294             :         ProtocolBase* aListener) -> void
     295             : {
     296           0 :     switch (aProtocolId) {
     297             :     case PGMPDecryptorMsgStart:
     298             :         {
     299           0 :             PGMPDecryptorParent* actor = static_cast<PGMPDecryptorParent*>(aListener);
     300           0 :             auto& container = mManagedPGMPDecryptorParent;
     301           0 :             MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!");
     302             : 
     303           0 :             (container).RemoveEntry(actor);
     304           0 :             DeallocPGMPDecryptorParent(actor);
     305           0 :             return;
     306             :         }
     307             :     case PGMPVideoDecoderMsgStart:
     308             :         {
     309           0 :             PGMPVideoDecoderParent* actor = static_cast<PGMPVideoDecoderParent*>(aListener);
     310           0 :             auto& container = mManagedPGMPVideoDecoderParent;
     311           0 :             MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!");
     312             : 
     313           0 :             (container).RemoveEntry(actor);
     314           0 :             DeallocPGMPVideoDecoderParent(actor);
     315           0 :             return;
     316             :         }
     317             :     case PGMPVideoEncoderMsgStart:
     318             :         {
     319           0 :             PGMPVideoEncoderParent* actor = static_cast<PGMPVideoEncoderParent*>(aListener);
     320           0 :             auto& container = mManagedPGMPVideoEncoderParent;
     321           0 :             MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!");
     322             : 
     323           0 :             (container).RemoveEntry(actor);
     324           0 :             DeallocPGMPVideoEncoderParent(actor);
     325           0 :             return;
     326             :         }
     327             :     case PChromiumCDMMsgStart:
     328             :         {
     329           0 :             PChromiumCDMParent* actor = static_cast<PChromiumCDMParent*>(aListener);
     330           0 :             auto& container = mManagedPChromiumCDMParent;
     331           0 :             MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!");
     332             : 
     333           0 :             (container).RemoveEntry(actor);
     334           0 :             DeallocPChromiumCDMParent(actor);
     335           0 :             return;
     336             :         }
     337             :     default:
     338             :         {
     339           0 :             FatalError("unreached");
     340           0 :             return;
     341             :         }
     342             :     }
     343             : }
     344             : 
     345           0 : auto PGMPContentParent::OnMessageReceived(const Message& msg__) -> PGMPContentParent::Result
     346             : {
     347           0 :     int32_t route__ = (msg__).routing_id();
     348           0 :     if ((MSG_ROUTING_CONTROL) != (route__)) {
     349           0 :         ChannelListener* routed__ = Lookup(route__);
     350           0 :         if ((!(routed__))) {
     351           0 :             return MsgRouteError;
     352             :         }
     353           0 :         return (routed__)->OnMessageReceived(msg__);
     354             :     }
     355             : 
     356           0 :     switch ((msg__).type()) {
     357             :     case PGMPContent::Reply_PGMPDecryptorConstructor__ID:
     358             :         {
     359           0 :             return MsgProcessed;
     360             :         }
     361             :     case PGMPContent::Reply_PGMPVideoDecoderConstructor__ID:
     362             :         {
     363           0 :             return MsgProcessed;
     364             :         }
     365             :     case PGMPContent::Reply_PGMPVideoEncoderConstructor__ID:
     366             :         {
     367           0 :             return MsgProcessed;
     368             :         }
     369             :     case PGMPContent::Reply_PChromiumCDMConstructor__ID:
     370             :         {
     371           0 :             return MsgProcessed;
     372             :         }
     373             :     default:
     374             :         {
     375           0 :             return MsgNotKnown;
     376             :         }
     377             :     case SHMEM_CREATED_MESSAGE_TYPE:
     378             :         {
     379           0 :             if ((!(ShmemCreated(msg__)))) {
     380           0 :                 return MsgPayloadError;
     381             :             }
     382           0 :             return MsgProcessed;
     383             :         }
     384             :     case SHMEM_DESTROYED_MESSAGE_TYPE:
     385             :         {
     386           0 :             if ((!(ShmemDestroyed(msg__)))) {
     387           0 :                 return MsgPayloadError;
     388             :             }
     389           0 :             return MsgProcessed;
     390             :         }
     391             :     }
     392             : }
     393             : 
     394           0 : auto PGMPContentParent::OnMessageReceived(
     395             :         const Message& msg__,
     396             :         Message*& reply__) -> PGMPContentParent::Result
     397             : {
     398           0 :     int32_t route__ = (msg__).routing_id();
     399           0 :     if ((MSG_ROUTING_CONTROL) != (route__)) {
     400           0 :         ChannelListener* routed__ = Lookup(route__);
     401           0 :         if ((!(routed__))) {
     402           0 :             return MsgRouteError;
     403             :         }
     404           0 :         return (routed__)->OnMessageReceived(msg__, reply__);
     405             :     }
     406             : 
     407           0 :     return MsgNotKnown;
     408             : }
     409             : 
     410           0 : auto PGMPContentParent::OnCallReceived(
     411             :         const Message& msg__,
     412             :         Message*& reply__) -> PGMPContentParent::Result
     413             : {
     414           0 :     int32_t route__ = (msg__).routing_id();
     415           0 :     if ((MSG_ROUTING_CONTROL) != (route__)) {
     416           0 :         ChannelListener* routed__ = Lookup(route__);
     417           0 :         if ((!(routed__))) {
     418           0 :             return MsgRouteError;
     419             :         }
     420           0 :         return (routed__)->OnCallReceived(msg__, reply__);
     421             :     }
     422             : 
     423           0 :     return MsgNotKnown;
     424             : }
     425             : 
     426           0 : auto PGMPContentParent::GetProtocolTypeId() -> int32_t
     427             : {
     428           0 :     return PGMPContentMsgStart;
     429             : }
     430             : 
     431           0 : auto PGMPContentParent::OnChannelClose() -> void
     432             : {
     433           0 :     DestroySubtree(NormalShutdown);
     434           0 :     DeallocSubtree();
     435           0 :     DeallocShmems();
     436           0 :     DeallocPGMPContentParent();
     437           0 : }
     438             : 
     439           0 : auto PGMPContentParent::OnChannelError() -> void
     440             : {
     441           0 :     DestroySubtree(AbnormalShutdown);
     442           0 :     DeallocSubtree();
     443           0 :     DeallocShmems();
     444           0 :     DeallocPGMPContentParent();
     445           0 : }
     446             : 
     447           0 : auto PGMPContentParent::ProcessNativeEventsInInterruptCall() -> void
     448             : {
     449             : #ifdef OS_WIN
     450             :     (mChannel).ProcessNativeEventsInInterruptCall();
     451             : #else
     452           0 :     FatalError("This method is Windows-only");
     453             : #endif
     454           0 : }
     455             : 
     456           0 : auto PGMPContentParent::ProtocolName() const -> const char*
     457             : {
     458           0 :     return "PGMPContentParent";
     459             : }
     460             : 
     461           0 : auto PGMPContentParent::DestroySubtree(ActorDestroyReason why) -> void
     462             : {
     463           0 :     ActorDestroyReason subtreewhy = (((why) == (Deletion)) || ((why) == (FailedConstructor)) ? AncestorDeletion : why);
     464             : 
     465             :     {
     466             :         // Recursively shutting down PGMPDecryptor kids
     467           0 :         nsTArray<PGMPDecryptorParent*> kids;
     468             :         // Accumulate kids into a stable structure to iterate over
     469           0 :         ManagedPGMPDecryptorParent(kids);
     470           0 :         for (auto& kid : kids) {
     471             :             // Guarding against a child removing a sibling from the list during the iteration.
     472           0 :             if ((mManagedPGMPDecryptorParent).Contains(kid)) {
     473           0 :                 (kid)->DestroySubtree(subtreewhy);
     474             :             }
     475             :         }
     476             :     }
     477             :     {
     478             :         // Recursively shutting down PGMPVideoDecoder kids
     479           0 :         nsTArray<PGMPVideoDecoderParent*> kids;
     480             :         // Accumulate kids into a stable structure to iterate over
     481           0 :         ManagedPGMPVideoDecoderParent(kids);
     482           0 :         for (auto& kid : kids) {
     483             :             // Guarding against a child removing a sibling from the list during the iteration.
     484           0 :             if ((mManagedPGMPVideoDecoderParent).Contains(kid)) {
     485           0 :                 (kid)->DestroySubtree(subtreewhy);
     486             :             }
     487             :         }
     488             :     }
     489             :     {
     490             :         // Recursively shutting down PGMPVideoEncoder kids
     491           0 :         nsTArray<PGMPVideoEncoderParent*> kids;
     492             :         // Accumulate kids into a stable structure to iterate over
     493           0 :         ManagedPGMPVideoEncoderParent(kids);
     494           0 :         for (auto& kid : kids) {
     495             :             // Guarding against a child removing a sibling from the list during the iteration.
     496           0 :             if ((mManagedPGMPVideoEncoderParent).Contains(kid)) {
     497           0 :                 (kid)->DestroySubtree(subtreewhy);
     498             :             }
     499             :         }
     500             :     }
     501             :     {
     502             :         // Recursively shutting down PChromiumCDM kids
     503           0 :         nsTArray<PChromiumCDMParent*> kids;
     504             :         // Accumulate kids into a stable structure to iterate over
     505           0 :         ManagedPChromiumCDMParent(kids);
     506           0 :         for (auto& kid : kids) {
     507             :             // Guarding against a child removing a sibling from the list during the iteration.
     508           0 :             if ((mManagedPChromiumCDMParent).Contains(kid)) {
     509           0 :                 (kid)->DestroySubtree(subtreewhy);
     510             :             }
     511             :         }
     512             :     }
     513             : 
     514             :     // Reject owning pending promises.
     515           0 :     (GetIPCChannel())->RejectPendingPromisesForActor(this);
     516             : 
     517             :     // Finally, destroy "us".
     518           0 :     ActorDestroy(why);
     519           0 : }
     520             : 
     521           0 : auto PGMPContentParent::DeallocSubtree() -> void
     522             : {
     523             :     {
     524             :         // Recursively deleting PGMPDecryptor kids
     525           0 :         for (auto iter = (mManagedPGMPDecryptorParent).Iter(); (!((iter).Done())); (iter).Next()) {
     526           0 :             (((iter).Get())->GetKey())->DeallocSubtree();
     527             :         }
     528             : 
     529           0 :         for (auto iter = (mManagedPGMPDecryptorParent).Iter(); (!((iter).Done())); (iter).Next()) {
     530           0 :             DeallocPGMPDecryptorParent(((iter).Get())->GetKey());
     531             :         }
     532           0 :         (mManagedPGMPDecryptorParent).Clear();
     533             :     }
     534             :     {
     535             :         // Recursively deleting PGMPVideoDecoder kids
     536           0 :         for (auto iter = (mManagedPGMPVideoDecoderParent).Iter(); (!((iter).Done())); (iter).Next()) {
     537           0 :             (((iter).Get())->GetKey())->DeallocSubtree();
     538             :         }
     539             : 
     540           0 :         for (auto iter = (mManagedPGMPVideoDecoderParent).Iter(); (!((iter).Done())); (iter).Next()) {
     541           0 :             DeallocPGMPVideoDecoderParent(((iter).Get())->GetKey());
     542             :         }
     543           0 :         (mManagedPGMPVideoDecoderParent).Clear();
     544             :     }
     545             :     {
     546             :         // Recursively deleting PGMPVideoEncoder kids
     547           0 :         for (auto iter = (mManagedPGMPVideoEncoderParent).Iter(); (!((iter).Done())); (iter).Next()) {
     548           0 :             (((iter).Get())->GetKey())->DeallocSubtree();
     549             :         }
     550             : 
     551           0 :         for (auto iter = (mManagedPGMPVideoEncoderParent).Iter(); (!((iter).Done())); (iter).Next()) {
     552           0 :             DeallocPGMPVideoEncoderParent(((iter).Get())->GetKey());
     553             :         }
     554           0 :         (mManagedPGMPVideoEncoderParent).Clear();
     555             :     }
     556             :     {
     557             :         // Recursively deleting PChromiumCDM kids
     558           0 :         for (auto iter = (mManagedPChromiumCDMParent).Iter(); (!((iter).Done())); (iter).Next()) {
     559           0 :             (((iter).Get())->GetKey())->DeallocSubtree();
     560             :         }
     561             : 
     562           0 :         for (auto iter = (mManagedPChromiumCDMParent).Iter(); (!((iter).Done())); (iter).Next()) {
     563           0 :             DeallocPChromiumCDMParent(((iter).Get())->GetKey());
     564             :         }
     565           0 :         (mManagedPChromiumCDMParent).Clear();
     566             :     }
     567           0 : }
     568             : 
     569           0 : auto PGMPContentParent::DeallocPGMPContentParent() -> void
     570             : {
     571           0 : }
     572             : 
     573           0 : auto PGMPContentParent::Write(
     574             :         const PChromiumCDMParent* v__,
     575             :         Message* msg__,
     576             :         bool nullable__) -> void
     577             : {
     578             :     int32_t id;
     579           0 :     if ((!(v__))) {
     580           0 :         if ((!(nullable__))) {
     581           0 :             FatalError("NULL actor value passed to non-nullable param");
     582             :         }
     583           0 :         id = 0;
     584             :     }
     585             :     else {
     586           0 :         id = (v__)->Id();
     587           0 :         if ((1) == (id)) {
     588           0 :             FatalError("actor has been |delete|d");
     589             :         }
     590             :     }
     591             : 
     592           0 :     Write(id, msg__);
     593           0 : }
     594             : 
     595           0 : auto PGMPContentParent::Read(
     596             :         PChromiumCDMParent** v__,
     597             :         const Message* msg__,
     598             :         PickleIterator* iter__,
     599             :         bool nullable__) -> bool
     600             : {
     601           0 :     Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PChromiumCDM", PChromiumCDMMsgStart);
     602           0 :     if ((actor).isNothing()) {
     603           0 :         return false;
     604             :     }
     605             : 
     606           0 :     (*(v__)) = static_cast<PChromiumCDMParent*>((actor).value());
     607           0 :     return true;
     608             : }
     609             : 
     610           0 : auto PGMPContentParent::Write(
     611             :         const PGMPVideoEncoderParent* v__,
     612             :         Message* msg__,
     613             :         bool nullable__) -> void
     614             : {
     615             :     int32_t id;
     616           0 :     if ((!(v__))) {
     617           0 :         if ((!(nullable__))) {
     618           0 :             FatalError("NULL actor value passed to non-nullable param");
     619             :         }
     620           0 :         id = 0;
     621             :     }
     622             :     else {
     623           0 :         id = (v__)->Id();
     624           0 :         if ((1) == (id)) {
     625           0 :             FatalError("actor has been |delete|d");
     626             :         }
     627             :     }
     628             : 
     629           0 :     Write(id, msg__);
     630           0 : }
     631             : 
     632           0 : auto PGMPContentParent::Read(
     633             :         PGMPVideoEncoderParent** v__,
     634             :         const Message* msg__,
     635             :         PickleIterator* iter__,
     636             :         bool nullable__) -> bool
     637             : {
     638           0 :     Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PGMPVideoEncoder", PGMPVideoEncoderMsgStart);
     639           0 :     if ((actor).isNothing()) {
     640           0 :         return false;
     641             :     }
     642             : 
     643           0 :     (*(v__)) = static_cast<PGMPVideoEncoderParent*>((actor).value());
     644           0 :     return true;
     645             : }
     646             : 
     647           0 : auto PGMPContentParent::Write(
     648             :         const PGMPVideoDecoderParent* v__,
     649             :         Message* msg__,
     650             :         bool nullable__) -> void
     651             : {
     652             :     int32_t id;
     653           0 :     if ((!(v__))) {
     654           0 :         if ((!(nullable__))) {
     655           0 :             FatalError("NULL actor value passed to non-nullable param");
     656             :         }
     657           0 :         id = 0;
     658             :     }
     659             :     else {
     660           0 :         id = (v__)->Id();
     661           0 :         if ((1) == (id)) {
     662           0 :             FatalError("actor has been |delete|d");
     663             :         }
     664             :     }
     665             : 
     666           0 :     Write(id, msg__);
     667           0 : }
     668             : 
     669           0 : auto PGMPContentParent::Read(
     670             :         PGMPVideoDecoderParent** v__,
     671             :         const Message* msg__,
     672             :         PickleIterator* iter__,
     673             :         bool nullable__) -> bool
     674             : {
     675           0 :     Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PGMPVideoDecoder", PGMPVideoDecoderMsgStart);
     676           0 :     if ((actor).isNothing()) {
     677           0 :         return false;
     678             :     }
     679             : 
     680           0 :     (*(v__)) = static_cast<PGMPVideoDecoderParent*>((actor).value());
     681           0 :     return true;
     682             : }
     683             : 
     684           0 : auto PGMPContentParent::Write(
     685             :         const PGMPDecryptorParent* v__,
     686             :         Message* msg__,
     687             :         bool nullable__) -> void
     688             : {
     689             :     int32_t id;
     690           0 :     if ((!(v__))) {
     691           0 :         if ((!(nullable__))) {
     692           0 :             FatalError("NULL actor value passed to non-nullable param");
     693             :         }
     694           0 :         id = 0;
     695             :     }
     696             :     else {
     697           0 :         id = (v__)->Id();
     698           0 :         if ((1) == (id)) {
     699           0 :             FatalError("actor has been |delete|d");
     700             :         }
     701             :     }
     702             : 
     703           0 :     Write(id, msg__);
     704           0 : }
     705             : 
     706           0 : auto PGMPContentParent::Read(
     707             :         PGMPDecryptorParent** v__,
     708             :         const Message* msg__,
     709             :         PickleIterator* iter__,
     710             :         bool nullable__) -> bool
     711             : {
     712           0 :     Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PGMPDecryptor", PGMPDecryptorMsgStart);
     713           0 :     if ((actor).isNothing()) {
     714           0 :         return false;
     715             :     }
     716             : 
     717           0 :     (*(v__)) = static_cast<PGMPDecryptorParent*>((actor).value());
     718           0 :     return true;
     719             : }
     720             : 
     721             : 
     722             : 
     723             : } // namespace gmp
     724             : } // namespace mozilla

Generated by: LCOV version 1.13