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

       1                 : //
       2                 : // Automatically generated by ipdlc.
       3                 : // Edit at your own risk
       4                 : //
       5                 : 
       6                 : 
       7                 : #include "mozilla/plugins/PPluginScriptableObject.h"
       8                 : 
       9                 : namespace mozilla {
      10                 : namespace plugins {
      11                 : namespace PPluginScriptableObject {
      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 PPluginScriptableObject
      39                 : } // namespace plugins
      40                 : } // namespace mozilla
      41                 : 
      42                 : //-----------------------------------------------------------------------------
      43                 : // Method definitions for the IPDL type |union Variant|
      44                 : //
      45                 : namespace mozilla {
      46                 : namespace plugins {
      47                 : bool
      48               0 : Variant::MaybeDestroy(Type aNewType)
      49                 : {
      50               0 :     if ((mType) == (T__None)) {
      51               0 :         return true;
      52                 :     }
      53               0 :     if ((mType) == (aNewType)) {
      54               0 :         return false;
      55                 :     }
      56               0 :     switch (mType) {
      57                 :     case Tvoid_t:
      58                 :         {
      59               0 :             (ptr_void_t())->~void_t__tdef();
      60               0 :             break;
      61                 :         }
      62                 :     case Tnull_t:
      63                 :         {
      64               0 :             (ptr_null_t())->~null_t__tdef();
      65               0 :             break;
      66                 :         }
      67                 :     case Tbool:
      68                 :         {
      69               0 :             (ptr_bool())->~bool__tdef();
      70               0 :             break;
      71                 :         }
      72                 :     case Tint:
      73                 :         {
      74               0 :             (ptr_int())->~int__tdef();
      75               0 :             break;
      76                 :         }
      77                 :     case Tdouble:
      78                 :         {
      79               0 :             (ptr_double())->~double__tdef();
      80               0 :             break;
      81                 :         }
      82                 :     case TnsCString:
      83                 :         {
      84               0 :             (ptr_nsCString())->~nsCString__tdef();
      85               0 :             break;
      86                 :         }
      87                 :     case TPPluginScriptableObjectParent:
      88                 :         {
      89               0 :             (ptr_PPluginScriptableObjectParent())->~PPluginScriptableObjectParent__tdef();
      90               0 :             break;
      91                 :         }
      92                 :     case TPPluginScriptableObjectChild:
      93                 :         {
      94               0 :             (ptr_PPluginScriptableObjectChild())->~PPluginScriptableObjectChild__tdef();
      95               0 :             break;
      96                 :         }
      97                 :     default:
      98                 :         {
      99               0 :             NS_RUNTIMEABORT("not reached");
     100               0 :             break;
     101                 :         }
     102                 :     }
     103               0 :     return true;
     104                 : }
     105                 : 
     106               0 : Variant::Variant(const void_t& aOther)
     107                 : {
     108               0 :     new (ptr_void_t()) void_t(aOther);
     109               0 :     mType = Tvoid_t;
     110               0 : }
     111                 : 
     112               0 : Variant::Variant(const null_t& aOther)
     113                 : {
     114               0 :     new (ptr_null_t()) null_t(aOther);
     115               0 :     mType = Tnull_t;
     116               0 : }
     117                 : 
     118               0 : Variant::Variant(const bool& aOther)
     119                 : {
     120               0 :     new (ptr_bool()) bool(aOther);
     121               0 :     mType = Tbool;
     122               0 : }
     123                 : 
     124               0 : Variant::Variant(const int& aOther)
     125                 : {
     126               0 :     new (ptr_int()) int(aOther);
     127               0 :     mType = Tint;
     128               0 : }
     129                 : 
     130               0 : Variant::Variant(const double& aOther)
     131                 : {
     132               0 :     new (ptr_double()) double(aOther);
     133               0 :     mType = Tdouble;
     134               0 : }
     135                 : 
     136               0 : Variant::Variant(const nsCString& aOther)
     137                 : {
     138               0 :     new (ptr_nsCString()) nsCString(aOther);
     139               0 :     mType = TnsCString;
     140               0 : }
     141                 : 
     142               0 : Variant::Variant(PPluginScriptableObjectParent* aOther)
     143                 : {
     144               0 :     new (ptr_PPluginScriptableObjectParent()) PPluginScriptableObjectParent*(const_cast<PPluginScriptableObjectParent*>(aOther));
     145               0 :     mType = TPPluginScriptableObjectParent;
     146               0 : }
     147                 : 
     148               0 : Variant::Variant(PPluginScriptableObjectChild* aOther)
     149                 : {
     150               0 :     new (ptr_PPluginScriptableObjectChild()) PPluginScriptableObjectChild*(const_cast<PPluginScriptableObjectChild*>(aOther));
     151               0 :     mType = TPPluginScriptableObjectChild;
     152               0 : }
     153                 : 
     154               0 : Variant::Variant(const Variant& aOther)
     155                 : {
     156               0 :     (aOther).AssertSanity();
     157               0 :     switch ((aOther).type()) {
     158                 :     case Tvoid_t:
     159                 :         {
     160               0 :             new (ptr_void_t()) void_t((aOther).get_void_t());
     161               0 :             break;
     162                 :         }
     163                 :     case Tnull_t:
     164                 :         {
     165               0 :             new (ptr_null_t()) null_t((aOther).get_null_t());
     166               0 :             break;
     167                 :         }
     168                 :     case Tbool:
     169                 :         {
     170               0 :             new (ptr_bool()) bool((aOther).get_bool());
     171               0 :             break;
     172                 :         }
     173                 :     case Tint:
     174                 :         {
     175               0 :             new (ptr_int()) int((aOther).get_int());
     176               0 :             break;
     177                 :         }
     178                 :     case Tdouble:
     179                 :         {
     180               0 :             new (ptr_double()) double((aOther).get_double());
     181               0 :             break;
     182                 :         }
     183                 :     case TnsCString:
     184                 :         {
     185               0 :             new (ptr_nsCString()) nsCString((aOther).get_nsCString());
     186               0 :             break;
     187                 :         }
     188                 :     case TPPluginScriptableObjectParent:
     189                 :         {
     190               0 :             new (ptr_PPluginScriptableObjectParent()) PPluginScriptableObjectParent*(const_cast<PPluginScriptableObjectParent*>((aOther).get_PPluginScriptableObjectParent()));
     191               0 :             break;
     192                 :         }
     193                 :     case TPPluginScriptableObjectChild:
     194                 :         {
     195               0 :             new (ptr_PPluginScriptableObjectChild()) PPluginScriptableObjectChild*(const_cast<PPluginScriptableObjectChild*>((aOther).get_PPluginScriptableObjectChild()));
     196               0 :             break;
     197                 :         }
     198                 :     case T__None:
     199                 :         {
     200               0 :             break;
     201                 :         }
     202                 :     default:
     203                 :         {
     204               0 :             NS_RUNTIMEABORT("unreached");
     205               0 :             return;
     206                 :         }
     207                 :     }
     208               0 :     mType = (aOther).type();
     209                 : }
     210                 : 
     211               0 : Variant::~Variant()
     212                 : {
     213               0 :     MaybeDestroy(T__None);
     214               0 : }
     215                 : 
     216                 : Variant&
     217               0 : Variant::operator=(const void_t& aRhs)
     218                 : {
     219               0 :     if (MaybeDestroy(Tvoid_t)) {
     220               0 :         new (ptr_void_t()) void_t;
     221                 :     }
     222               0 :     (*(ptr_void_t())) = aRhs;
     223               0 :     mType = Tvoid_t;
     224               0 :     return (*(this));
     225                 : }
     226                 : 
     227                 : Variant&
     228               0 : Variant::operator=(const null_t& aRhs)
     229                 : {
     230               0 :     if (MaybeDestroy(Tnull_t)) {
     231               0 :         new (ptr_null_t()) null_t;
     232                 :     }
     233               0 :     (*(ptr_null_t())) = aRhs;
     234               0 :     mType = Tnull_t;
     235               0 :     return (*(this));
     236                 : }
     237                 : 
     238                 : Variant&
     239               0 : Variant::operator=(const bool& aRhs)
     240                 : {
     241               0 :     if (MaybeDestroy(Tbool)) {
     242               0 :         new (ptr_bool()) bool;
     243                 :     }
     244               0 :     (*(ptr_bool())) = aRhs;
     245               0 :     mType = Tbool;
     246               0 :     return (*(this));
     247                 : }
     248                 : 
     249                 : Variant&
     250               0 : Variant::operator=(const int& aRhs)
     251                 : {
     252               0 :     if (MaybeDestroy(Tint)) {
     253               0 :         new (ptr_int()) int;
     254                 :     }
     255               0 :     (*(ptr_int())) = aRhs;
     256               0 :     mType = Tint;
     257               0 :     return (*(this));
     258                 : }
     259                 : 
     260                 : Variant&
     261               0 : Variant::operator=(const double& aRhs)
     262                 : {
     263               0 :     if (MaybeDestroy(Tdouble)) {
     264               0 :         new (ptr_double()) double;
     265                 :     }
     266               0 :     (*(ptr_double())) = aRhs;
     267               0 :     mType = Tdouble;
     268               0 :     return (*(this));
     269                 : }
     270                 : 
     271                 : Variant&
     272               0 : Variant::operator=(const nsCString& aRhs)
     273                 : {
     274               0 :     if (MaybeDestroy(TnsCString)) {
     275               0 :         new (ptr_nsCString()) nsCString;
     276                 :     }
     277               0 :     (*(ptr_nsCString())) = aRhs;
     278               0 :     mType = TnsCString;
     279               0 :     return (*(this));
     280                 : }
     281                 : 
     282                 : Variant&
     283               0 : Variant::operator=(PPluginScriptableObjectParent* aRhs)
     284                 : {
     285               0 :     if (MaybeDestroy(TPPluginScriptableObjectParent)) {
     286               0 :         new (ptr_PPluginScriptableObjectParent()) PPluginScriptableObjectParent*;
     287                 :     }
     288               0 :     (*(ptr_PPluginScriptableObjectParent())) = const_cast<PPluginScriptableObjectParent*>(aRhs);
     289               0 :     mType = TPPluginScriptableObjectParent;
     290               0 :     return (*(this));
     291                 : }
     292                 : 
     293                 : Variant&
     294               0 : Variant::operator=(PPluginScriptableObjectChild* aRhs)
     295                 : {
     296               0 :     if (MaybeDestroy(TPPluginScriptableObjectChild)) {
     297               0 :         new (ptr_PPluginScriptableObjectChild()) PPluginScriptableObjectChild*;
     298                 :     }
     299               0 :     (*(ptr_PPluginScriptableObjectChild())) = const_cast<PPluginScriptableObjectChild*>(aRhs);
     300               0 :     mType = TPPluginScriptableObjectChild;
     301               0 :     return (*(this));
     302                 : }
     303                 : 
     304                 : Variant&
     305               0 : Variant::operator=(const Variant& aRhs)
     306                 : {
     307               0 :     (aRhs).AssertSanity();
     308               0 :     Type t = (aRhs).type();
     309               0 :     switch (t) {
     310                 :     case Tvoid_t:
     311                 :         {
     312               0 :             if (MaybeDestroy(t)) {
     313               0 :                 new (ptr_void_t()) void_t;
     314                 :             }
     315               0 :             (*(ptr_void_t())) = (aRhs).get_void_t();
     316               0 :             break;
     317                 :         }
     318                 :     case Tnull_t:
     319                 :         {
     320               0 :             if (MaybeDestroy(t)) {
     321               0 :                 new (ptr_null_t()) null_t;
     322                 :             }
     323               0 :             (*(ptr_null_t())) = (aRhs).get_null_t();
     324               0 :             break;
     325                 :         }
     326                 :     case Tbool:
     327                 :         {
     328               0 :             if (MaybeDestroy(t)) {
     329               0 :                 new (ptr_bool()) bool;
     330                 :             }
     331               0 :             (*(ptr_bool())) = (aRhs).get_bool();
     332               0 :             break;
     333                 :         }
     334                 :     case Tint:
     335                 :         {
     336               0 :             if (MaybeDestroy(t)) {
     337               0 :                 new (ptr_int()) int;
     338                 :             }
     339               0 :             (*(ptr_int())) = (aRhs).get_int();
     340               0 :             break;
     341                 :         }
     342                 :     case Tdouble:
     343                 :         {
     344               0 :             if (MaybeDestroy(t)) {
     345               0 :                 new (ptr_double()) double;
     346                 :             }
     347               0 :             (*(ptr_double())) = (aRhs).get_double();
     348               0 :             break;
     349                 :         }
     350                 :     case TnsCString:
     351                 :         {
     352               0 :             if (MaybeDestroy(t)) {
     353               0 :                 new (ptr_nsCString()) nsCString;
     354                 :             }
     355               0 :             (*(ptr_nsCString())) = (aRhs).get_nsCString();
     356               0 :             break;
     357                 :         }
     358                 :     case TPPluginScriptableObjectParent:
     359                 :         {
     360               0 :             if (MaybeDestroy(t)) {
     361               0 :                 new (ptr_PPluginScriptableObjectParent()) PPluginScriptableObjectParent*;
     362                 :             }
     363               0 :             (*(ptr_PPluginScriptableObjectParent())) = const_cast<PPluginScriptableObjectParent*>((aRhs).get_PPluginScriptableObjectParent());
     364               0 :             break;
     365                 :         }
     366                 :     case TPPluginScriptableObjectChild:
     367                 :         {
     368               0 :             if (MaybeDestroy(t)) {
     369               0 :                 new (ptr_PPluginScriptableObjectChild()) PPluginScriptableObjectChild*;
     370                 :             }
     371               0 :             (*(ptr_PPluginScriptableObjectChild())) = const_cast<PPluginScriptableObjectChild*>((aRhs).get_PPluginScriptableObjectChild());
     372               0 :             break;
     373                 :         }
     374                 :     case T__None:
     375                 :         {
     376               0 :             MaybeDestroy(t);
     377               0 :             break;
     378                 :         }
     379                 :     default:
     380                 :         {
     381               0 :             NS_RUNTIMEABORT("unreached");
     382               0 :             break;
     383                 :         }
     384                 :     }
     385               0 :     mType = t;
     386               0 :     return (*(this));
     387                 : }
     388                 : 
     389                 : bool
     390               0 : Variant::operator==(const void_t& aRhs) const
     391                 : {
     392               0 :     return (get_void_t()) == (aRhs);
     393                 : }
     394                 : 
     395                 : bool
     396               0 : Variant::operator==(const null_t& aRhs) const
     397                 : {
     398               0 :     return (get_null_t()) == (aRhs);
     399                 : }
     400                 : 
     401                 : bool
     402               0 : Variant::operator==(const bool& aRhs) const
     403                 : {
     404               0 :     return (get_bool()) == (aRhs);
     405                 : }
     406                 : 
     407                 : bool
     408               0 : Variant::operator==(const int& aRhs) const
     409                 : {
     410               0 :     return (get_int()) == (aRhs);
     411                 : }
     412                 : 
     413                 : bool
     414               0 : Variant::operator==(const double& aRhs) const
     415                 : {
     416               0 :     return (get_double()) == (aRhs);
     417                 : }
     418                 : 
     419                 : bool
     420               0 : Variant::operator==(const nsCString& aRhs) const
     421                 : {
     422               0 :     return (get_nsCString()) == (aRhs);
     423                 : }
     424                 : 
     425                 : bool
     426               0 : Variant::operator==(PPluginScriptableObjectParent* aRhs) const
     427                 : {
     428               0 :     return (get_PPluginScriptableObjectParent()) == (aRhs);
     429                 : }
     430                 : 
     431                 : bool
     432               0 : Variant::operator==(PPluginScriptableObjectChild* aRhs) const
     433                 : {
     434               0 :     return (get_PPluginScriptableObjectChild()) == (aRhs);
     435                 : }
     436                 : 
     437                 : bool
     438               0 : Variant::operator==(const Variant& aRhs) const
     439                 : {
     440               0 :     if ((type()) != ((aRhs).type())) {
     441               0 :         return false;
     442                 :     }
     443                 : 
     444               0 :     switch (type()) {
     445                 :     case Tvoid_t:
     446                 :         {
     447               0 :             return (get_void_t()) == ((aRhs).get_void_t());
     448                 :         }
     449                 :     case Tnull_t:
     450                 :         {
     451               0 :             return (get_null_t()) == ((aRhs).get_null_t());
     452                 :         }
     453                 :     case Tbool:
     454                 :         {
     455               0 :             return (get_bool()) == ((aRhs).get_bool());
     456                 :         }
     457                 :     case Tint:
     458                 :         {
     459               0 :             return (get_int()) == ((aRhs).get_int());
     460                 :         }
     461                 :     case Tdouble:
     462                 :         {
     463               0 :             return (get_double()) == ((aRhs).get_double());
     464                 :         }
     465                 :     case TnsCString:
     466                 :         {
     467               0 :             return (get_nsCString()) == ((aRhs).get_nsCString());
     468                 :         }
     469                 :     case TPPluginScriptableObjectParent:
     470                 :         {
     471               0 :             return (get_PPluginScriptableObjectParent()) == ((aRhs).get_PPluginScriptableObjectParent());
     472                 :         }
     473                 :     case TPPluginScriptableObjectChild:
     474                 :         {
     475               0 :             return (get_PPluginScriptableObjectChild()) == ((aRhs).get_PPluginScriptableObjectChild());
     476                 :         }
     477                 :     default:
     478                 :         {
     479               0 :             NS_RUNTIMEABORT("unreached");
     480               0 :             return false;
     481                 :         }
     482                 :     }
     483                 : }
     484                 : 
     485                 : } // namespace plugins
     486                 : } // namespace mozilla

Generated by: LCOV version 1.7