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

       1                 : //
       2                 : // Automatically generated by ipdlc.
       3                 : // Edit at your own risk
       4                 : //
       5                 : 
       6                 : 
       7                 : #include "mozilla/jsipc/PObjectWrapper.h"
       8                 : 
       9                 : namespace mozilla {
      10                 : namespace jsipc {
      11                 : namespace PObjectWrapper {
      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 PObjectWrapper
      39                 : } // namespace jsipc
      40                 : } // namespace mozilla
      41                 : 
      42                 : //-----------------------------------------------------------------------------
      43                 : // Method definitions for the IPDL type |union JSVariant|
      44                 : //
      45                 : namespace mozilla {
      46                 : namespace jsipc {
      47                 : bool
      48               0 : JSVariant::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 TPObjectWrapperParent:
      63                 :         {
      64               0 :             (ptr_PObjectWrapperParent())->~PObjectWrapperParent__tdef();
      65               0 :             break;
      66                 :         }
      67                 :     case TPObjectWrapperChild:
      68                 :         {
      69               0 :             (ptr_PObjectWrapperChild())->~PObjectWrapperChild__tdef();
      70               0 :             break;
      71                 :         }
      72                 :     case TnsString:
      73                 :         {
      74               0 :             (ptr_nsString())->~nsString__tdef();
      75               0 :             break;
      76                 :         }
      77                 :     case Tint:
      78                 :         {
      79               0 :             (ptr_int())->~int__tdef();
      80               0 :             break;
      81                 :         }
      82                 :     case Tdouble:
      83                 :         {
      84               0 :             (ptr_double())->~double__tdef();
      85               0 :             break;
      86                 :         }
      87                 :     case Tbool:
      88                 :         {
      89               0 :             (ptr_bool())->~bool__tdef();
      90               0 :             break;
      91                 :         }
      92                 :     default:
      93                 :         {
      94               0 :             NS_RUNTIMEABORT("not reached");
      95               0 :             break;
      96                 :         }
      97                 :     }
      98               0 :     return true;
      99                 : }
     100                 : 
     101               0 : JSVariant::JSVariant(const void_t& aOther)
     102                 : {
     103               0 :     new (ptr_void_t()) void_t(aOther);
     104               0 :     mType = Tvoid_t;
     105               0 : }
     106                 : 
     107               0 : JSVariant::JSVariant(PObjectWrapperParent* aOther)
     108                 : {
     109               0 :     new (ptr_PObjectWrapperParent()) PObjectWrapperParent*(const_cast<PObjectWrapperParent*>(aOther));
     110               0 :     mType = TPObjectWrapperParent;
     111               0 : }
     112                 : 
     113               0 : JSVariant::JSVariant(PObjectWrapperChild* aOther)
     114                 : {
     115               0 :     new (ptr_PObjectWrapperChild()) PObjectWrapperChild*(const_cast<PObjectWrapperChild*>(aOther));
     116               0 :     mType = TPObjectWrapperChild;
     117               0 : }
     118                 : 
     119               0 : JSVariant::JSVariant(const nsString& aOther)
     120                 : {
     121               0 :     new (ptr_nsString()) nsString(aOther);
     122               0 :     mType = TnsString;
     123               0 : }
     124                 : 
     125               0 : JSVariant::JSVariant(const int& aOther)
     126                 : {
     127               0 :     new (ptr_int()) int(aOther);
     128               0 :     mType = Tint;
     129               0 : }
     130                 : 
     131               0 : JSVariant::JSVariant(const double& aOther)
     132                 : {
     133               0 :     new (ptr_double()) double(aOther);
     134               0 :     mType = Tdouble;
     135               0 : }
     136                 : 
     137               0 : JSVariant::JSVariant(const bool& aOther)
     138                 : {
     139               0 :     new (ptr_bool()) bool(aOther);
     140               0 :     mType = Tbool;
     141               0 : }
     142                 : 
     143               0 : JSVariant::JSVariant(const JSVariant& aOther)
     144                 : {
     145               0 :     (aOther).AssertSanity();
     146               0 :     switch ((aOther).type()) {
     147                 :     case Tvoid_t:
     148                 :         {
     149               0 :             new (ptr_void_t()) void_t((aOther).get_void_t());
     150               0 :             break;
     151                 :         }
     152                 :     case TPObjectWrapperParent:
     153                 :         {
     154               0 :             new (ptr_PObjectWrapperParent()) PObjectWrapperParent*(const_cast<PObjectWrapperParent*>((aOther).get_PObjectWrapperParent()));
     155               0 :             break;
     156                 :         }
     157                 :     case TPObjectWrapperChild:
     158                 :         {
     159               0 :             new (ptr_PObjectWrapperChild()) PObjectWrapperChild*(const_cast<PObjectWrapperChild*>((aOther).get_PObjectWrapperChild()));
     160               0 :             break;
     161                 :         }
     162                 :     case TnsString:
     163                 :         {
     164               0 :             new (ptr_nsString()) nsString((aOther).get_nsString());
     165               0 :             break;
     166                 :         }
     167                 :     case Tint:
     168                 :         {
     169               0 :             new (ptr_int()) int((aOther).get_int());
     170               0 :             break;
     171                 :         }
     172                 :     case Tdouble:
     173                 :         {
     174               0 :             new (ptr_double()) double((aOther).get_double());
     175               0 :             break;
     176                 :         }
     177                 :     case Tbool:
     178                 :         {
     179               0 :             new (ptr_bool()) bool((aOther).get_bool());
     180               0 :             break;
     181                 :         }
     182                 :     case T__None:
     183                 :         {
     184               0 :             break;
     185                 :         }
     186                 :     default:
     187                 :         {
     188               0 :             NS_RUNTIMEABORT("unreached");
     189               0 :             return;
     190                 :         }
     191                 :     }
     192               0 :     mType = (aOther).type();
     193                 : }
     194                 : 
     195               0 : JSVariant::~JSVariant()
     196                 : {
     197               0 :     MaybeDestroy(T__None);
     198               0 : }
     199                 : 
     200                 : JSVariant&
     201               0 : JSVariant::operator=(const void_t& aRhs)
     202                 : {
     203               0 :     if (MaybeDestroy(Tvoid_t)) {
     204               0 :         new (ptr_void_t()) void_t;
     205                 :     }
     206               0 :     (*(ptr_void_t())) = aRhs;
     207               0 :     mType = Tvoid_t;
     208               0 :     return (*(this));
     209                 : }
     210                 : 
     211                 : JSVariant&
     212               0 : JSVariant::operator=(PObjectWrapperParent* aRhs)
     213                 : {
     214               0 :     if (MaybeDestroy(TPObjectWrapperParent)) {
     215               0 :         new (ptr_PObjectWrapperParent()) PObjectWrapperParent*;
     216                 :     }
     217               0 :     (*(ptr_PObjectWrapperParent())) = const_cast<PObjectWrapperParent*>(aRhs);
     218               0 :     mType = TPObjectWrapperParent;
     219               0 :     return (*(this));
     220                 : }
     221                 : 
     222                 : JSVariant&
     223               0 : JSVariant::operator=(PObjectWrapperChild* aRhs)
     224                 : {
     225               0 :     if (MaybeDestroy(TPObjectWrapperChild)) {
     226               0 :         new (ptr_PObjectWrapperChild()) PObjectWrapperChild*;
     227                 :     }
     228               0 :     (*(ptr_PObjectWrapperChild())) = const_cast<PObjectWrapperChild*>(aRhs);
     229               0 :     mType = TPObjectWrapperChild;
     230               0 :     return (*(this));
     231                 : }
     232                 : 
     233                 : JSVariant&
     234               0 : JSVariant::operator=(const nsString& aRhs)
     235                 : {
     236               0 :     if (MaybeDestroy(TnsString)) {
     237               0 :         new (ptr_nsString()) nsString;
     238                 :     }
     239               0 :     (*(ptr_nsString())) = aRhs;
     240               0 :     mType = TnsString;
     241               0 :     return (*(this));
     242                 : }
     243                 : 
     244                 : JSVariant&
     245               0 : JSVariant::operator=(const int& aRhs)
     246                 : {
     247               0 :     if (MaybeDestroy(Tint)) {
     248               0 :         new (ptr_int()) int;
     249                 :     }
     250               0 :     (*(ptr_int())) = aRhs;
     251               0 :     mType = Tint;
     252               0 :     return (*(this));
     253                 : }
     254                 : 
     255                 : JSVariant&
     256               0 : JSVariant::operator=(const double& aRhs)
     257                 : {
     258               0 :     if (MaybeDestroy(Tdouble)) {
     259               0 :         new (ptr_double()) double;
     260                 :     }
     261               0 :     (*(ptr_double())) = aRhs;
     262               0 :     mType = Tdouble;
     263               0 :     return (*(this));
     264                 : }
     265                 : 
     266                 : JSVariant&
     267               0 : JSVariant::operator=(const bool& aRhs)
     268                 : {
     269               0 :     if (MaybeDestroy(Tbool)) {
     270               0 :         new (ptr_bool()) bool;
     271                 :     }
     272               0 :     (*(ptr_bool())) = aRhs;
     273               0 :     mType = Tbool;
     274               0 :     return (*(this));
     275                 : }
     276                 : 
     277                 : JSVariant&
     278               0 : JSVariant::operator=(const JSVariant& aRhs)
     279                 : {
     280               0 :     (aRhs).AssertSanity();
     281               0 :     Type t = (aRhs).type();
     282               0 :     switch (t) {
     283                 :     case Tvoid_t:
     284                 :         {
     285               0 :             if (MaybeDestroy(t)) {
     286               0 :                 new (ptr_void_t()) void_t;
     287                 :             }
     288               0 :             (*(ptr_void_t())) = (aRhs).get_void_t();
     289               0 :             break;
     290                 :         }
     291                 :     case TPObjectWrapperParent:
     292                 :         {
     293               0 :             if (MaybeDestroy(t)) {
     294               0 :                 new (ptr_PObjectWrapperParent()) PObjectWrapperParent*;
     295                 :             }
     296               0 :             (*(ptr_PObjectWrapperParent())) = const_cast<PObjectWrapperParent*>((aRhs).get_PObjectWrapperParent());
     297               0 :             break;
     298                 :         }
     299                 :     case TPObjectWrapperChild:
     300                 :         {
     301               0 :             if (MaybeDestroy(t)) {
     302               0 :                 new (ptr_PObjectWrapperChild()) PObjectWrapperChild*;
     303                 :             }
     304               0 :             (*(ptr_PObjectWrapperChild())) = const_cast<PObjectWrapperChild*>((aRhs).get_PObjectWrapperChild());
     305               0 :             break;
     306                 :         }
     307                 :     case TnsString:
     308                 :         {
     309               0 :             if (MaybeDestroy(t)) {
     310               0 :                 new (ptr_nsString()) nsString;
     311                 :             }
     312               0 :             (*(ptr_nsString())) = (aRhs).get_nsString();
     313               0 :             break;
     314                 :         }
     315                 :     case Tint:
     316                 :         {
     317               0 :             if (MaybeDestroy(t)) {
     318               0 :                 new (ptr_int()) int;
     319                 :             }
     320               0 :             (*(ptr_int())) = (aRhs).get_int();
     321               0 :             break;
     322                 :         }
     323                 :     case Tdouble:
     324                 :         {
     325               0 :             if (MaybeDestroy(t)) {
     326               0 :                 new (ptr_double()) double;
     327                 :             }
     328               0 :             (*(ptr_double())) = (aRhs).get_double();
     329               0 :             break;
     330                 :         }
     331                 :     case Tbool:
     332                 :         {
     333               0 :             if (MaybeDestroy(t)) {
     334               0 :                 new (ptr_bool()) bool;
     335                 :             }
     336               0 :             (*(ptr_bool())) = (aRhs).get_bool();
     337               0 :             break;
     338                 :         }
     339                 :     case T__None:
     340                 :         {
     341               0 :             MaybeDestroy(t);
     342               0 :             break;
     343                 :         }
     344                 :     default:
     345                 :         {
     346               0 :             NS_RUNTIMEABORT("unreached");
     347               0 :             break;
     348                 :         }
     349                 :     }
     350               0 :     mType = t;
     351               0 :     return (*(this));
     352                 : }
     353                 : 
     354                 : bool
     355               0 : JSVariant::operator==(const void_t& aRhs) const
     356                 : {
     357               0 :     return (get_void_t()) == (aRhs);
     358                 : }
     359                 : 
     360                 : bool
     361               0 : JSVariant::operator==(PObjectWrapperParent* aRhs) const
     362                 : {
     363               0 :     return (get_PObjectWrapperParent()) == (aRhs);
     364                 : }
     365                 : 
     366                 : bool
     367               0 : JSVariant::operator==(PObjectWrapperChild* aRhs) const
     368                 : {
     369               0 :     return (get_PObjectWrapperChild()) == (aRhs);
     370                 : }
     371                 : 
     372                 : bool
     373               0 : JSVariant::operator==(const nsString& aRhs) const
     374                 : {
     375               0 :     return (get_nsString()) == (aRhs);
     376                 : }
     377                 : 
     378                 : bool
     379               0 : JSVariant::operator==(const int& aRhs) const
     380                 : {
     381               0 :     return (get_int()) == (aRhs);
     382                 : }
     383                 : 
     384                 : bool
     385               0 : JSVariant::operator==(const double& aRhs) const
     386                 : {
     387               0 :     return (get_double()) == (aRhs);
     388                 : }
     389                 : 
     390                 : bool
     391               0 : JSVariant::operator==(const bool& aRhs) const
     392                 : {
     393               0 :     return (get_bool()) == (aRhs);
     394                 : }
     395                 : 
     396                 : bool
     397               0 : JSVariant::operator==(const JSVariant& aRhs) const
     398                 : {
     399               0 :     if ((type()) != ((aRhs).type())) {
     400               0 :         return false;
     401                 :     }
     402                 : 
     403               0 :     switch (type()) {
     404                 :     case Tvoid_t:
     405                 :         {
     406               0 :             return (get_void_t()) == ((aRhs).get_void_t());
     407                 :         }
     408                 :     case TPObjectWrapperParent:
     409                 :         {
     410               0 :             return (get_PObjectWrapperParent()) == ((aRhs).get_PObjectWrapperParent());
     411                 :         }
     412                 :     case TPObjectWrapperChild:
     413                 :         {
     414               0 :             return (get_PObjectWrapperChild()) == ((aRhs).get_PObjectWrapperChild());
     415                 :         }
     416                 :     case TnsString:
     417                 :         {
     418               0 :             return (get_nsString()) == ((aRhs).get_nsString());
     419                 :         }
     420                 :     case Tint:
     421                 :         {
     422               0 :             return (get_int()) == ((aRhs).get_int());
     423                 :         }
     424                 :     case Tdouble:
     425                 :         {
     426               0 :             return (get_double()) == ((aRhs).get_double());
     427                 :         }
     428                 :     case Tbool:
     429                 :         {
     430               0 :             return (get_bool()) == ((aRhs).get_bool());
     431                 :         }
     432                 :     default:
     433                 :         {
     434               0 :             NS_RUNTIMEABORT("unreached");
     435               0 :             return false;
     436                 :         }
     437                 :     }
     438                 : }
     439                 : 
     440                 : } // namespace jsipc
     441                 : } // namespace mozilla
     442                 : 
     443                 : //-----------------------------------------------------------------------------
     444                 : // Method definitions for the IPDL type |union OperationStatus|
     445                 : //
     446                 : namespace mozilla {
     447                 : namespace jsipc {
     448                 : bool
     449               0 : OperationStatus::MaybeDestroy(Type aNewType)
     450                 : {
     451               0 :     if ((mType) == (T__None)) {
     452               0 :         return true;
     453                 :     }
     454               0 :     if ((mType) == (aNewType)) {
     455               0 :         return false;
     456                 :     }
     457               0 :     switch (mType) {
     458                 :     case TJSBool:
     459                 :         {
     460               0 :             (ptr_JSBool())->~JSBool__tdef();
     461               0 :             break;
     462                 :         }
     463                 :     case TJSVariant:
     464                 :         {
     465               0 :             (ptr_JSVariant())->~JSVariant__tdef();
     466               0 :             break;
     467                 :         }
     468                 :     default:
     469                 :         {
     470               0 :             NS_RUNTIMEABORT("not reached");
     471               0 :             break;
     472                 :         }
     473                 :     }
     474               0 :     return true;
     475                 : }
     476                 : 
     477               0 : OperationStatus::OperationStatus(const JSBool& aOther)
     478                 : {
     479               0 :     new (ptr_JSBool()) JSBool(aOther);
     480               0 :     mType = TJSBool;
     481               0 : }
     482                 : 
     483               0 : OperationStatus::OperationStatus(const JSVariant& aOther)
     484                 : {
     485               0 :     new (ptr_JSVariant()) JSVariant(aOther);
     486               0 :     mType = TJSVariant;
     487               0 : }
     488                 : 
     489               0 : OperationStatus::OperationStatus(const OperationStatus& aOther)
     490                 : {
     491               0 :     (aOther).AssertSanity();
     492               0 :     switch ((aOther).type()) {
     493                 :     case TJSBool:
     494                 :         {
     495               0 :             new (ptr_JSBool()) JSBool((aOther).get_JSBool());
     496               0 :             break;
     497                 :         }
     498                 :     case TJSVariant:
     499                 :         {
     500               0 :             new (ptr_JSVariant()) JSVariant((aOther).get_JSVariant());
     501               0 :             break;
     502                 :         }
     503                 :     case T__None:
     504                 :         {
     505               0 :             break;
     506                 :         }
     507                 :     default:
     508                 :         {
     509               0 :             NS_RUNTIMEABORT("unreached");
     510               0 :             return;
     511                 :         }
     512                 :     }
     513               0 :     mType = (aOther).type();
     514                 : }
     515                 : 
     516               0 : OperationStatus::~OperationStatus()
     517                 : {
     518               0 :     MaybeDestroy(T__None);
     519               0 : }
     520                 : 
     521                 : OperationStatus&
     522               0 : OperationStatus::operator=(const JSBool& aRhs)
     523                 : {
     524               0 :     if (MaybeDestroy(TJSBool)) {
     525               0 :         new (ptr_JSBool()) JSBool;
     526                 :     }
     527               0 :     (*(ptr_JSBool())) = aRhs;
     528               0 :     mType = TJSBool;
     529               0 :     return (*(this));
     530                 : }
     531                 : 
     532                 : OperationStatus&
     533               0 : OperationStatus::operator=(const JSVariant& aRhs)
     534                 : {
     535               0 :     if (MaybeDestroy(TJSVariant)) {
     536               0 :         new (ptr_JSVariant()) JSVariant;
     537                 :     }
     538               0 :     (*(ptr_JSVariant())) = aRhs;
     539               0 :     mType = TJSVariant;
     540               0 :     return (*(this));
     541                 : }
     542                 : 
     543                 : OperationStatus&
     544               0 : OperationStatus::operator=(const OperationStatus& aRhs)
     545                 : {
     546               0 :     (aRhs).AssertSanity();
     547               0 :     Type t = (aRhs).type();
     548               0 :     switch (t) {
     549                 :     case TJSBool:
     550                 :         {
     551               0 :             if (MaybeDestroy(t)) {
     552               0 :                 new (ptr_JSBool()) JSBool;
     553                 :             }
     554               0 :             (*(ptr_JSBool())) = (aRhs).get_JSBool();
     555               0 :             break;
     556                 :         }
     557                 :     case TJSVariant:
     558                 :         {
     559               0 :             if (MaybeDestroy(t)) {
     560               0 :                 new (ptr_JSVariant()) JSVariant;
     561                 :             }
     562               0 :             (*(ptr_JSVariant())) = (aRhs).get_JSVariant();
     563               0 :             break;
     564                 :         }
     565                 :     case T__None:
     566                 :         {
     567               0 :             MaybeDestroy(t);
     568               0 :             break;
     569                 :         }
     570                 :     default:
     571                 :         {
     572               0 :             NS_RUNTIMEABORT("unreached");
     573               0 :             break;
     574                 :         }
     575                 :     }
     576               0 :     mType = t;
     577               0 :     return (*(this));
     578                 : }
     579                 : 
     580                 : bool
     581               0 : OperationStatus::operator==(const JSBool& aRhs) const
     582                 : {
     583               0 :     return (get_JSBool()) == (aRhs);
     584                 : }
     585                 : 
     586                 : bool
     587               0 : OperationStatus::operator==(const JSVariant& aRhs) const
     588                 : {
     589               0 :     return (get_JSVariant()) == (aRhs);
     590                 : }
     591                 : 
     592                 : bool
     593               0 : OperationStatus::operator==(const OperationStatus& aRhs) const
     594                 : {
     595               0 :     if ((type()) != ((aRhs).type())) {
     596               0 :         return false;
     597                 :     }
     598                 : 
     599               0 :     switch (type()) {
     600                 :     case TJSBool:
     601                 :         {
     602               0 :             return (get_JSBool()) == ((aRhs).get_JSBool());
     603                 :         }
     604                 :     case TJSVariant:
     605                 :         {
     606               0 :             return (get_JSVariant()) == ((aRhs).get_JSVariant());
     607                 :         }
     608                 :     default:
     609                 :         {
     610               0 :             NS_RUNTIMEABORT("unreached");
     611               0 :             return false;
     612                 :         }
     613                 :     }
     614                 : }
     615                 : 
     616                 : } // namespace jsipc
     617                 : } // namespace mozilla

Generated by: LCOV version 1.7