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

       1                 : //
       2                 : // Automatically generated by ipdlc.
       3                 : // Edit at your own risk
       4                 : //
       5                 : 
       6                 : 
       7                 : #include "mozilla/dom/PStorage.h"
       8                 : 
       9                 : namespace mozilla {
      10                 : namespace dom {
      11                 : namespace PStorage {
      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 PStorage
      39                 : } // namespace dom
      40                 : } // namespace mozilla
      41                 : 
      42                 : //-----------------------------------------------------------------------------
      43                 : // Method definitions for the IPDL type |struct ItemData|
      44                 : //
      45                 : namespace mozilla {
      46                 : namespace dom {
      47               0 : ItemData::ItemData()
      48                 : {
      49               0 :     Init();
      50               0 : }
      51                 : 
      52               0 : ItemData::~ItemData()
      53                 : {
      54               0 : }
      55                 : 
      56                 : bool
      57               0 : ItemData::operator==(const ItemData& _o) const
      58                 : {
      59               0 :     if ((!((value()) == ((_o).value())))) {
      60               0 :         return false;
      61                 :     }
      62               0 :     if ((!((secure()) == ((_o).secure())))) {
      63               0 :         return false;
      64                 :     }
      65               0 :     return true;
      66                 : }
      67                 : 
      68                 : void
      69               0 : ItemData::Init()
      70                 : {
      71               0 : }
      72                 : 
      73                 : void
      74               0 : ItemData::Assign(
      75                 :         const nsString& _value,
      76                 :         const bool& _secure)
      77                 : {
      78               0 :     value_ = _value;
      79               0 :     secure_ = _secure;
      80               0 : }
      81                 : 
      82                 : } // namespace dom
      83                 : } // namespace mozilla
      84                 : 
      85                 : //-----------------------------------------------------------------------------
      86                 : // Method definitions for the IPDL type |union StorageItem|
      87                 : //
      88                 : namespace mozilla {
      89                 : namespace dom {
      90                 : bool
      91               0 : StorageItem::MaybeDestroy(Type aNewType)
      92                 : {
      93               0 :     if ((mType) == (T__None)) {
      94               0 :         return true;
      95                 :     }
      96               0 :     if ((mType) == (aNewType)) {
      97               0 :         return false;
      98                 :     }
      99               0 :     switch (mType) {
     100                 :     case Tnull_t:
     101                 :         {
     102               0 :             (ptr_null_t())->~null_t__tdef();
     103               0 :             break;
     104                 :         }
     105                 :     case TItemData:
     106                 :         {
     107               0 :             (ptr_ItemData())->~ItemData__tdef();
     108               0 :             break;
     109                 :         }
     110                 :     default:
     111                 :         {
     112               0 :             NS_RUNTIMEABORT("not reached");
     113               0 :             break;
     114                 :         }
     115                 :     }
     116               0 :     return true;
     117                 : }
     118                 : 
     119               0 : StorageItem::StorageItem(const null_t& aOther)
     120                 : {
     121               0 :     new (ptr_null_t()) null_t(aOther);
     122               0 :     mType = Tnull_t;
     123               0 : }
     124                 : 
     125               0 : StorageItem::StorageItem(const ItemData& aOther)
     126                 : {
     127               0 :     new (ptr_ItemData()) ItemData(aOther);
     128               0 :     mType = TItemData;
     129               0 : }
     130                 : 
     131               0 : StorageItem::StorageItem(const StorageItem& aOther)
     132                 : {
     133               0 :     (aOther).AssertSanity();
     134               0 :     switch ((aOther).type()) {
     135                 :     case Tnull_t:
     136                 :         {
     137               0 :             new (ptr_null_t()) null_t((aOther).get_null_t());
     138               0 :             break;
     139                 :         }
     140                 :     case TItemData:
     141                 :         {
     142               0 :             new (ptr_ItemData()) ItemData((aOther).get_ItemData());
     143               0 :             break;
     144                 :         }
     145                 :     case T__None:
     146                 :         {
     147               0 :             break;
     148                 :         }
     149                 :     default:
     150                 :         {
     151               0 :             NS_RUNTIMEABORT("unreached");
     152               0 :             return;
     153                 :         }
     154                 :     }
     155               0 :     mType = (aOther).type();
     156                 : }
     157                 : 
     158               0 : StorageItem::~StorageItem()
     159                 : {
     160               0 :     MaybeDestroy(T__None);
     161               0 : }
     162                 : 
     163                 : StorageItem&
     164               0 : StorageItem::operator=(const null_t& aRhs)
     165                 : {
     166               0 :     if (MaybeDestroy(Tnull_t)) {
     167               0 :         new (ptr_null_t()) null_t;
     168                 :     }
     169               0 :     (*(ptr_null_t())) = aRhs;
     170               0 :     mType = Tnull_t;
     171               0 :     return (*(this));
     172                 : }
     173                 : 
     174                 : StorageItem&
     175               0 : StorageItem::operator=(const ItemData& aRhs)
     176                 : {
     177               0 :     if (MaybeDestroy(TItemData)) {
     178               0 :         new (ptr_ItemData()) ItemData;
     179                 :     }
     180               0 :     (*(ptr_ItemData())) = aRhs;
     181               0 :     mType = TItemData;
     182               0 :     return (*(this));
     183                 : }
     184                 : 
     185                 : StorageItem&
     186               0 : StorageItem::operator=(const StorageItem& aRhs)
     187                 : {
     188               0 :     (aRhs).AssertSanity();
     189               0 :     Type t = (aRhs).type();
     190               0 :     switch (t) {
     191                 :     case Tnull_t:
     192                 :         {
     193               0 :             if (MaybeDestroy(t)) {
     194               0 :                 new (ptr_null_t()) null_t;
     195                 :             }
     196               0 :             (*(ptr_null_t())) = (aRhs).get_null_t();
     197               0 :             break;
     198                 :         }
     199                 :     case TItemData:
     200                 :         {
     201               0 :             if (MaybeDestroy(t)) {
     202               0 :                 new (ptr_ItemData()) ItemData;
     203                 :             }
     204               0 :             (*(ptr_ItemData())) = (aRhs).get_ItemData();
     205               0 :             break;
     206                 :         }
     207                 :     case T__None:
     208                 :         {
     209               0 :             MaybeDestroy(t);
     210               0 :             break;
     211                 :         }
     212                 :     default:
     213                 :         {
     214               0 :             NS_RUNTIMEABORT("unreached");
     215               0 :             break;
     216                 :         }
     217                 :     }
     218               0 :     mType = t;
     219               0 :     return (*(this));
     220                 : }
     221                 : 
     222                 : bool
     223               0 : StorageItem::operator==(const null_t& aRhs) const
     224                 : {
     225               0 :     return (get_null_t()) == (aRhs);
     226                 : }
     227                 : 
     228                 : bool
     229               0 : StorageItem::operator==(const ItemData& aRhs) const
     230                 : {
     231               0 :     return (get_ItemData()) == (aRhs);
     232                 : }
     233                 : 
     234                 : bool
     235               0 : StorageItem::operator==(const StorageItem& aRhs) const
     236                 : {
     237               0 :     if ((type()) != ((aRhs).type())) {
     238               0 :         return false;
     239                 :     }
     240                 : 
     241               0 :     switch (type()) {
     242                 :     case Tnull_t:
     243                 :         {
     244               0 :             return (get_null_t()) == ((aRhs).get_null_t());
     245                 :         }
     246                 :     case TItemData:
     247                 :         {
     248               0 :             return (get_ItemData()) == ((aRhs).get_ItemData());
     249                 :         }
     250                 :     default:
     251                 :         {
     252               0 :             NS_RUNTIMEABORT("unreached");
     253               0 :             return false;
     254                 :         }
     255                 :     }
     256                 : }
     257                 : 
     258                 : } // namespace dom
     259                 : } // namespace mozilla

Generated by: LCOV version 1.7