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

       1                 : //
       2                 : // Automatically generated by ipdlc.
       3                 : // Edit at your own risk
       4                 : //
       5                 : 
       6                 : 
       7                 : #include "mozilla/plugins/PPluginInstance.h"
       8                 : 
       9                 : namespace mozilla {
      10                 : namespace plugins {
      11                 : namespace PPluginInstance {
      12                 : 
      13                 : bool
      14               0 : Transition(
      15                 :         State from,
      16                 :         mozilla::ipc::Trigger trigger,
      17                 :         State* next)
      18                 : {
      19               0 :     switch (from) {
      20                 :     case __Null:
      21                 :     case __Error:
      22               0 :         if ((Msg___delete____ID) == ((trigger).mMsg)) {
      23               0 :             (*(next)) = __Dead;
      24               0 :             return true;
      25                 :         }
      26               0 :         return (__Null) == (from);
      27                 :     case __Dead:
      28               0 :         NS_RUNTIMEABORT("__delete__()d actor");
      29               0 :         return false;
      30                 :     default:
      31               0 :         NS_RUNTIMEABORT("corrupted actor state");
      32               0 :         return false;
      33                 :     }
      34                 :     (*(next)) = __Error;
      35                 :     return false;
      36                 : }
      37                 : 
      38                 : } // namespace PPluginInstance
      39                 : } // namespace plugins
      40                 : } // namespace mozilla
      41                 : 
      42                 : //-----------------------------------------------------------------------------
      43                 : // Method definitions for the IPDL type |struct IOSurfaceDescriptor|
      44                 : //
      45                 : namespace mozilla {
      46                 : namespace plugins {
      47               0 : IOSurfaceDescriptor::IOSurfaceDescriptor()
      48                 : {
      49               0 :     Init();
      50               0 : }
      51                 : 
      52               0 : IOSurfaceDescriptor::~IOSurfaceDescriptor()
      53                 : {
      54               0 : }
      55                 : 
      56                 : bool
      57               0 : IOSurfaceDescriptor::operator==(const IOSurfaceDescriptor& _o) const
      58                 : {
      59               0 :     if ((!((surfaceId()) == ((_o).surfaceId())))) {
      60               0 :         return false;
      61                 :     }
      62               0 :     return true;
      63                 : }
      64                 : 
      65                 : void
      66               0 : IOSurfaceDescriptor::Init()
      67                 : {
      68               0 : }
      69                 : 
      70                 : void
      71               0 : IOSurfaceDescriptor::Assign(const uint32_t& _surfaceId)
      72                 : {
      73               0 :     surfaceId_ = _surfaceId;
      74               0 : }
      75                 : 
      76                 : } // namespace plugins
      77                 : } // namespace mozilla
      78                 : 
      79                 : //-----------------------------------------------------------------------------
      80                 : // Method definitions for the IPDL type |union SurfaceDescriptor|
      81                 : //
      82                 : namespace mozilla {
      83                 : namespace plugins {
      84                 : bool
      85               0 : SurfaceDescriptor::MaybeDestroy(Type aNewType)
      86                 : {
      87               0 :     if ((mType) == (T__None)) {
      88               0 :         return true;
      89                 :     }
      90               0 :     if ((mType) == (aNewType)) {
      91               0 :         return false;
      92                 :     }
      93               0 :     switch (mType) {
      94                 :     case TShmem:
      95                 :         {
      96               0 :             (ptr_Shmem())->~Shmem__tdef();
      97               0 :             break;
      98                 :         }
      99                 :     case TSurfaceDescriptorX11:
     100                 :         {
     101               0 :             (ptr_SurfaceDescriptorX11())->~SurfaceDescriptorX11__tdef();
     102               0 :             break;
     103                 :         }
     104                 :     case TPPluginSurfaceParent:
     105                 :         {
     106               0 :             (ptr_PPluginSurfaceParent())->~PPluginSurfaceParent__tdef();
     107               0 :             break;
     108                 :         }
     109                 :     case TPPluginSurfaceChild:
     110                 :         {
     111               0 :             (ptr_PPluginSurfaceChild())->~PPluginSurfaceChild__tdef();
     112               0 :             break;
     113                 :         }
     114                 :     case TIOSurfaceDescriptor:
     115                 :         {
     116               0 :             (ptr_IOSurfaceDescriptor())->~IOSurfaceDescriptor__tdef();
     117               0 :             break;
     118                 :         }
     119                 :     case Tnull_t:
     120                 :         {
     121               0 :             (ptr_null_t())->~null_t__tdef();
     122               0 :             break;
     123                 :         }
     124                 :     default:
     125                 :         {
     126               0 :             NS_RUNTIMEABORT("not reached");
     127               0 :             break;
     128                 :         }
     129                 :     }
     130               0 :     return true;
     131                 : }
     132                 : 
     133               0 : SurfaceDescriptor::SurfaceDescriptor(Shmem& aOther)
     134                 : {
     135               0 :     new (ptr_Shmem()) Shmem(aOther);
     136               0 :     mType = TShmem;
     137               0 : }
     138                 : 
     139               0 : SurfaceDescriptor::SurfaceDescriptor(const SurfaceDescriptorX11& aOther)
     140                 : {
     141               0 :     new (ptr_SurfaceDescriptorX11()) SurfaceDescriptorX11(aOther);
     142               0 :     mType = TSurfaceDescriptorX11;
     143               0 : }
     144                 : 
     145               0 : SurfaceDescriptor::SurfaceDescriptor(PPluginSurfaceParent* aOther)
     146                 : {
     147               0 :     new (ptr_PPluginSurfaceParent()) PPluginSurfaceParent*(const_cast<PPluginSurfaceParent*>(aOther));
     148               0 :     mType = TPPluginSurfaceParent;
     149               0 : }
     150                 : 
     151               0 : SurfaceDescriptor::SurfaceDescriptor(PPluginSurfaceChild* aOther)
     152                 : {
     153               0 :     new (ptr_PPluginSurfaceChild()) PPluginSurfaceChild*(const_cast<PPluginSurfaceChild*>(aOther));
     154               0 :     mType = TPPluginSurfaceChild;
     155               0 : }
     156                 : 
     157               0 : SurfaceDescriptor::SurfaceDescriptor(const IOSurfaceDescriptor& aOther)
     158                 : {
     159               0 :     new (ptr_IOSurfaceDescriptor()) IOSurfaceDescriptor(aOther);
     160               0 :     mType = TIOSurfaceDescriptor;
     161               0 : }
     162                 : 
     163               0 : SurfaceDescriptor::SurfaceDescriptor(const null_t& aOther)
     164                 : {
     165               0 :     new (ptr_null_t()) null_t(aOther);
     166               0 :     mType = Tnull_t;
     167               0 : }
     168                 : 
     169               0 : SurfaceDescriptor::SurfaceDescriptor(const SurfaceDescriptor& aOther)
     170                 : {
     171               0 :     (aOther).AssertSanity();
     172               0 :     switch ((aOther).type()) {
     173                 :     case TShmem:
     174                 :         {
     175               0 :             new (ptr_Shmem()) Shmem((aOther).get_Shmem());
     176               0 :             break;
     177                 :         }
     178                 :     case TSurfaceDescriptorX11:
     179                 :         {
     180               0 :             new (ptr_SurfaceDescriptorX11()) SurfaceDescriptorX11((aOther).get_SurfaceDescriptorX11());
     181               0 :             break;
     182                 :         }
     183                 :     case TPPluginSurfaceParent:
     184                 :         {
     185               0 :             new (ptr_PPluginSurfaceParent()) PPluginSurfaceParent*(const_cast<PPluginSurfaceParent*>((aOther).get_PPluginSurfaceParent()));
     186               0 :             break;
     187                 :         }
     188                 :     case TPPluginSurfaceChild:
     189                 :         {
     190               0 :             new (ptr_PPluginSurfaceChild()) PPluginSurfaceChild*(const_cast<PPluginSurfaceChild*>((aOther).get_PPluginSurfaceChild()));
     191               0 :             break;
     192                 :         }
     193                 :     case TIOSurfaceDescriptor:
     194                 :         {
     195               0 :             new (ptr_IOSurfaceDescriptor()) IOSurfaceDescriptor((aOther).get_IOSurfaceDescriptor());
     196               0 :             break;
     197                 :         }
     198                 :     case Tnull_t:
     199                 :         {
     200               0 :             new (ptr_null_t()) null_t((aOther).get_null_t());
     201               0 :             break;
     202                 :         }
     203                 :     case T__None:
     204                 :         {
     205               0 :             break;
     206                 :         }
     207                 :     default:
     208                 :         {
     209               0 :             NS_RUNTIMEABORT("unreached");
     210               0 :             return;
     211                 :         }
     212                 :     }
     213               0 :     mType = (aOther).type();
     214                 : }
     215                 : 
     216               0 : SurfaceDescriptor::~SurfaceDescriptor()
     217                 : {
     218               0 :     MaybeDestroy(T__None);
     219               0 : }
     220                 : 
     221                 : SurfaceDescriptor&
     222               0 : SurfaceDescriptor::operator=(Shmem& aRhs)
     223                 : {
     224               0 :     if (MaybeDestroy(TShmem)) {
     225               0 :         new (ptr_Shmem()) Shmem;
     226                 :     }
     227               0 :     (*(ptr_Shmem())) = aRhs;
     228               0 :     mType = TShmem;
     229               0 :     return (*(this));
     230                 : }
     231                 : 
     232                 : SurfaceDescriptor&
     233               0 : SurfaceDescriptor::operator=(const SurfaceDescriptorX11& aRhs)
     234                 : {
     235               0 :     if (MaybeDestroy(TSurfaceDescriptorX11)) {
     236               0 :         new (ptr_SurfaceDescriptorX11()) SurfaceDescriptorX11;
     237                 :     }
     238               0 :     (*(ptr_SurfaceDescriptorX11())) = aRhs;
     239               0 :     mType = TSurfaceDescriptorX11;
     240               0 :     return (*(this));
     241                 : }
     242                 : 
     243                 : SurfaceDescriptor&
     244               0 : SurfaceDescriptor::operator=(PPluginSurfaceParent* aRhs)
     245                 : {
     246               0 :     if (MaybeDestroy(TPPluginSurfaceParent)) {
     247               0 :         new (ptr_PPluginSurfaceParent()) PPluginSurfaceParent*;
     248                 :     }
     249               0 :     (*(ptr_PPluginSurfaceParent())) = const_cast<PPluginSurfaceParent*>(aRhs);
     250               0 :     mType = TPPluginSurfaceParent;
     251               0 :     return (*(this));
     252                 : }
     253                 : 
     254                 : SurfaceDescriptor&
     255               0 : SurfaceDescriptor::operator=(PPluginSurfaceChild* aRhs)
     256                 : {
     257               0 :     if (MaybeDestroy(TPPluginSurfaceChild)) {
     258               0 :         new (ptr_PPluginSurfaceChild()) PPluginSurfaceChild*;
     259                 :     }
     260               0 :     (*(ptr_PPluginSurfaceChild())) = const_cast<PPluginSurfaceChild*>(aRhs);
     261               0 :     mType = TPPluginSurfaceChild;
     262               0 :     return (*(this));
     263                 : }
     264                 : 
     265                 : SurfaceDescriptor&
     266               0 : SurfaceDescriptor::operator=(const IOSurfaceDescriptor& aRhs)
     267                 : {
     268               0 :     if (MaybeDestroy(TIOSurfaceDescriptor)) {
     269               0 :         new (ptr_IOSurfaceDescriptor()) IOSurfaceDescriptor;
     270                 :     }
     271               0 :     (*(ptr_IOSurfaceDescriptor())) = aRhs;
     272               0 :     mType = TIOSurfaceDescriptor;
     273               0 :     return (*(this));
     274                 : }
     275                 : 
     276                 : SurfaceDescriptor&
     277               0 : SurfaceDescriptor::operator=(const null_t& aRhs)
     278                 : {
     279               0 :     if (MaybeDestroy(Tnull_t)) {
     280               0 :         new (ptr_null_t()) null_t;
     281                 :     }
     282               0 :     (*(ptr_null_t())) = aRhs;
     283               0 :     mType = Tnull_t;
     284               0 :     return (*(this));
     285                 : }
     286                 : 
     287                 : SurfaceDescriptor&
     288               0 : SurfaceDescriptor::operator=(const SurfaceDescriptor& aRhs)
     289                 : {
     290               0 :     (aRhs).AssertSanity();
     291               0 :     Type t = (aRhs).type();
     292               0 :     switch (t) {
     293                 :     case TShmem:
     294                 :         {
     295               0 :             if (MaybeDestroy(t)) {
     296               0 :                 new (ptr_Shmem()) Shmem;
     297                 :             }
     298               0 :             (*(ptr_Shmem())) = (aRhs).get_Shmem();
     299               0 :             break;
     300                 :         }
     301                 :     case TSurfaceDescriptorX11:
     302                 :         {
     303               0 :             if (MaybeDestroy(t)) {
     304               0 :                 new (ptr_SurfaceDescriptorX11()) SurfaceDescriptorX11;
     305                 :             }
     306               0 :             (*(ptr_SurfaceDescriptorX11())) = (aRhs).get_SurfaceDescriptorX11();
     307               0 :             break;
     308                 :         }
     309                 :     case TPPluginSurfaceParent:
     310                 :         {
     311               0 :             if (MaybeDestroy(t)) {
     312               0 :                 new (ptr_PPluginSurfaceParent()) PPluginSurfaceParent*;
     313                 :             }
     314               0 :             (*(ptr_PPluginSurfaceParent())) = const_cast<PPluginSurfaceParent*>((aRhs).get_PPluginSurfaceParent());
     315               0 :             break;
     316                 :         }
     317                 :     case TPPluginSurfaceChild:
     318                 :         {
     319               0 :             if (MaybeDestroy(t)) {
     320               0 :                 new (ptr_PPluginSurfaceChild()) PPluginSurfaceChild*;
     321                 :             }
     322               0 :             (*(ptr_PPluginSurfaceChild())) = const_cast<PPluginSurfaceChild*>((aRhs).get_PPluginSurfaceChild());
     323               0 :             break;
     324                 :         }
     325                 :     case TIOSurfaceDescriptor:
     326                 :         {
     327               0 :             if (MaybeDestroy(t)) {
     328               0 :                 new (ptr_IOSurfaceDescriptor()) IOSurfaceDescriptor;
     329                 :             }
     330               0 :             (*(ptr_IOSurfaceDescriptor())) = (aRhs).get_IOSurfaceDescriptor();
     331               0 :             break;
     332                 :         }
     333                 :     case Tnull_t:
     334                 :         {
     335               0 :             if (MaybeDestroy(t)) {
     336               0 :                 new (ptr_null_t()) null_t;
     337                 :             }
     338               0 :             (*(ptr_null_t())) = (aRhs).get_null_t();
     339               0 :             break;
     340                 :         }
     341                 :     case T__None:
     342                 :         {
     343               0 :             MaybeDestroy(t);
     344               0 :             break;
     345                 :         }
     346                 :     default:
     347                 :         {
     348               0 :             NS_RUNTIMEABORT("unreached");
     349               0 :             break;
     350                 :         }
     351                 :     }
     352               0 :     mType = t;
     353               0 :     return (*(this));
     354                 : }
     355                 : 
     356                 : bool
     357               0 : SurfaceDescriptor::operator==(Shmem& aRhs) const
     358                 : {
     359               0 :     return (get_Shmem()) == (aRhs);
     360                 : }
     361                 : 
     362                 : bool
     363               0 : SurfaceDescriptor::operator==(const SurfaceDescriptorX11& aRhs) const
     364                 : {
     365               0 :     return (get_SurfaceDescriptorX11()) == (aRhs);
     366                 : }
     367                 : 
     368                 : bool
     369               0 : SurfaceDescriptor::operator==(PPluginSurfaceParent* aRhs) const
     370                 : {
     371               0 :     return (get_PPluginSurfaceParent()) == (aRhs);
     372                 : }
     373                 : 
     374                 : bool
     375               0 : SurfaceDescriptor::operator==(PPluginSurfaceChild* aRhs) const
     376                 : {
     377               0 :     return (get_PPluginSurfaceChild()) == (aRhs);
     378                 : }
     379                 : 
     380                 : bool
     381               0 : SurfaceDescriptor::operator==(const IOSurfaceDescriptor& aRhs) const
     382                 : {
     383               0 :     return (get_IOSurfaceDescriptor()) == (aRhs);
     384                 : }
     385                 : 
     386                 : bool
     387               0 : SurfaceDescriptor::operator==(const null_t& aRhs) const
     388                 : {
     389               0 :     return (get_null_t()) == (aRhs);
     390                 : }
     391                 : 
     392                 : bool
     393               0 : SurfaceDescriptor::operator==(const SurfaceDescriptor& aRhs) const
     394                 : {
     395               0 :     if ((type()) != ((aRhs).type())) {
     396               0 :         return false;
     397                 :     }
     398                 : 
     399               0 :     switch (type()) {
     400                 :     case TShmem:
     401                 :         {
     402               0 :             return (get_Shmem()) == ((aRhs).get_Shmem());
     403                 :         }
     404                 :     case TSurfaceDescriptorX11:
     405                 :         {
     406               0 :             return (get_SurfaceDescriptorX11()) == ((aRhs).get_SurfaceDescriptorX11());
     407                 :         }
     408                 :     case TPPluginSurfaceParent:
     409                 :         {
     410               0 :             return (get_PPluginSurfaceParent()) == ((aRhs).get_PPluginSurfaceParent());
     411                 :         }
     412                 :     case TPPluginSurfaceChild:
     413                 :         {
     414               0 :             return (get_PPluginSurfaceChild()) == ((aRhs).get_PPluginSurfaceChild());
     415                 :         }
     416                 :     case TIOSurfaceDescriptor:
     417                 :         {
     418               0 :             return (get_IOSurfaceDescriptor()) == ((aRhs).get_IOSurfaceDescriptor());
     419                 :         }
     420                 :     case Tnull_t:
     421                 :         {
     422               0 :             return (get_null_t()) == ((aRhs).get_null_t());
     423                 :         }
     424                 :     default:
     425                 :         {
     426               0 :             NS_RUNTIMEABORT("unreached");
     427               0 :             return false;
     428                 :         }
     429                 :     }
     430                 : }
     431                 : 
     432                 : } // namespace plugins
     433                 : } // namespace mozilla
     434                 : 
     435                 : //-----------------------------------------------------------------------------
     436                 : // Method definitions for the IPDL type |union OptionalShmem|
     437                 : //
     438                 : namespace mozilla {
     439                 : namespace plugins {
     440                 : bool
     441               0 : OptionalShmem::MaybeDestroy(Type aNewType)
     442                 : {
     443               0 :     if ((mType) == (T__None)) {
     444               0 :         return true;
     445                 :     }
     446               0 :     if ((mType) == (aNewType)) {
     447               0 :         return false;
     448                 :     }
     449               0 :     switch (mType) {
     450                 :     case TShmem:
     451                 :         {
     452               0 :             (ptr_Shmem())->~Shmem__tdef();
     453               0 :             break;
     454                 :         }
     455                 :     case Tnull_t:
     456                 :         {
     457               0 :             (ptr_null_t())->~null_t__tdef();
     458               0 :             break;
     459                 :         }
     460                 :     default:
     461                 :         {
     462               0 :             NS_RUNTIMEABORT("not reached");
     463               0 :             break;
     464                 :         }
     465                 :     }
     466               0 :     return true;
     467                 : }
     468                 : 
     469               0 : OptionalShmem::OptionalShmem(Shmem& aOther)
     470                 : {
     471               0 :     new (ptr_Shmem()) Shmem(aOther);
     472               0 :     mType = TShmem;
     473               0 : }
     474                 : 
     475               0 : OptionalShmem::OptionalShmem(const null_t& aOther)
     476                 : {
     477               0 :     new (ptr_null_t()) null_t(aOther);
     478               0 :     mType = Tnull_t;
     479               0 : }
     480                 : 
     481               0 : OptionalShmem::OptionalShmem(const OptionalShmem& aOther)
     482                 : {
     483               0 :     (aOther).AssertSanity();
     484               0 :     switch ((aOther).type()) {
     485                 :     case TShmem:
     486                 :         {
     487               0 :             new (ptr_Shmem()) Shmem((aOther).get_Shmem());
     488               0 :             break;
     489                 :         }
     490                 :     case Tnull_t:
     491                 :         {
     492               0 :             new (ptr_null_t()) null_t((aOther).get_null_t());
     493               0 :             break;
     494                 :         }
     495                 :     case T__None:
     496                 :         {
     497               0 :             break;
     498                 :         }
     499                 :     default:
     500                 :         {
     501               0 :             NS_RUNTIMEABORT("unreached");
     502               0 :             return;
     503                 :         }
     504                 :     }
     505               0 :     mType = (aOther).type();
     506                 : }
     507                 : 
     508               0 : OptionalShmem::~OptionalShmem()
     509                 : {
     510               0 :     MaybeDestroy(T__None);
     511               0 : }
     512                 : 
     513                 : OptionalShmem&
     514               0 : OptionalShmem::operator=(Shmem& aRhs)
     515                 : {
     516               0 :     if (MaybeDestroy(TShmem)) {
     517               0 :         new (ptr_Shmem()) Shmem;
     518                 :     }
     519               0 :     (*(ptr_Shmem())) = aRhs;
     520               0 :     mType = TShmem;
     521               0 :     return (*(this));
     522                 : }
     523                 : 
     524                 : OptionalShmem&
     525               0 : OptionalShmem::operator=(const null_t& aRhs)
     526                 : {
     527               0 :     if (MaybeDestroy(Tnull_t)) {
     528               0 :         new (ptr_null_t()) null_t;
     529                 :     }
     530               0 :     (*(ptr_null_t())) = aRhs;
     531               0 :     mType = Tnull_t;
     532               0 :     return (*(this));
     533                 : }
     534                 : 
     535                 : OptionalShmem&
     536               0 : OptionalShmem::operator=(const OptionalShmem& aRhs)
     537                 : {
     538               0 :     (aRhs).AssertSanity();
     539               0 :     Type t = (aRhs).type();
     540               0 :     switch (t) {
     541                 :     case TShmem:
     542                 :         {
     543               0 :             if (MaybeDestroy(t)) {
     544               0 :                 new (ptr_Shmem()) Shmem;
     545                 :             }
     546               0 :             (*(ptr_Shmem())) = (aRhs).get_Shmem();
     547               0 :             break;
     548                 :         }
     549                 :     case Tnull_t:
     550                 :         {
     551               0 :             if (MaybeDestroy(t)) {
     552               0 :                 new (ptr_null_t()) null_t;
     553                 :             }
     554               0 :             (*(ptr_null_t())) = (aRhs).get_null_t();
     555               0 :             break;
     556                 :         }
     557                 :     case T__None:
     558                 :         {
     559               0 :             MaybeDestroy(t);
     560               0 :             break;
     561                 :         }
     562                 :     default:
     563                 :         {
     564               0 :             NS_RUNTIMEABORT("unreached");
     565               0 :             break;
     566                 :         }
     567                 :     }
     568               0 :     mType = t;
     569               0 :     return (*(this));
     570                 : }
     571                 : 
     572                 : bool
     573               0 : OptionalShmem::operator==(Shmem& aRhs) const
     574                 : {
     575               0 :     return (get_Shmem()) == (aRhs);
     576                 : }
     577                 : 
     578                 : bool
     579               0 : OptionalShmem::operator==(const null_t& aRhs) const
     580                 : {
     581               0 :     return (get_null_t()) == (aRhs);
     582                 : }
     583                 : 
     584                 : bool
     585               0 : OptionalShmem::operator==(const OptionalShmem& aRhs) const
     586                 : {
     587               0 :     if ((type()) != ((aRhs).type())) {
     588               0 :         return false;
     589                 :     }
     590                 : 
     591               0 :     switch (type()) {
     592                 :     case TShmem:
     593                 :         {
     594               0 :             return (get_Shmem()) == ((aRhs).get_Shmem());
     595                 :         }
     596                 :     case Tnull_t:
     597                 :         {
     598               0 :             return (get_null_t()) == ((aRhs).get_null_t());
     599                 :         }
     600                 :     default:
     601                 :         {
     602               0 :             NS_RUNTIMEABORT("unreached");
     603               0 :             return false;
     604                 :         }
     605                 :     }
     606                 : }
     607                 : 
     608                 : } // namespace plugins
     609                 : } // namespace mozilla
     610                 : 
     611                 : //-----------------------------------------------------------------------------
     612                 : // Method definitions for the IPDL type |union AsyncSurfaceDescriptor|
     613                 : //
     614                 : namespace mozilla {
     615                 : namespace plugins {
     616                 : bool
     617               0 : AsyncSurfaceDescriptor::MaybeDestroy(Type aNewType)
     618                 : {
     619               0 :     if ((mType) == (T__None)) {
     620               0 :         return true;
     621                 :     }
     622               0 :     if ((mType) == (aNewType)) {
     623               0 :         return false;
     624                 :     }
     625               0 :     switch (mType) {
     626                 :     case TShmem:
     627                 :         {
     628               0 :             (ptr_Shmem())->~Shmem__tdef();
     629               0 :             break;
     630                 :         }
     631                 :     case TDXGISharedSurfaceHandle:
     632                 :         {
     633               0 :             (ptr_DXGISharedSurfaceHandle())->~DXGISharedSurfaceHandle__tdef();
     634               0 :             break;
     635                 :         }
     636                 :     default:
     637                 :         {
     638               0 :             NS_RUNTIMEABORT("not reached");
     639               0 :             break;
     640                 :         }
     641                 :     }
     642               0 :     return true;
     643                 : }
     644                 : 
     645               0 : AsyncSurfaceDescriptor::AsyncSurfaceDescriptor(Shmem& aOther)
     646                 : {
     647               0 :     new (ptr_Shmem()) Shmem(aOther);
     648               0 :     mType = TShmem;
     649               0 : }
     650                 : 
     651               0 : AsyncSurfaceDescriptor::AsyncSurfaceDescriptor(const DXGISharedSurfaceHandle& aOther)
     652                 : {
     653               0 :     new (ptr_DXGISharedSurfaceHandle()) DXGISharedSurfaceHandle(aOther);
     654               0 :     mType = TDXGISharedSurfaceHandle;
     655               0 : }
     656                 : 
     657               0 : AsyncSurfaceDescriptor::AsyncSurfaceDescriptor(const AsyncSurfaceDescriptor& aOther)
     658                 : {
     659               0 :     (aOther).AssertSanity();
     660               0 :     switch ((aOther).type()) {
     661                 :     case TShmem:
     662                 :         {
     663               0 :             new (ptr_Shmem()) Shmem((aOther).get_Shmem());
     664               0 :             break;
     665                 :         }
     666                 :     case TDXGISharedSurfaceHandle:
     667                 :         {
     668               0 :             new (ptr_DXGISharedSurfaceHandle()) DXGISharedSurfaceHandle((aOther).get_DXGISharedSurfaceHandle());
     669               0 :             break;
     670                 :         }
     671                 :     case T__None:
     672                 :         {
     673               0 :             break;
     674                 :         }
     675                 :     default:
     676                 :         {
     677               0 :             NS_RUNTIMEABORT("unreached");
     678               0 :             return;
     679                 :         }
     680                 :     }
     681               0 :     mType = (aOther).type();
     682                 : }
     683                 : 
     684               0 : AsyncSurfaceDescriptor::~AsyncSurfaceDescriptor()
     685                 : {
     686               0 :     MaybeDestroy(T__None);
     687               0 : }
     688                 : 
     689                 : AsyncSurfaceDescriptor&
     690               0 : AsyncSurfaceDescriptor::operator=(Shmem& aRhs)
     691                 : {
     692               0 :     if (MaybeDestroy(TShmem)) {
     693               0 :         new (ptr_Shmem()) Shmem;
     694                 :     }
     695               0 :     (*(ptr_Shmem())) = aRhs;
     696               0 :     mType = TShmem;
     697               0 :     return (*(this));
     698                 : }
     699                 : 
     700                 : AsyncSurfaceDescriptor&
     701               0 : AsyncSurfaceDescriptor::operator=(const DXGISharedSurfaceHandle& aRhs)
     702                 : {
     703               0 :     if (MaybeDestroy(TDXGISharedSurfaceHandle)) {
     704               0 :         new (ptr_DXGISharedSurfaceHandle()) DXGISharedSurfaceHandle;
     705                 :     }
     706               0 :     (*(ptr_DXGISharedSurfaceHandle())) = aRhs;
     707               0 :     mType = TDXGISharedSurfaceHandle;
     708               0 :     return (*(this));
     709                 : }
     710                 : 
     711                 : AsyncSurfaceDescriptor&
     712               0 : AsyncSurfaceDescriptor::operator=(const AsyncSurfaceDescriptor& aRhs)
     713                 : {
     714               0 :     (aRhs).AssertSanity();
     715               0 :     Type t = (aRhs).type();
     716               0 :     switch (t) {
     717                 :     case TShmem:
     718                 :         {
     719               0 :             if (MaybeDestroy(t)) {
     720               0 :                 new (ptr_Shmem()) Shmem;
     721                 :             }
     722               0 :             (*(ptr_Shmem())) = (aRhs).get_Shmem();
     723               0 :             break;
     724                 :         }
     725                 :     case TDXGISharedSurfaceHandle:
     726                 :         {
     727               0 :             if (MaybeDestroy(t)) {
     728               0 :                 new (ptr_DXGISharedSurfaceHandle()) DXGISharedSurfaceHandle;
     729                 :             }
     730               0 :             (*(ptr_DXGISharedSurfaceHandle())) = (aRhs).get_DXGISharedSurfaceHandle();
     731               0 :             break;
     732                 :         }
     733                 :     case T__None:
     734                 :         {
     735               0 :             MaybeDestroy(t);
     736               0 :             break;
     737                 :         }
     738                 :     default:
     739                 :         {
     740               0 :             NS_RUNTIMEABORT("unreached");
     741               0 :             break;
     742                 :         }
     743                 :     }
     744               0 :     mType = t;
     745               0 :     return (*(this));
     746                 : }
     747                 : 
     748                 : bool
     749               0 : AsyncSurfaceDescriptor::operator==(Shmem& aRhs) const
     750                 : {
     751               0 :     return (get_Shmem()) == (aRhs);
     752                 : }
     753                 : 
     754                 : bool
     755               0 : AsyncSurfaceDescriptor::operator==(const DXGISharedSurfaceHandle& aRhs) const
     756                 : {
     757               0 :     return (get_DXGISharedSurfaceHandle()) == (aRhs);
     758                 : }
     759                 : 
     760                 : bool
     761               0 : AsyncSurfaceDescriptor::operator==(const AsyncSurfaceDescriptor& aRhs) const
     762                 : {
     763               0 :     if ((type()) != ((aRhs).type())) {
     764               0 :         return false;
     765                 :     }
     766                 : 
     767               0 :     switch (type()) {
     768                 :     case TShmem:
     769                 :         {
     770               0 :             return (get_Shmem()) == ((aRhs).get_Shmem());
     771                 :         }
     772                 :     case TDXGISharedSurfaceHandle:
     773                 :         {
     774               0 :             return (get_DXGISharedSurfaceHandle()) == ((aRhs).get_DXGISharedSurfaceHandle());
     775                 :         }
     776                 :     default:
     777                 :         {
     778               0 :             NS_RUNTIMEABORT("unreached");
     779               0 :             return false;
     780                 :         }
     781                 :     }
     782                 : }
     783                 : 
     784                 : } // namespace plugins
     785                 : } // namespace mozilla
     786                 : 
     787                 : //-----------------------------------------------------------------------------
     788                 : // Method definitions for the IPDL type |struct NPRemoteAsyncSurface|
     789                 : //
     790                 : namespace mozilla {
     791                 : namespace plugins {
     792               0 : NPRemoteAsyncSurface::NPRemoteAsyncSurface()
     793                 : {
     794               0 :     Init();
     795               0 : }
     796                 : 
     797               0 : NPRemoteAsyncSurface::~NPRemoteAsyncSurface()
     798                 : {
     799               0 : }
     800                 : 
     801                 : bool
     802               0 : NPRemoteAsyncSurface::operator==(const NPRemoteAsyncSurface& _o) const
     803                 : {
     804               0 :     if ((!((version()) == ((_o).version())))) {
     805               0 :         return false;
     806                 :     }
     807               0 :     if ((!((size()) == ((_o).size())))) {
     808               0 :         return false;
     809                 :     }
     810               0 :     if ((!((format()) == ((_o).format())))) {
     811               0 :         return false;
     812                 :     }
     813               0 :     if ((!((stride()) == ((_o).stride())))) {
     814               0 :         return false;
     815                 :     }
     816               0 :     if ((!((data()) == ((_o).data())))) {
     817               0 :         return false;
     818                 :     }
     819               0 :     if ((!((hostPtr()) == ((_o).hostPtr())))) {
     820               0 :         return false;
     821                 :     }
     822               0 :     return true;
     823                 : }
     824                 : 
     825                 : void
     826               0 : NPRemoteAsyncSurface::Init()
     827                 : {
     828               0 : }
     829                 : 
     830                 : void
     831               0 : NPRemoteAsyncSurface::Assign(
     832                 :         const uint32_t& _version,
     833                 :         const gfxIntSize& _size,
     834                 :         const NPImageFormat& _format,
     835                 :         const uint32_t& _stride,
     836                 :         const AsyncSurfaceDescriptor& _data,
     837                 :         const uintptr_t& _hostPtr)
     838                 : {
     839               0 :     version_ = _version;
     840               0 :     size_ = _size;
     841               0 :     format_ = _format;
     842               0 :     stride_ = _stride;
     843               0 :     data_ = _data;
     844               0 :     hostPtr_ = _hostPtr;
     845               0 : }
     846                 : 
     847                 : } // namespace plugins
     848                 : } // namespace mozilla

Generated by: LCOV version 1.7