LCOV - code coverage report
Current view: top level - obj-x86_64-pc-linux-gnu/ipc/ipdl - IPCStream.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 33 336 9.8 %
Date: 2017-07-14 16:53:18 Functions: 5 59 8.5 %
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/ipc/IPCStream.h"
       8             : 
       9             : 
      10             : //-----------------------------------------------------------------------------
      11             : // Method definitions for the IPDL type |struct InputStreamParamsWithFds|
      12             : //
      13             : namespace mozilla {
      14             : namespace ipc {
      15           0 : MOZ_IMPLICIT InputStreamParamsWithFds::InputStreamParamsWithFds()
      16             : {
      17           0 :     Init();
      18           0 : }
      19             : 
      20           0 : InputStreamParamsWithFds::~InputStreamParamsWithFds()
      21             : {
      22           0 : }
      23             : 
      24           0 : auto InputStreamParamsWithFds::operator==(const InputStreamParamsWithFds& _o) const -> bool
      25             : {
      26           0 :     if ((!((stream()) == ((_o).stream())))) {
      27           0 :         return false;
      28             :     }
      29           0 :     if ((!((optionalFds()) == ((_o).optionalFds())))) {
      30           0 :         return false;
      31             :     }
      32           0 :     return true;
      33             : }
      34             : 
      35           0 : auto InputStreamParamsWithFds::operator!=(const InputStreamParamsWithFds& _o) const -> bool
      36             : {
      37           0 :     return (!(operator==(_o)));
      38             : }
      39             : 
      40           0 : auto InputStreamParamsWithFds::Init() -> void
      41             : {
      42           0 : }
      43             : 
      44           0 : auto InputStreamParamsWithFds::Assign(
      45             :         const InputStreamParams& _stream,
      46             :         const OptionalFileDescriptorSet& _optionalFds) -> void
      47             : {
      48           0 :     stream_ = _stream;
      49           0 :     optionalFds_ = _optionalFds;
      50           0 : }
      51             : 
      52             : } // namespace ipc
      53             : } // namespace mozilla
      54             : 
      55             : //-----------------------------------------------------------------------------
      56             : // Method definitions for the IPDL type |union IPCRemoteStreamType|
      57             : //
      58             : namespace mozilla {
      59             : namespace ipc {
      60           0 : auto IPCRemoteStreamType::MaybeDestroy(Type aNewType) -> bool
      61             : {
      62           0 :     if ((mType) == (T__None)) {
      63           0 :         return true;
      64             :     }
      65           0 :     if ((mType) == (aNewType)) {
      66           0 :         return false;
      67             :     }
      68           0 :     switch (mType) {
      69             :     case TPChildToParentStreamParent:
      70             :         {
      71           0 :             (ptr_PChildToParentStreamParent())->~PChildToParentStreamParent__tdef();
      72           0 :             break;
      73             :         }
      74             :     case TPChildToParentStreamChild:
      75             :         {
      76           0 :             (ptr_PChildToParentStreamChild())->~PChildToParentStreamChild__tdef();
      77           0 :             break;
      78             :         }
      79             :     case TPParentToChildStreamParent:
      80             :         {
      81           0 :             (ptr_PParentToChildStreamParent())->~PParentToChildStreamParent__tdef();
      82           0 :             break;
      83             :         }
      84             :     case TPParentToChildStreamChild:
      85             :         {
      86           0 :             (ptr_PParentToChildStreamChild())->~PParentToChildStreamChild__tdef();
      87           0 :             break;
      88             :         }
      89             :     default:
      90             :         {
      91           0 :             mozilla::ipc::LogicError("not reached");
      92           0 :             break;
      93             :         }
      94             :     }
      95           0 :     return true;
      96             : }
      97             : 
      98           0 : MOZ_IMPLICIT IPCRemoteStreamType::IPCRemoteStreamType(PChildToParentStreamParent* aOther)
      99             : {
     100           0 :     new (mozilla::KnownNotNull, ptr_PChildToParentStreamParent()) PChildToParentStreamParent*(const_cast<PChildToParentStreamParent*>(aOther));
     101           0 :     mType = TPChildToParentStreamParent;
     102           0 : }
     103             : 
     104           0 : MOZ_IMPLICIT IPCRemoteStreamType::IPCRemoteStreamType(PChildToParentStreamChild* aOther)
     105             : {
     106           0 :     new (mozilla::KnownNotNull, ptr_PChildToParentStreamChild()) PChildToParentStreamChild*(const_cast<PChildToParentStreamChild*>(aOther));
     107           0 :     mType = TPChildToParentStreamChild;
     108           0 : }
     109             : 
     110           0 : MOZ_IMPLICIT IPCRemoteStreamType::IPCRemoteStreamType(PParentToChildStreamParent* aOther)
     111             : {
     112           0 :     new (mozilla::KnownNotNull, ptr_PParentToChildStreamParent()) PParentToChildStreamParent*(const_cast<PParentToChildStreamParent*>(aOther));
     113           0 :     mType = TPParentToChildStreamParent;
     114           0 : }
     115             : 
     116           0 : MOZ_IMPLICIT IPCRemoteStreamType::IPCRemoteStreamType(PParentToChildStreamChild* aOther)
     117             : {
     118           0 :     new (mozilla::KnownNotNull, ptr_PParentToChildStreamChild()) PParentToChildStreamChild*(const_cast<PParentToChildStreamChild*>(aOther));
     119           0 :     mType = TPParentToChildStreamChild;
     120           0 : }
     121             : 
     122           0 : MOZ_IMPLICIT IPCRemoteStreamType::IPCRemoteStreamType(const IPCRemoteStreamType& aOther)
     123             : {
     124           0 :     (aOther).AssertSanity();
     125           0 :     switch ((aOther).type()) {
     126             :     case TPChildToParentStreamParent:
     127             :         {
     128           0 :             new (mozilla::KnownNotNull, ptr_PChildToParentStreamParent()) PChildToParentStreamParent*(const_cast<PChildToParentStreamParent*>((aOther).get_PChildToParentStreamParent()));
     129           0 :             break;
     130             :         }
     131             :     case TPChildToParentStreamChild:
     132             :         {
     133           0 :             new (mozilla::KnownNotNull, ptr_PChildToParentStreamChild()) PChildToParentStreamChild*(const_cast<PChildToParentStreamChild*>((aOther).get_PChildToParentStreamChild()));
     134           0 :             break;
     135             :         }
     136             :     case TPParentToChildStreamParent:
     137             :         {
     138           0 :             new (mozilla::KnownNotNull, ptr_PParentToChildStreamParent()) PParentToChildStreamParent*(const_cast<PParentToChildStreamParent*>((aOther).get_PParentToChildStreamParent()));
     139           0 :             break;
     140             :         }
     141             :     case TPParentToChildStreamChild:
     142             :         {
     143           0 :             new (mozilla::KnownNotNull, ptr_PParentToChildStreamChild()) PParentToChildStreamChild*(const_cast<PParentToChildStreamChild*>((aOther).get_PParentToChildStreamChild()));
     144           0 :             break;
     145             :         }
     146             :     case T__None:
     147             :         {
     148           0 :             break;
     149             :         }
     150             :     default:
     151             :         {
     152           0 :             mozilla::ipc::LogicError("unreached");
     153           0 :             return;
     154             :         }
     155             :     }
     156           0 :     mType = (aOther).type();
     157             : }
     158             : 
     159           0 : IPCRemoteStreamType::~IPCRemoteStreamType()
     160             : {
     161           0 :     static_cast<void>(MaybeDestroy(T__None));
     162           0 : }
     163             : 
     164           0 : auto IPCRemoteStreamType::operator=(PChildToParentStreamParent* aRhs) -> IPCRemoteStreamType&
     165             : {
     166           0 :     if (MaybeDestroy(TPChildToParentStreamParent)) {
     167           0 :         new (mozilla::KnownNotNull, ptr_PChildToParentStreamParent()) PChildToParentStreamParent*;
     168             :     }
     169           0 :     (*(ptr_PChildToParentStreamParent())) = const_cast<PChildToParentStreamParent*>(aRhs);
     170           0 :     mType = TPChildToParentStreamParent;
     171           0 :     return (*(this));
     172             : }
     173             : 
     174           0 : auto IPCRemoteStreamType::operator=(PChildToParentStreamChild* aRhs) -> IPCRemoteStreamType&
     175             : {
     176           0 :     if (MaybeDestroy(TPChildToParentStreamChild)) {
     177           0 :         new (mozilla::KnownNotNull, ptr_PChildToParentStreamChild()) PChildToParentStreamChild*;
     178             :     }
     179           0 :     (*(ptr_PChildToParentStreamChild())) = const_cast<PChildToParentStreamChild*>(aRhs);
     180           0 :     mType = TPChildToParentStreamChild;
     181           0 :     return (*(this));
     182             : }
     183             : 
     184           0 : auto IPCRemoteStreamType::operator=(PParentToChildStreamParent* aRhs) -> IPCRemoteStreamType&
     185             : {
     186           0 :     if (MaybeDestroy(TPParentToChildStreamParent)) {
     187           0 :         new (mozilla::KnownNotNull, ptr_PParentToChildStreamParent()) PParentToChildStreamParent*;
     188             :     }
     189           0 :     (*(ptr_PParentToChildStreamParent())) = const_cast<PParentToChildStreamParent*>(aRhs);
     190           0 :     mType = TPParentToChildStreamParent;
     191           0 :     return (*(this));
     192             : }
     193             : 
     194           0 : auto IPCRemoteStreamType::operator=(PParentToChildStreamChild* aRhs) -> IPCRemoteStreamType&
     195             : {
     196           0 :     if (MaybeDestroy(TPParentToChildStreamChild)) {
     197           0 :         new (mozilla::KnownNotNull, ptr_PParentToChildStreamChild()) PParentToChildStreamChild*;
     198             :     }
     199           0 :     (*(ptr_PParentToChildStreamChild())) = const_cast<PParentToChildStreamChild*>(aRhs);
     200           0 :     mType = TPParentToChildStreamChild;
     201           0 :     return (*(this));
     202             : }
     203             : 
     204           0 : auto IPCRemoteStreamType::operator=(const IPCRemoteStreamType& aRhs) -> IPCRemoteStreamType&
     205             : {
     206           0 :     (aRhs).AssertSanity();
     207           0 :     Type t = (aRhs).type();
     208           0 :     switch (t) {
     209             :     case TPChildToParentStreamParent:
     210             :         {
     211           0 :             if (MaybeDestroy(t)) {
     212           0 :                 new (mozilla::KnownNotNull, ptr_PChildToParentStreamParent()) PChildToParentStreamParent*;
     213             :             }
     214           0 :             (*(ptr_PChildToParentStreamParent())) = const_cast<PChildToParentStreamParent*>((aRhs).get_PChildToParentStreamParent());
     215           0 :             break;
     216             :         }
     217             :     case TPChildToParentStreamChild:
     218             :         {
     219           0 :             if (MaybeDestroy(t)) {
     220           0 :                 new (mozilla::KnownNotNull, ptr_PChildToParentStreamChild()) PChildToParentStreamChild*;
     221             :             }
     222           0 :             (*(ptr_PChildToParentStreamChild())) = const_cast<PChildToParentStreamChild*>((aRhs).get_PChildToParentStreamChild());
     223           0 :             break;
     224             :         }
     225             :     case TPParentToChildStreamParent:
     226             :         {
     227           0 :             if (MaybeDestroy(t)) {
     228           0 :                 new (mozilla::KnownNotNull, ptr_PParentToChildStreamParent()) PParentToChildStreamParent*;
     229             :             }
     230           0 :             (*(ptr_PParentToChildStreamParent())) = const_cast<PParentToChildStreamParent*>((aRhs).get_PParentToChildStreamParent());
     231           0 :             break;
     232             :         }
     233             :     case TPParentToChildStreamChild:
     234             :         {
     235           0 :             if (MaybeDestroy(t)) {
     236           0 :                 new (mozilla::KnownNotNull, ptr_PParentToChildStreamChild()) PParentToChildStreamChild*;
     237             :             }
     238           0 :             (*(ptr_PParentToChildStreamChild())) = const_cast<PParentToChildStreamChild*>((aRhs).get_PParentToChildStreamChild());
     239           0 :             break;
     240             :         }
     241             :     case T__None:
     242             :         {
     243           0 :             static_cast<void>(MaybeDestroy(t));
     244           0 :             break;
     245             :         }
     246             :     default:
     247             :         {
     248           0 :             mozilla::ipc::LogicError("unreached");
     249           0 :             break;
     250             :         }
     251             :     }
     252           0 :     mType = t;
     253           0 :     return (*(this));
     254             : }
     255             : 
     256           0 : auto IPCRemoteStreamType::operator==(PChildToParentStreamParent* aRhs) const -> bool
     257             : {
     258           0 :     return (get_PChildToParentStreamParent()) == (aRhs);
     259             : }
     260             : 
     261           0 : auto IPCRemoteStreamType::operator==(PChildToParentStreamChild* aRhs) const -> bool
     262             : {
     263           0 :     return (get_PChildToParentStreamChild()) == (aRhs);
     264             : }
     265             : 
     266           0 : auto IPCRemoteStreamType::operator==(PParentToChildStreamParent* aRhs) const -> bool
     267             : {
     268           0 :     return (get_PParentToChildStreamParent()) == (aRhs);
     269             : }
     270             : 
     271           0 : auto IPCRemoteStreamType::operator==(PParentToChildStreamChild* aRhs) const -> bool
     272             : {
     273           0 :     return (get_PParentToChildStreamChild()) == (aRhs);
     274             : }
     275             : 
     276           0 : auto IPCRemoteStreamType::operator==(const IPCRemoteStreamType& aRhs) const -> bool
     277             : {
     278           0 :     if ((type()) != ((aRhs).type())) {
     279           0 :         return false;
     280             :     }
     281             : 
     282           0 :     switch (type()) {
     283             :     case TPChildToParentStreamParent:
     284             :         {
     285           0 :             return (get_PChildToParentStreamParent()) == ((aRhs).get_PChildToParentStreamParent());
     286             :         }
     287             :     case TPChildToParentStreamChild:
     288             :         {
     289           0 :             return (get_PChildToParentStreamChild()) == ((aRhs).get_PChildToParentStreamChild());
     290             :         }
     291             :     case TPParentToChildStreamParent:
     292             :         {
     293           0 :             return (get_PParentToChildStreamParent()) == ((aRhs).get_PParentToChildStreamParent());
     294             :         }
     295             :     case TPParentToChildStreamChild:
     296             :         {
     297           0 :             return (get_PParentToChildStreamChild()) == ((aRhs).get_PParentToChildStreamChild());
     298             :         }
     299             :     default:
     300             :         {
     301           0 :             mozilla::ipc::LogicError("unreached");
     302           0 :             return false;
     303             :         }
     304             :     }
     305             : }
     306             : 
     307           0 : auto IPCRemoteStreamType::get(PChildToParentStreamParent** aOutValue) const -> void
     308             : {
     309           0 :     (*(aOutValue)) = get_PChildToParentStreamParent();
     310           0 : }
     311             : 
     312           0 : auto IPCRemoteStreamType::get(PChildToParentStreamChild** aOutValue) const -> void
     313             : {
     314           0 :     (*(aOutValue)) = get_PChildToParentStreamChild();
     315           0 : }
     316             : 
     317           0 : auto IPCRemoteStreamType::get(PParentToChildStreamParent** aOutValue) const -> void
     318             : {
     319           0 :     (*(aOutValue)) = get_PParentToChildStreamParent();
     320           0 : }
     321             : 
     322           0 : auto IPCRemoteStreamType::get(PParentToChildStreamChild** aOutValue) const -> void
     323             : {
     324           0 :     (*(aOutValue)) = get_PParentToChildStreamChild();
     325           0 : }
     326             : 
     327             : } // namespace ipc
     328             : } // namespace mozilla
     329             : 
     330             : //-----------------------------------------------------------------------------
     331             : // Method definitions for the IPDL type |struct IPCRemoteStream|
     332             : //
     333             : namespace mozilla {
     334             : namespace ipc {
     335           0 : MOZ_IMPLICIT IPCRemoteStream::IPCRemoteStream() :
     336           0 :     delayedStart_()
     337             : {
     338           0 :     Init();
     339           0 : }
     340             : 
     341           0 : IPCRemoteStream::~IPCRemoteStream()
     342             : {
     343           0 : }
     344             : 
     345           0 : auto IPCRemoteStream::operator==(const IPCRemoteStream& _o) const -> bool
     346             : {
     347           0 :     if ((!((delayedStart()) == ((_o).delayedStart())))) {
     348           0 :         return false;
     349             :     }
     350           0 :     if ((!((stream()) == ((_o).stream())))) {
     351           0 :         return false;
     352             :     }
     353           0 :     return true;
     354             : }
     355             : 
     356           0 : auto IPCRemoteStream::operator!=(const IPCRemoteStream& _o) const -> bool
     357             : {
     358           0 :     return (!(operator==(_o)));
     359             : }
     360             : 
     361           0 : auto IPCRemoteStream::Init() -> void
     362             : {
     363           0 : }
     364             : 
     365           0 : auto IPCRemoteStream::Assign(
     366             :         const bool& _delayedStart,
     367             :         const IPCRemoteStreamType& _stream) -> void
     368             : {
     369           0 :     delayedStart_ = _delayedStart;
     370           0 :     stream_ = _stream;
     371           0 : }
     372             : 
     373             : } // namespace ipc
     374             : } // namespace mozilla
     375             : 
     376             : //-----------------------------------------------------------------------------
     377             : // Method definitions for the IPDL type |union IPCStream|
     378             : //
     379             : namespace mozilla {
     380             : namespace ipc {
     381           0 : auto IPCStream::MaybeDestroy(Type aNewType) -> bool
     382             : {
     383           0 :     if ((mType) == (T__None)) {
     384           0 :         return true;
     385             :     }
     386           0 :     if ((mType) == (aNewType)) {
     387           0 :         return false;
     388             :     }
     389           0 :     switch (mType) {
     390             :     case TInputStreamParamsWithFds:
     391             :         {
     392           0 :             (ptr_InputStreamParamsWithFds())->~InputStreamParamsWithFds__tdef();
     393           0 :             break;
     394             :         }
     395             :     case TIPCRemoteStream:
     396             :         {
     397           0 :             (ptr_IPCRemoteStream())->~IPCRemoteStream__tdef();
     398           0 :             break;
     399             :         }
     400             :     default:
     401             :         {
     402           0 :             mozilla::ipc::LogicError("not reached");
     403           0 :             break;
     404             :         }
     405             :     }
     406           0 :     return true;
     407             : }
     408             : 
     409           0 : MOZ_IMPLICIT IPCStream::IPCStream(const InputStreamParamsWithFds& aOther)
     410             : {
     411           0 :     new (mozilla::KnownNotNull, ptr_InputStreamParamsWithFds()) InputStreamParamsWithFds(aOther);
     412           0 :     mType = TInputStreamParamsWithFds;
     413           0 : }
     414             : 
     415           0 : MOZ_IMPLICIT IPCStream::IPCStream(const IPCRemoteStream& aOther)
     416             : {
     417           0 :     new (mozilla::KnownNotNull, ptr_IPCRemoteStream()) IPCRemoteStream(aOther);
     418           0 :     mType = TIPCRemoteStream;
     419           0 : }
     420             : 
     421           0 : MOZ_IMPLICIT IPCStream::IPCStream(const IPCStream& aOther)
     422             : {
     423           0 :     (aOther).AssertSanity();
     424           0 :     switch ((aOther).type()) {
     425             :     case TInputStreamParamsWithFds:
     426             :         {
     427           0 :             new (mozilla::KnownNotNull, ptr_InputStreamParamsWithFds()) InputStreamParamsWithFds((aOther).get_InputStreamParamsWithFds());
     428           0 :             break;
     429             :         }
     430             :     case TIPCRemoteStream:
     431             :         {
     432           0 :             new (mozilla::KnownNotNull, ptr_IPCRemoteStream()) IPCRemoteStream((aOther).get_IPCRemoteStream());
     433           0 :             break;
     434             :         }
     435             :     case T__None:
     436             :         {
     437           0 :             break;
     438             :         }
     439             :     default:
     440             :         {
     441           0 :             mozilla::ipc::LogicError("unreached");
     442           0 :             return;
     443             :         }
     444             :     }
     445           0 :     mType = (aOther).type();
     446             : }
     447             : 
     448           0 : IPCStream::~IPCStream()
     449             : {
     450           0 :     static_cast<void>(MaybeDestroy(T__None));
     451           0 : }
     452             : 
     453           0 : auto IPCStream::operator=(const InputStreamParamsWithFds& aRhs) -> IPCStream&
     454             : {
     455           0 :     if (MaybeDestroy(TInputStreamParamsWithFds)) {
     456           0 :         new (mozilla::KnownNotNull, ptr_InputStreamParamsWithFds()) InputStreamParamsWithFds;
     457             :     }
     458           0 :     (*(ptr_InputStreamParamsWithFds())) = aRhs;
     459           0 :     mType = TInputStreamParamsWithFds;
     460           0 :     return (*(this));
     461             : }
     462             : 
     463           0 : auto IPCStream::operator=(const IPCRemoteStream& aRhs) -> IPCStream&
     464             : {
     465           0 :     if (MaybeDestroy(TIPCRemoteStream)) {
     466           0 :         new (mozilla::KnownNotNull, ptr_IPCRemoteStream()) IPCRemoteStream;
     467             :     }
     468           0 :     (*(ptr_IPCRemoteStream())) = aRhs;
     469           0 :     mType = TIPCRemoteStream;
     470           0 :     return (*(this));
     471             : }
     472             : 
     473           0 : auto IPCStream::operator=(const IPCStream& aRhs) -> IPCStream&
     474             : {
     475           0 :     (aRhs).AssertSanity();
     476           0 :     Type t = (aRhs).type();
     477           0 :     switch (t) {
     478             :     case TInputStreamParamsWithFds:
     479             :         {
     480           0 :             if (MaybeDestroy(t)) {
     481           0 :                 new (mozilla::KnownNotNull, ptr_InputStreamParamsWithFds()) InputStreamParamsWithFds;
     482             :             }
     483           0 :             (*(ptr_InputStreamParamsWithFds())) = (aRhs).get_InputStreamParamsWithFds();
     484           0 :             break;
     485             :         }
     486             :     case TIPCRemoteStream:
     487             :         {
     488           0 :             if (MaybeDestroy(t)) {
     489           0 :                 new (mozilla::KnownNotNull, ptr_IPCRemoteStream()) IPCRemoteStream;
     490             :             }
     491           0 :             (*(ptr_IPCRemoteStream())) = (aRhs).get_IPCRemoteStream();
     492           0 :             break;
     493             :         }
     494             :     case T__None:
     495             :         {
     496           0 :             static_cast<void>(MaybeDestroy(t));
     497           0 :             break;
     498             :         }
     499             :     default:
     500             :         {
     501           0 :             mozilla::ipc::LogicError("unreached");
     502           0 :             break;
     503             :         }
     504             :     }
     505           0 :     mType = t;
     506           0 :     return (*(this));
     507             : }
     508             : 
     509           0 : auto IPCStream::operator==(const InputStreamParamsWithFds& aRhs) const -> bool
     510             : {
     511           0 :     return (get_InputStreamParamsWithFds()) == (aRhs);
     512             : }
     513             : 
     514           0 : auto IPCStream::operator==(const IPCRemoteStream& aRhs) const -> bool
     515             : {
     516           0 :     return (get_IPCRemoteStream()) == (aRhs);
     517             : }
     518             : 
     519           0 : auto IPCStream::operator==(const IPCStream& aRhs) const -> bool
     520             : {
     521           0 :     if ((type()) != ((aRhs).type())) {
     522           0 :         return false;
     523             :     }
     524             : 
     525           0 :     switch (type()) {
     526             :     case TInputStreamParamsWithFds:
     527             :         {
     528           0 :             return (get_InputStreamParamsWithFds()) == ((aRhs).get_InputStreamParamsWithFds());
     529             :         }
     530             :     case TIPCRemoteStream:
     531             :         {
     532           0 :             return (get_IPCRemoteStream()) == ((aRhs).get_IPCRemoteStream());
     533             :         }
     534             :     default:
     535             :         {
     536           0 :             mozilla::ipc::LogicError("unreached");
     537           0 :             return false;
     538             :         }
     539             :     }
     540             : }
     541             : 
     542           0 : auto IPCStream::get(InputStreamParamsWithFds* aOutValue) const -> void
     543             : {
     544           0 :     (*(aOutValue)) = get_InputStreamParamsWithFds();
     545           0 : }
     546             : 
     547           0 : auto IPCStream::get(IPCRemoteStream* aOutValue) const -> void
     548             : {
     549           0 :     (*(aOutValue)) = get_IPCRemoteStream();
     550           0 : }
     551             : 
     552             : } // namespace ipc
     553             : } // namespace mozilla
     554             : 
     555             : //-----------------------------------------------------------------------------
     556             : // Method definitions for the IPDL type |union OptionalIPCStream|
     557             : //
     558             : namespace mozilla {
     559             : namespace ipc {
     560          27 : auto OptionalIPCStream::MaybeDestroy(Type aNewType) -> bool
     561             : {
     562          27 :     if ((mType) == (T__None)) {
     563          15 :         return true;
     564             :     }
     565          12 :     if ((mType) == (aNewType)) {
     566           0 :         return false;
     567             :     }
     568          12 :     switch (mType) {
     569             :     case TIPCStream:
     570             :         {
     571           0 :             (ptr_IPCStream())->~IPCStream__tdef();
     572           0 :             break;
     573             :         }
     574             :     case Tvoid_t:
     575             :         {
     576          12 :             (ptr_void_t())->~void_t__tdef();
     577          12 :             break;
     578             :         }
     579             :     default:
     580             :         {
     581           0 :             mozilla::ipc::LogicError("not reached");
     582           0 :             break;
     583             :         }
     584             :     }
     585          12 :     return true;
     586             : }
     587             : 
     588           0 : MOZ_IMPLICIT OptionalIPCStream::OptionalIPCStream(const IPCStream& aOther)
     589             : {
     590           0 :     new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream(aOther);
     591           0 :     mType = TIPCStream;
     592           0 : }
     593             : 
     594           3 : MOZ_IMPLICIT OptionalIPCStream::OptionalIPCStream(const void_t& aOther)
     595             : {
     596           3 :     new (mozilla::KnownNotNull, ptr_void_t()) void_t(aOther);
     597           3 :     mType = Tvoid_t;
     598           3 : }
     599             : 
     600           0 : MOZ_IMPLICIT OptionalIPCStream::OptionalIPCStream(const OptionalIPCStream& aOther)
     601             : {
     602           0 :     (aOther).AssertSanity();
     603           0 :     switch ((aOther).type()) {
     604             :     case TIPCStream:
     605             :         {
     606           0 :             new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream((aOther).get_IPCStream());
     607           0 :             break;
     608             :         }
     609             :     case Tvoid_t:
     610             :         {
     611           0 :             new (mozilla::KnownNotNull, ptr_void_t()) void_t((aOther).get_void_t());
     612           0 :             break;
     613             :         }
     614             :     case T__None:
     615             :         {
     616           0 :             break;
     617             :         }
     618             :     default:
     619             :         {
     620           0 :             mozilla::ipc::LogicError("unreached");
     621           0 :             return;
     622             :         }
     623             :     }
     624           0 :     mType = (aOther).type();
     625             : }
     626             : 
     627          30 : OptionalIPCStream::~OptionalIPCStream()
     628             : {
     629          15 :     static_cast<void>(MaybeDestroy(T__None));
     630          15 : }
     631             : 
     632           0 : auto OptionalIPCStream::operator=(const IPCStream& aRhs) -> OptionalIPCStream&
     633             : {
     634           0 :     if (MaybeDestroy(TIPCStream)) {
     635           0 :         new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream;
     636             :     }
     637           0 :     (*(ptr_IPCStream())) = aRhs;
     638           0 :     mType = TIPCStream;
     639           0 :     return (*(this));
     640             : }
     641             : 
     642           6 : auto OptionalIPCStream::operator=(const void_t& aRhs) -> OptionalIPCStream&
     643             : {
     644           6 :     if (MaybeDestroy(Tvoid_t)) {
     645           6 :         new (mozilla::KnownNotNull, ptr_void_t()) void_t;
     646             :     }
     647           6 :     (*(ptr_void_t())) = aRhs;
     648           6 :     mType = Tvoid_t;
     649           6 :     return (*(this));
     650             : }
     651             : 
     652           6 : auto OptionalIPCStream::operator=(const OptionalIPCStream& aRhs) -> OptionalIPCStream&
     653             : {
     654           6 :     (aRhs).AssertSanity();
     655           6 :     Type t = (aRhs).type();
     656           6 :     switch (t) {
     657             :     case TIPCStream:
     658             :         {
     659           0 :             if (MaybeDestroy(t)) {
     660           0 :                 new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream;
     661             :             }
     662           0 :             (*(ptr_IPCStream())) = (aRhs).get_IPCStream();
     663           0 :             break;
     664             :         }
     665             :     case Tvoid_t:
     666             :         {
     667           3 :             if (MaybeDestroy(t)) {
     668           3 :                 new (mozilla::KnownNotNull, ptr_void_t()) void_t;
     669             :             }
     670           3 :             (*(ptr_void_t())) = (aRhs).get_void_t();
     671           3 :             break;
     672             :         }
     673             :     case T__None:
     674             :         {
     675           3 :             static_cast<void>(MaybeDestroy(t));
     676           3 :             break;
     677             :         }
     678             :     default:
     679             :         {
     680           0 :             mozilla::ipc::LogicError("unreached");
     681           0 :             break;
     682             :         }
     683             :     }
     684           6 :     mType = t;
     685           6 :     return (*(this));
     686             : }
     687             : 
     688           0 : auto OptionalIPCStream::operator==(const IPCStream& aRhs) const -> bool
     689             : {
     690           0 :     return (get_IPCStream()) == (aRhs);
     691             : }
     692             : 
     693           0 : auto OptionalIPCStream::operator==(const void_t& aRhs) const -> bool
     694             : {
     695           0 :     return (get_void_t()) == (aRhs);
     696             : }
     697             : 
     698           0 : auto OptionalIPCStream::operator==(const OptionalIPCStream& aRhs) const -> bool
     699             : {
     700           0 :     if ((type()) != ((aRhs).type())) {
     701           0 :         return false;
     702             :     }
     703             : 
     704           0 :     switch (type()) {
     705             :     case TIPCStream:
     706             :         {
     707           0 :             return (get_IPCStream()) == ((aRhs).get_IPCStream());
     708             :         }
     709             :     case Tvoid_t:
     710             :         {
     711           0 :             return (get_void_t()) == ((aRhs).get_void_t());
     712             :         }
     713             :     default:
     714             :         {
     715           0 :             mozilla::ipc::LogicError("unreached");
     716           0 :             return false;
     717             :         }
     718             :     }
     719             : }
     720             : 
     721           0 : auto OptionalIPCStream::get(IPCStream* aOutValue) const -> void
     722             : {
     723           0 :     (*(aOutValue)) = get_IPCStream();
     724           0 : }
     725             : 
     726           0 : auto OptionalIPCStream::get(void_t* aOutValue) const -> void
     727             : {
     728           0 :     (*(aOutValue)) = get_void_t();
     729           0 : }
     730             : 
     731             : } // namespace ipc
     732             : } // namespace mozilla

Generated by: LCOV version 1.13