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

       1                 : //
       2                 : // Automatically generated by ipdlc.
       3                 : // Edit at your own risk
       4                 : //
       5                 : 
       6                 : 
       7                 : #include "mozilla/hal_sandbox/PHalChild.h"
       8                 : 
       9                 : #include "mozilla/dom/PContentChild.h"
      10                 : #include "mozilla/dom/PBrowserChild.h"
      11                 : 
      12                 : typedef IPC::Message Message;
      13                 : typedef mozilla::ipc::RPCChannel Channel;
      14                 : typedef mozilla::ipc::RPCChannel::RPCListener ChannelListener;
      15                 : typedef base::ProcessHandle ProcessHandle;
      16                 : typedef mozilla::ipc::AsyncChannel AsyncChannel;
      17                 : typedef mozilla::ipc::SharedMemory SharedMemory;
      18                 : typedef mozilla::ipc::Trigger Trigger;
      19                 : typedef mozilla::ipc::ActorHandle ActorHandle;
      20                 : typedef mozilla::hal::BatteryInformation BatteryInformation;
      21                 : typedef mozilla::hal::LightConfiguration LightConfiguration;
      22                 : typedef mozilla::hal::SensorData SensorData;
      23                 : typedef mozilla::hal::NetworkInformation NetworkInformation;
      24                 : typedef mozilla::hal::WakeLockInformation WakeLockInformation;
      25                 : typedef mozilla::ipc::Shmem Shmem;
      26                 : typedef mozilla::hal::FlashMode FlashMode;
      27                 : typedef mozilla::hal::LightType LightType;
      28                 : typedef mozilla::hal::LightMode LightMode;
      29                 : typedef mozilla::hal::SensorType SensorType;
      30                 : typedef mozilla::hal::WakeLockControl WakeLockControl;
      31                 : using mozilla::dom::PContentChild;
      32                 : using mozilla::dom::PBrowserChild;
      33                 : 
      34                 : namespace mozilla {
      35                 : namespace hal_sandbox {
      36                 : 
      37                 : 
      38                 : void
      39               0 : PHalChild::ActorDestroy(ActorDestroyReason why)
      40                 : {
      41               0 : }
      42                 : 
      43               0 : PHalChild::PHalChild() :
      44                 :     mId(0),
      45               0 :     mState(PHal::__Dead)
      46                 : {
      47               0 :     MOZ_COUNT_CTOR(PHalChild);
      48               0 : }
      49                 : 
      50               0 : PHalChild::~PHalChild()
      51                 : {
      52               0 :     MOZ_COUNT_DTOR(PHalChild);
      53               0 : }
      54                 : 
      55                 : PContentChild*
      56               0 : PHalChild::Manager()
      57                 : {
      58               0 :     return static_cast<PContentChild*>(mManager);
      59                 : }
      60                 : 
      61                 : PHal::State
      62               0 : PHalChild::state()
      63                 : {
      64               0 :     return mState;
      65                 : }
      66                 : 
      67                 : bool
      68               0 : PHalChild::SendVibrate(
      69                 :         const InfallibleTArray<uint32>& pattern,
      70                 :         const InfallibleTArray<uint64>& id,
      71                 :         PBrowserChild* browser)
      72                 : {
      73               0 :     PHal::Msg_Vibrate* __msg = new PHal::Msg_Vibrate();
      74                 : 
      75               0 :     Write(pattern, __msg);
      76               0 :     Write(id, __msg);
      77               0 :     Write(browser, __msg, false);
      78                 : 
      79               0 :     (__msg)->set_routing_id(mId);
      80                 : 
      81                 : 
      82                 : 
      83               0 :     if (mozilla::ipc::LoggingEnabled()) {
      84               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
      85                 :     }
      86               0 :     if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_Vibrate__ID), (&(mState)))))) {
      87               0 :         NS_WARNING("bad state transition!");
      88                 :     }
      89                 : 
      90               0 :     bool __sendok = (mChannel)->Send(__msg);
      91               0 :     return __sendok;
      92                 : }
      93                 : 
      94                 : bool
      95               0 : PHalChild::SendCancelVibrate(
      96                 :         const InfallibleTArray<uint64>& id,
      97                 :         PBrowserChild* browser)
      98                 : {
      99               0 :     PHal::Msg_CancelVibrate* __msg = new PHal::Msg_CancelVibrate();
     100                 : 
     101               0 :     Write(id, __msg);
     102               0 :     Write(browser, __msg, false);
     103                 : 
     104               0 :     (__msg)->set_routing_id(mId);
     105                 : 
     106                 : 
     107                 : 
     108               0 :     if (mozilla::ipc::LoggingEnabled()) {
     109               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
     110                 :     }
     111               0 :     if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_CancelVibrate__ID), (&(mState)))))) {
     112               0 :         NS_WARNING("bad state transition!");
     113                 :     }
     114                 : 
     115               0 :     bool __sendok = (mChannel)->Send(__msg);
     116               0 :     return __sendok;
     117                 : }
     118                 : 
     119                 : bool
     120               0 : PHalChild::SendEnableBatteryNotifications()
     121                 : {
     122               0 :     PHal::Msg_EnableBatteryNotifications* __msg = new PHal::Msg_EnableBatteryNotifications();
     123                 : 
     124                 : 
     125               0 :     (__msg)->set_routing_id(mId);
     126                 : 
     127                 : 
     128                 : 
     129               0 :     if (mozilla::ipc::LoggingEnabled()) {
     130               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
     131                 :     }
     132               0 :     if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_EnableBatteryNotifications__ID), (&(mState)))))) {
     133               0 :         NS_WARNING("bad state transition!");
     134                 :     }
     135                 : 
     136               0 :     bool __sendok = (mChannel)->Send(__msg);
     137               0 :     return __sendok;
     138                 : }
     139                 : 
     140                 : bool
     141               0 : PHalChild::SendDisableBatteryNotifications()
     142                 : {
     143               0 :     PHal::Msg_DisableBatteryNotifications* __msg = new PHal::Msg_DisableBatteryNotifications();
     144                 : 
     145                 : 
     146               0 :     (__msg)->set_routing_id(mId);
     147                 : 
     148                 : 
     149                 : 
     150               0 :     if (mozilla::ipc::LoggingEnabled()) {
     151               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
     152                 :     }
     153               0 :     if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_DisableBatteryNotifications__ID), (&(mState)))))) {
     154               0 :         NS_WARNING("bad state transition!");
     155                 :     }
     156                 : 
     157               0 :     bool __sendok = (mChannel)->Send(__msg);
     158               0 :     return __sendok;
     159                 : }
     160                 : 
     161                 : bool
     162               0 : PHalChild::SendGetCurrentBatteryInformation(BatteryInformation* aBatteryInfo)
     163                 : {
     164               0 :     PHal::Msg_GetCurrentBatteryInformation* __msg = new PHal::Msg_GetCurrentBatteryInformation();
     165                 : 
     166                 : 
     167               0 :     (__msg)->set_routing_id(mId);
     168               0 :     (__msg)->set_sync();
     169                 : 
     170                 : 
     171               0 :     Message __reply;
     172                 : 
     173               0 :     if (mozilla::ipc::LoggingEnabled()) {
     174               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
     175                 :     }
     176               0 :     if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_GetCurrentBatteryInformation__ID), (&(mState)))))) {
     177               0 :         NS_WARNING("bad state transition!");
     178                 :     }
     179                 : 
     180               0 :     bool __sendok = (mChannel)->Send(__msg, (&(__reply)));
     181               0 :     if ((!(__sendok))) {
     182               0 :         return false;
     183                 :     }
     184                 : 
     185               0 :     if (mozilla::ipc::LoggingEnabled()) {
     186               0 :         (static_cast<const PHal::Reply_GetCurrentBatteryInformation*>((&(__reply))))->Log("[PHalChild] Received reply ", stderr);
     187                 :     }
     188                 : 
     189               0 :     void* __iter = 0;
     190               0 :     if ((!(Read(aBatteryInfo, (&(__reply)), (&(__iter)))))) {
     191               0 :         FatalError("error deserializing (better message TODO)");
     192               0 :         return false;
     193                 :     }
     194               0 :     (__reply).EndRead(__iter);
     195                 : 
     196               0 :     return true;
     197                 : }
     198                 : 
     199                 : bool
     200               0 : PHalChild::SendEnableNetworkNotifications()
     201                 : {
     202               0 :     PHal::Msg_EnableNetworkNotifications* __msg = new PHal::Msg_EnableNetworkNotifications();
     203                 : 
     204                 : 
     205               0 :     (__msg)->set_routing_id(mId);
     206                 : 
     207                 : 
     208                 : 
     209               0 :     if (mozilla::ipc::LoggingEnabled()) {
     210               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
     211                 :     }
     212               0 :     if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_EnableNetworkNotifications__ID), (&(mState)))))) {
     213               0 :         NS_WARNING("bad state transition!");
     214                 :     }
     215                 : 
     216               0 :     bool __sendok = (mChannel)->Send(__msg);
     217               0 :     return __sendok;
     218                 : }
     219                 : 
     220                 : bool
     221               0 : PHalChild::SendDisableNetworkNotifications()
     222                 : {
     223               0 :     PHal::Msg_DisableNetworkNotifications* __msg = new PHal::Msg_DisableNetworkNotifications();
     224                 : 
     225                 : 
     226               0 :     (__msg)->set_routing_id(mId);
     227                 : 
     228                 : 
     229                 : 
     230               0 :     if (mozilla::ipc::LoggingEnabled()) {
     231               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
     232                 :     }
     233               0 :     if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_DisableNetworkNotifications__ID), (&(mState)))))) {
     234               0 :         NS_WARNING("bad state transition!");
     235                 :     }
     236                 : 
     237               0 :     bool __sendok = (mChannel)->Send(__msg);
     238               0 :     return __sendok;
     239                 : }
     240                 : 
     241                 : bool
     242               0 : PHalChild::SendGetCurrentNetworkInformation(NetworkInformation* aNetworkInfo)
     243                 : {
     244               0 :     PHal::Msg_GetCurrentNetworkInformation* __msg = new PHal::Msg_GetCurrentNetworkInformation();
     245                 : 
     246                 : 
     247               0 :     (__msg)->set_routing_id(mId);
     248               0 :     (__msg)->set_sync();
     249                 : 
     250                 : 
     251               0 :     Message __reply;
     252                 : 
     253               0 :     if (mozilla::ipc::LoggingEnabled()) {
     254               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
     255                 :     }
     256               0 :     if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_GetCurrentNetworkInformation__ID), (&(mState)))))) {
     257               0 :         NS_WARNING("bad state transition!");
     258                 :     }
     259                 : 
     260               0 :     bool __sendok = (mChannel)->Send(__msg, (&(__reply)));
     261               0 :     if ((!(__sendok))) {
     262               0 :         return false;
     263                 :     }
     264                 : 
     265               0 :     if (mozilla::ipc::LoggingEnabled()) {
     266               0 :         (static_cast<const PHal::Reply_GetCurrentNetworkInformation*>((&(__reply))))->Log("[PHalChild] Received reply ", stderr);
     267                 :     }
     268                 : 
     269               0 :     void* __iter = 0;
     270               0 :     if ((!(Read(aNetworkInfo, (&(__reply)), (&(__iter)))))) {
     271               0 :         FatalError("error deserializing (better message TODO)");
     272               0 :         return false;
     273                 :     }
     274               0 :     (__reply).EndRead(__iter);
     275                 : 
     276               0 :     return true;
     277                 : }
     278                 : 
     279                 : bool
     280               0 : PHalChild::SendGetScreenEnabled(bool* enabled)
     281                 : {
     282               0 :     PHal::Msg_GetScreenEnabled* __msg = new PHal::Msg_GetScreenEnabled();
     283                 : 
     284                 : 
     285               0 :     (__msg)->set_routing_id(mId);
     286               0 :     (__msg)->set_sync();
     287                 : 
     288                 : 
     289               0 :     Message __reply;
     290                 : 
     291               0 :     if (mozilla::ipc::LoggingEnabled()) {
     292               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
     293                 :     }
     294               0 :     if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_GetScreenEnabled__ID), (&(mState)))))) {
     295               0 :         NS_WARNING("bad state transition!");
     296                 :     }
     297                 : 
     298               0 :     bool __sendok = (mChannel)->Send(__msg, (&(__reply)));
     299               0 :     if ((!(__sendok))) {
     300               0 :         return false;
     301                 :     }
     302                 : 
     303               0 :     if (mozilla::ipc::LoggingEnabled()) {
     304               0 :         (static_cast<const PHal::Reply_GetScreenEnabled*>((&(__reply))))->Log("[PHalChild] Received reply ", stderr);
     305                 :     }
     306                 : 
     307               0 :     void* __iter = 0;
     308               0 :     if ((!(Read(enabled, (&(__reply)), (&(__iter)))))) {
     309               0 :         FatalError("error deserializing (better message TODO)");
     310               0 :         return false;
     311                 :     }
     312               0 :     (__reply).EndRead(__iter);
     313                 : 
     314               0 :     return true;
     315                 : }
     316                 : 
     317                 : bool
     318               0 : PHalChild::SendSetScreenEnabled(const bool& enabled)
     319                 : {
     320               0 :     PHal::Msg_SetScreenEnabled* __msg = new PHal::Msg_SetScreenEnabled();
     321                 : 
     322               0 :     Write(enabled, __msg);
     323                 : 
     324               0 :     (__msg)->set_routing_id(mId);
     325                 : 
     326                 : 
     327                 : 
     328               0 :     if (mozilla::ipc::LoggingEnabled()) {
     329               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
     330                 :     }
     331               0 :     if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_SetScreenEnabled__ID), (&(mState)))))) {
     332               0 :         NS_WARNING("bad state transition!");
     333                 :     }
     334                 : 
     335               0 :     bool __sendok = (mChannel)->Send(__msg);
     336               0 :     return __sendok;
     337                 : }
     338                 : 
     339                 : bool
     340               0 : PHalChild::SendGetScreenBrightness(double* brightness)
     341                 : {
     342               0 :     PHal::Msg_GetScreenBrightness* __msg = new PHal::Msg_GetScreenBrightness();
     343                 : 
     344                 : 
     345               0 :     (__msg)->set_routing_id(mId);
     346               0 :     (__msg)->set_sync();
     347                 : 
     348                 : 
     349               0 :     Message __reply;
     350                 : 
     351               0 :     if (mozilla::ipc::LoggingEnabled()) {
     352               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
     353                 :     }
     354               0 :     if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_GetScreenBrightness__ID), (&(mState)))))) {
     355               0 :         NS_WARNING("bad state transition!");
     356                 :     }
     357                 : 
     358               0 :     bool __sendok = (mChannel)->Send(__msg, (&(__reply)));
     359               0 :     if ((!(__sendok))) {
     360               0 :         return false;
     361                 :     }
     362                 : 
     363               0 :     if (mozilla::ipc::LoggingEnabled()) {
     364               0 :         (static_cast<const PHal::Reply_GetScreenBrightness*>((&(__reply))))->Log("[PHalChild] Received reply ", stderr);
     365                 :     }
     366                 : 
     367               0 :     void* __iter = 0;
     368               0 :     if ((!(Read(brightness, (&(__reply)), (&(__iter)))))) {
     369               0 :         FatalError("error deserializing (better message TODO)");
     370               0 :         return false;
     371                 :     }
     372               0 :     (__reply).EndRead(__iter);
     373                 : 
     374               0 :     return true;
     375                 : }
     376                 : 
     377                 : bool
     378               0 : PHalChild::SendSetScreenBrightness(const double& brightness)
     379                 : {
     380               0 :     PHal::Msg_SetScreenBrightness* __msg = new PHal::Msg_SetScreenBrightness();
     381                 : 
     382               0 :     Write(brightness, __msg);
     383                 : 
     384               0 :     (__msg)->set_routing_id(mId);
     385                 : 
     386                 : 
     387                 : 
     388               0 :     if (mozilla::ipc::LoggingEnabled()) {
     389               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
     390                 :     }
     391               0 :     if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_SetScreenBrightness__ID), (&(mState)))))) {
     392               0 :         NS_WARNING("bad state transition!");
     393                 :     }
     394                 : 
     395               0 :     bool __sendok = (mChannel)->Send(__msg);
     396               0 :     return __sendok;
     397                 : }
     398                 : 
     399                 : bool
     400               0 : PHalChild::SendAdjustSystemClock(const int32& aDeltaMilliseconds)
     401                 : {
     402               0 :     PHal::Msg_AdjustSystemClock* __msg = new PHal::Msg_AdjustSystemClock();
     403                 : 
     404               0 :     Write(aDeltaMilliseconds, __msg);
     405                 : 
     406               0 :     (__msg)->set_routing_id(mId);
     407                 : 
     408                 : 
     409                 : 
     410               0 :     if (mozilla::ipc::LoggingEnabled()) {
     411               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
     412                 :     }
     413               0 :     if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_AdjustSystemClock__ID), (&(mState)))))) {
     414               0 :         NS_WARNING("bad state transition!");
     415                 :     }
     416                 : 
     417               0 :     bool __sendok = (mChannel)->Send(__msg);
     418               0 :     return __sendok;
     419                 : }
     420                 : 
     421                 : bool
     422               0 : PHalChild::SendSetTimezone(const nsCString& aTimezoneSpec)
     423                 : {
     424               0 :     PHal::Msg_SetTimezone* __msg = new PHal::Msg_SetTimezone();
     425                 : 
     426               0 :     Write(aTimezoneSpec, __msg);
     427                 : 
     428               0 :     (__msg)->set_routing_id(mId);
     429                 : 
     430                 : 
     431                 : 
     432               0 :     if (mozilla::ipc::LoggingEnabled()) {
     433               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
     434                 :     }
     435               0 :     if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_SetTimezone__ID), (&(mState)))))) {
     436               0 :         NS_WARNING("bad state transition!");
     437                 :     }
     438                 : 
     439               0 :     bool __sendok = (mChannel)->Send(__msg);
     440               0 :     return __sendok;
     441                 : }
     442                 : 
     443                 : bool
     444               0 : PHalChild::SendSetLight(
     445                 :         const LightType& light,
     446                 :         const LightConfiguration& aConfig,
     447                 :         bool* status)
     448                 : {
     449               0 :     PHal::Msg_SetLight* __msg = new PHal::Msg_SetLight();
     450                 : 
     451               0 :     Write(light, __msg);
     452               0 :     Write(aConfig, __msg);
     453                 : 
     454               0 :     (__msg)->set_routing_id(mId);
     455               0 :     (__msg)->set_sync();
     456                 : 
     457                 : 
     458               0 :     Message __reply;
     459                 : 
     460               0 :     if (mozilla::ipc::LoggingEnabled()) {
     461               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
     462                 :     }
     463               0 :     if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_SetLight__ID), (&(mState)))))) {
     464               0 :         NS_WARNING("bad state transition!");
     465                 :     }
     466                 : 
     467               0 :     bool __sendok = (mChannel)->Send(__msg, (&(__reply)));
     468               0 :     if ((!(__sendok))) {
     469               0 :         return false;
     470                 :     }
     471                 : 
     472               0 :     if (mozilla::ipc::LoggingEnabled()) {
     473               0 :         (static_cast<const PHal::Reply_SetLight*>((&(__reply))))->Log("[PHalChild] Received reply ", stderr);
     474                 :     }
     475                 : 
     476               0 :     void* __iter = 0;
     477               0 :     if ((!(Read(status, (&(__reply)), (&(__iter)))))) {
     478               0 :         FatalError("error deserializing (better message TODO)");
     479               0 :         return false;
     480                 :     }
     481               0 :     (__reply).EndRead(__iter);
     482                 : 
     483               0 :     return true;
     484                 : }
     485                 : 
     486                 : bool
     487               0 : PHalChild::SendGetLight(
     488                 :         const LightType& light,
     489                 :         LightConfiguration* aConfig,
     490                 :         bool* status)
     491                 : {
     492               0 :     PHal::Msg_GetLight* __msg = new PHal::Msg_GetLight();
     493                 : 
     494               0 :     Write(light, __msg);
     495                 : 
     496               0 :     (__msg)->set_routing_id(mId);
     497               0 :     (__msg)->set_sync();
     498                 : 
     499                 : 
     500               0 :     Message __reply;
     501                 : 
     502               0 :     if (mozilla::ipc::LoggingEnabled()) {
     503               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
     504                 :     }
     505               0 :     if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_GetLight__ID), (&(mState)))))) {
     506               0 :         NS_WARNING("bad state transition!");
     507                 :     }
     508                 : 
     509               0 :     bool __sendok = (mChannel)->Send(__msg, (&(__reply)));
     510               0 :     if ((!(__sendok))) {
     511               0 :         return false;
     512                 :     }
     513                 : 
     514               0 :     if (mozilla::ipc::LoggingEnabled()) {
     515               0 :         (static_cast<const PHal::Reply_GetLight*>((&(__reply))))->Log("[PHalChild] Received reply ", stderr);
     516                 :     }
     517                 : 
     518               0 :     void* __iter = 0;
     519               0 :     if ((!(Read(aConfig, (&(__reply)), (&(__iter)))))) {
     520               0 :         FatalError("error deserializing (better message TODO)");
     521               0 :         return false;
     522                 :     }
     523               0 :     if ((!(Read(status, (&(__reply)), (&(__iter)))))) {
     524               0 :         FatalError("error deserializing (better message TODO)");
     525               0 :         return false;
     526                 :     }
     527               0 :     (__reply).EndRead(__iter);
     528                 : 
     529               0 :     return true;
     530                 : }
     531                 : 
     532                 : bool
     533               0 : PHalChild::SendReboot()
     534                 : {
     535               0 :     PHal::Msg_Reboot* __msg = new PHal::Msg_Reboot();
     536                 : 
     537                 : 
     538               0 :     (__msg)->set_routing_id(mId);
     539                 : 
     540                 : 
     541                 : 
     542               0 :     if (mozilla::ipc::LoggingEnabled()) {
     543               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
     544                 :     }
     545               0 :     if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_Reboot__ID), (&(mState)))))) {
     546               0 :         NS_WARNING("bad state transition!");
     547                 :     }
     548                 : 
     549               0 :     bool __sendok = (mChannel)->Send(__msg);
     550               0 :     return __sendok;
     551                 : }
     552                 : 
     553                 : bool
     554               0 : PHalChild::SendPowerOff()
     555                 : {
     556               0 :     PHal::Msg_PowerOff* __msg = new PHal::Msg_PowerOff();
     557                 : 
     558                 : 
     559               0 :     (__msg)->set_routing_id(mId);
     560                 : 
     561                 : 
     562                 : 
     563               0 :     if (mozilla::ipc::LoggingEnabled()) {
     564               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
     565                 :     }
     566               0 :     if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_PowerOff__ID), (&(mState)))))) {
     567               0 :         NS_WARNING("bad state transition!");
     568                 :     }
     569                 : 
     570               0 :     bool __sendok = (mChannel)->Send(__msg);
     571               0 :     return __sendok;
     572                 : }
     573                 : 
     574                 : bool
     575               0 : PHalChild::SendModifyWakeLock(
     576                 :         const nsString& aTopic,
     577                 :         const WakeLockControl& aLockAdjust,
     578                 :         const WakeLockControl& aHiddenAdjust)
     579                 : {
     580               0 :     PHal::Msg_ModifyWakeLock* __msg = new PHal::Msg_ModifyWakeLock();
     581                 : 
     582               0 :     Write(aTopic, __msg);
     583               0 :     Write(aLockAdjust, __msg);
     584               0 :     Write(aHiddenAdjust, __msg);
     585                 : 
     586               0 :     (__msg)->set_routing_id(mId);
     587                 : 
     588                 : 
     589                 : 
     590               0 :     if (mozilla::ipc::LoggingEnabled()) {
     591               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
     592                 :     }
     593               0 :     if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_ModifyWakeLock__ID), (&(mState)))))) {
     594               0 :         NS_WARNING("bad state transition!");
     595                 :     }
     596                 : 
     597               0 :     bool __sendok = (mChannel)->Send(__msg);
     598               0 :     return __sendok;
     599                 : }
     600                 : 
     601                 : bool
     602               0 : PHalChild::SendEnableWakeLockNotifications()
     603                 : {
     604               0 :     PHal::Msg_EnableWakeLockNotifications* __msg = new PHal::Msg_EnableWakeLockNotifications();
     605                 : 
     606                 : 
     607               0 :     (__msg)->set_routing_id(mId);
     608                 : 
     609                 : 
     610                 : 
     611               0 :     if (mozilla::ipc::LoggingEnabled()) {
     612               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
     613                 :     }
     614               0 :     if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_EnableWakeLockNotifications__ID), (&(mState)))))) {
     615               0 :         NS_WARNING("bad state transition!");
     616                 :     }
     617                 : 
     618               0 :     bool __sendok = (mChannel)->Send(__msg);
     619               0 :     return __sendok;
     620                 : }
     621                 : 
     622                 : bool
     623               0 : PHalChild::SendDisableWakeLockNotifications()
     624                 : {
     625               0 :     PHal::Msg_DisableWakeLockNotifications* __msg = new PHal::Msg_DisableWakeLockNotifications();
     626                 : 
     627                 : 
     628               0 :     (__msg)->set_routing_id(mId);
     629                 : 
     630                 : 
     631                 : 
     632               0 :     if (mozilla::ipc::LoggingEnabled()) {
     633               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
     634                 :     }
     635               0 :     if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_DisableWakeLockNotifications__ID), (&(mState)))))) {
     636               0 :         NS_WARNING("bad state transition!");
     637                 :     }
     638                 : 
     639               0 :     bool __sendok = (mChannel)->Send(__msg);
     640               0 :     return __sendok;
     641                 : }
     642                 : 
     643                 : bool
     644               0 : PHalChild::SendGetWakeLockInfo(
     645                 :         const nsString& aTopic,
     646                 :         WakeLockInformation* aWakeLockInfo)
     647                 : {
     648               0 :     PHal::Msg_GetWakeLockInfo* __msg = new PHal::Msg_GetWakeLockInfo();
     649                 : 
     650               0 :     Write(aTopic, __msg);
     651                 : 
     652               0 :     (__msg)->set_routing_id(mId);
     653               0 :     (__msg)->set_sync();
     654                 : 
     655                 : 
     656               0 :     Message __reply;
     657                 : 
     658               0 :     if (mozilla::ipc::LoggingEnabled()) {
     659               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
     660                 :     }
     661               0 :     if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_GetWakeLockInfo__ID), (&(mState)))))) {
     662               0 :         NS_WARNING("bad state transition!");
     663                 :     }
     664                 : 
     665               0 :     bool __sendok = (mChannel)->Send(__msg, (&(__reply)));
     666               0 :     if ((!(__sendok))) {
     667               0 :         return false;
     668                 :     }
     669                 : 
     670               0 :     if (mozilla::ipc::LoggingEnabled()) {
     671               0 :         (static_cast<const PHal::Reply_GetWakeLockInfo*>((&(__reply))))->Log("[PHalChild] Received reply ", stderr);
     672                 :     }
     673                 : 
     674               0 :     void* __iter = 0;
     675               0 :     if ((!(Read(aWakeLockInfo, (&(__reply)), (&(__iter)))))) {
     676               0 :         FatalError("error deserializing (better message TODO)");
     677               0 :         return false;
     678                 :     }
     679               0 :     (__reply).EndRead(__iter);
     680                 : 
     681               0 :     return true;
     682                 : }
     683                 : 
     684                 : bool
     685               0 : PHalChild::SendEnableSensorNotifications(const SensorType& aSensor)
     686                 : {
     687               0 :     PHal::Msg_EnableSensorNotifications* __msg = new PHal::Msg_EnableSensorNotifications();
     688                 : 
     689               0 :     Write(aSensor, __msg);
     690                 : 
     691               0 :     (__msg)->set_routing_id(mId);
     692                 : 
     693                 : 
     694                 : 
     695               0 :     if (mozilla::ipc::LoggingEnabled()) {
     696               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
     697                 :     }
     698               0 :     if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_EnableSensorNotifications__ID), (&(mState)))))) {
     699               0 :         NS_WARNING("bad state transition!");
     700                 :     }
     701                 : 
     702               0 :     bool __sendok = (mChannel)->Send(__msg);
     703               0 :     return __sendok;
     704                 : }
     705                 : 
     706                 : bool
     707               0 : PHalChild::SendDisableSensorNotifications(const SensorType& aSensor)
     708                 : {
     709               0 :     PHal::Msg_DisableSensorNotifications* __msg = new PHal::Msg_DisableSensorNotifications();
     710                 : 
     711               0 :     Write(aSensor, __msg);
     712                 : 
     713               0 :     (__msg)->set_routing_id(mId);
     714                 : 
     715                 : 
     716                 : 
     717               0 :     if (mozilla::ipc::LoggingEnabled()) {
     718               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
     719                 :     }
     720               0 :     if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_DisableSensorNotifications__ID), (&(mState)))))) {
     721               0 :         NS_WARNING("bad state transition!");
     722                 :     }
     723                 : 
     724               0 :     bool __sendok = (mChannel)->Send(__msg);
     725               0 :     return __sendok;
     726                 : }
     727                 : 
     728                 : bool
     729               0 : PHalChild::Send__delete__(PHalChild* actor)
     730                 : {
     731               0 :     if ((!(actor))) {
     732               0 :         return false;
     733                 :     }
     734                 : 
     735               0 :     if ((!(actor))) {
     736               0 :         return false;
     737                 :     }
     738                 : 
     739               0 :     PHal::Msg___delete__* __msg = new PHal::Msg___delete__();
     740                 : 
     741               0 :     (actor)->Write(actor, __msg, false);
     742                 : 
     743               0 :     (__msg)->set_routing_id((actor)->mId);
     744                 : 
     745                 : 
     746               0 :     if (mozilla::ipc::LoggingEnabled()) {
     747               0 :         (__msg)->Log("[PHalChild] Sending ", stderr);
     748                 :     }
     749               0 :     if ((!(PHal::Transition((actor)->mState, Trigger(Trigger::Recv, PHal::Msg___delete____ID), (&((actor)->mState)))))) {
     750               0 :         NS_WARNING("bad state transition!");
     751                 :     }
     752                 : 
     753               0 :     bool __sendok = ((actor)->mChannel)->Send(__msg);
     754                 : 
     755               0 :     (actor)->DestroySubtree(Deletion);
     756               0 :     (actor)->DeallocSubtree();
     757               0 :     ((actor)->mManager)->RemoveManagee(PHalMsgStart, actor);
     758               0 :     return __sendok;
     759                 : }
     760                 : 
     761                 : int32
     762               0 : PHalChild::Register(ChannelListener* aRouted)
     763                 : {
     764               0 :     return (mManager)->Register(aRouted);
     765                 : }
     766                 : 
     767                 : int32
     768               0 : PHalChild::RegisterID(
     769                 :         ChannelListener* aRouted,
     770                 :         int32 aId)
     771                 : {
     772               0 :     return (mManager)->RegisterID(aRouted, aId);
     773                 : }
     774                 : 
     775                 : ChannelListener*
     776               0 : PHalChild::Lookup(int32 aId)
     777                 : {
     778               0 :     return (mManager)->Lookup(aId);
     779                 : }
     780                 : 
     781                 : void
     782               0 : PHalChild::Unregister(int32 aId)
     783                 : {
     784               0 :     return (mManager)->Unregister(aId);
     785                 : }
     786                 : 
     787                 : void
     788               0 : PHalChild::RemoveManagee(
     789                 :         int32 aProtocolId,
     790                 :         ChannelListener* aListener)
     791                 : {
     792               0 :     NS_RUNTIMEABORT("unreached");
     793                 :     return;
     794                 : }
     795                 : 
     796                 : Shmem::SharedMemory*
     797               0 : PHalChild::CreateSharedMemory(
     798                 :         size_t aSize,
     799                 :         Shmem::SharedMemory::SharedMemoryType type,
     800                 :         bool unsafe,
     801                 :         Shmem::id_t* aId)
     802                 : {
     803               0 :     return (mManager)->CreateSharedMemory(aSize, type, unsafe, aId);
     804                 : }
     805                 : 
     806                 : bool
     807               0 : PHalChild::AdoptSharedMemory(
     808                 :         Shmem::SharedMemory* segment,
     809                 :         Shmem::id_t* aId)
     810                 : {
     811               0 :     return (mManager)->AdoptSharedMemory(segment, aId);
     812                 : }
     813                 : 
     814                 : Shmem::SharedMemory*
     815               0 : PHalChild::LookupSharedMemory(Shmem::id_t aId)
     816                 : {
     817               0 :     return (mManager)->LookupSharedMemory(aId);
     818                 : }
     819                 : 
     820                 : bool
     821               0 : PHalChild::IsTrackingSharedMemory(Shmem::SharedMemory* segment)
     822                 : {
     823               0 :     return (mManager)->IsTrackingSharedMemory(segment);
     824                 : }
     825                 : 
     826                 : bool
     827               0 : PHalChild::DestroySharedMemory(Shmem& aShmem)
     828                 : {
     829               0 :     return (mManager)->DestroySharedMemory(aShmem);
     830                 : }
     831                 : 
     832                 : ProcessHandle
     833               0 : PHalChild::OtherProcess() const
     834                 : {
     835               0 :     return (mManager)->OtherProcess();
     836                 : }
     837                 : 
     838                 : AsyncChannel*
     839               0 : PHalChild::GetIPCChannel()
     840                 : {
     841               0 :     return mChannel;
     842                 : }
     843                 : 
     844                 : PHalChild::Result
     845               0 : PHalChild::OnMessageReceived(const Message& __msg)
     846                 : {
     847               0 :     switch ((__msg).type()) {
     848                 :     case PHal::Msg_NotifyBatteryChange__ID:
     849                 :         {
     850               0 :             (const_cast<Message&>(__msg)).set_name("PHal::Msg_NotifyBatteryChange");
     851               0 :             if (mozilla::ipc::LoggingEnabled()) {
     852               0 :                 (static_cast<const PHal::Msg_NotifyBatteryChange*>((&(__msg))))->Log("[PHalChild] Received ", stderr);
     853                 :             }
     854                 : 
     855               0 :             void* __iter = 0;
     856               0 :             BatteryInformation aBatteryInfo;
     857                 : 
     858               0 :             if ((!(Read((&(aBatteryInfo)), (&(__msg)), (&(__iter)))))) {
     859               0 :                 FatalError("error deserializing (better message TODO)");
     860               0 :                 return MsgValueError;
     861                 :             }
     862               0 :             (__msg).EndRead(__iter);
     863               0 :             if ((!(PHal::Transition(mState, Trigger(Trigger::Send, PHal::Msg_NotifyBatteryChange__ID), (&(mState)))))) {
     864               0 :                 NS_WARNING("bad state transition!");
     865                 :             }
     866               0 :             if ((!(RecvNotifyBatteryChange(aBatteryInfo)))) {
     867               0 :                 return MsgProcessingError;
     868                 :             }
     869                 : 
     870               0 :             return MsgProcessed;
     871                 :         }
     872                 :     case PHal::Msg_NotifyNetworkChange__ID:
     873                 :         {
     874               0 :             (const_cast<Message&>(__msg)).set_name("PHal::Msg_NotifyNetworkChange");
     875               0 :             if (mozilla::ipc::LoggingEnabled()) {
     876               0 :                 (static_cast<const PHal::Msg_NotifyNetworkChange*>((&(__msg))))->Log("[PHalChild] Received ", stderr);
     877                 :             }
     878                 : 
     879               0 :             void* __iter = 0;
     880               0 :             NetworkInformation aNetworkInfo;
     881                 : 
     882               0 :             if ((!(Read((&(aNetworkInfo)), (&(__msg)), (&(__iter)))))) {
     883               0 :                 FatalError("error deserializing (better message TODO)");
     884               0 :                 return MsgValueError;
     885                 :             }
     886               0 :             (__msg).EndRead(__iter);
     887               0 :             if ((!(PHal::Transition(mState, Trigger(Trigger::Send, PHal::Msg_NotifyNetworkChange__ID), (&(mState)))))) {
     888               0 :                 NS_WARNING("bad state transition!");
     889                 :             }
     890               0 :             if ((!(RecvNotifyNetworkChange(aNetworkInfo)))) {
     891               0 :                 return MsgProcessingError;
     892                 :             }
     893                 : 
     894               0 :             return MsgProcessed;
     895                 :         }
     896                 :     case PHal::Msg_NotifyWakeLockChange__ID:
     897                 :         {
     898               0 :             (const_cast<Message&>(__msg)).set_name("PHal::Msg_NotifyWakeLockChange");
     899               0 :             if (mozilla::ipc::LoggingEnabled()) {
     900               0 :                 (static_cast<const PHal::Msg_NotifyWakeLockChange*>((&(__msg))))->Log("[PHalChild] Received ", stderr);
     901                 :             }
     902                 : 
     903               0 :             void* __iter = 0;
     904               0 :             WakeLockInformation aWakeLockInfo;
     905                 : 
     906               0 :             if ((!(Read((&(aWakeLockInfo)), (&(__msg)), (&(__iter)))))) {
     907               0 :                 FatalError("error deserializing (better message TODO)");
     908               0 :                 return MsgValueError;
     909                 :             }
     910               0 :             (__msg).EndRead(__iter);
     911               0 :             if ((!(PHal::Transition(mState, Trigger(Trigger::Send, PHal::Msg_NotifyWakeLockChange__ID), (&(mState)))))) {
     912               0 :                 NS_WARNING("bad state transition!");
     913                 :             }
     914               0 :             if ((!(RecvNotifyWakeLockChange(aWakeLockInfo)))) {
     915               0 :                 return MsgProcessingError;
     916                 :             }
     917                 : 
     918               0 :             return MsgProcessed;
     919                 :         }
     920                 :     case PHal::Msg_NotifySensorChange__ID:
     921                 :         {
     922               0 :             (const_cast<Message&>(__msg)).set_name("PHal::Msg_NotifySensorChange");
     923               0 :             if (mozilla::ipc::LoggingEnabled()) {
     924               0 :                 (static_cast<const PHal::Msg_NotifySensorChange*>((&(__msg))))->Log("[PHalChild] Received ", stderr);
     925                 :             }
     926                 : 
     927               0 :             void* __iter = 0;
     928               0 :             SensorData aSensorData;
     929                 : 
     930               0 :             if ((!(Read((&(aSensorData)), (&(__msg)), (&(__iter)))))) {
     931               0 :                 FatalError("error deserializing (better message TODO)");
     932               0 :                 return MsgValueError;
     933                 :             }
     934               0 :             (__msg).EndRead(__iter);
     935               0 :             if ((!(PHal::Transition(mState, Trigger(Trigger::Send, PHal::Msg_NotifySensorChange__ID), (&(mState)))))) {
     936               0 :                 NS_WARNING("bad state transition!");
     937                 :             }
     938               0 :             if ((!(RecvNotifySensorChange(aSensorData)))) {
     939               0 :                 return MsgProcessingError;
     940                 :             }
     941                 : 
     942               0 :             return MsgProcessed;
     943                 :         }
     944                 :     case PHal::Reply___delete____ID:
     945                 :         {
     946               0 :             return MsgProcessed;
     947                 :         }
     948                 :     default:
     949                 :         {
     950               0 :             return MsgNotKnown;
     951                 :         }
     952                 :     }
     953                 : }
     954                 : 
     955                 : PHalChild::Result
     956               0 : PHalChild::OnMessageReceived(
     957                 :         const Message& __msg,
     958                 :         Message*& __reply)
     959                 : {
     960               0 :     return MsgNotKnown;
     961                 : }
     962                 : 
     963                 : PHalChild::Result
     964               0 : PHalChild::OnCallReceived(
     965                 :         const Message& __msg,
     966                 :         Message*& __reply)
     967                 : {
     968               0 :     return MsgNotKnown;
     969                 : }
     970                 : 
     971                 : void
     972               0 : PHalChild::OnProcessingError(Result code)
     973                 : {
     974               0 :     NS_RUNTIMEABORT("`OnProcessingError' called on non-toplevel actor");
     975               0 : }
     976                 : 
     977                 : bool
     978               0 : PHalChild::OnReplyTimeout()
     979                 : {
     980               0 :     NS_RUNTIMEABORT("`OnReplyTimeout' called on non-toplevel actor");
     981               0 :     return false;
     982                 : }
     983                 : 
     984                 : void
     985               0 : PHalChild::OnChannelClose()
     986                 : {
     987               0 :     NS_RUNTIMEABORT("`OnClose' called on non-toplevel actor");
     988               0 : }
     989                 : 
     990                 : void
     991               0 : PHalChild::OnChannelError()
     992                 : {
     993               0 :     NS_RUNTIMEABORT("`OnError' called on non-toplevel actor");
     994               0 : }
     995                 : 
     996                 : void
     997               0 : PHalChild::OnChannelConnected(int32 pid)
     998                 : {
     999               0 :     NS_RUNTIMEABORT("'OnConnected' called on non-toplevel actor");
    1000               0 : }
    1001                 : 
    1002                 : bool
    1003               0 : PHalChild::AllocShmem(
    1004                 :         size_t aSize,
    1005                 :         Shmem::SharedMemory::SharedMemoryType aType,
    1006                 :         Shmem* aMem)
    1007                 : {
    1008                 :     Shmem::id_t aId;
    1009               0 :     nsAutoPtr<Shmem::SharedMemory> rawmem(CreateSharedMemory(aSize, aType, false, (&(aId))));
    1010               0 :     if ((!(rawmem))) {
    1011               0 :         return false;
    1012                 :     }
    1013                 : 
    1014               0 :     (*(aMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), (rawmem).forget(), aId);
    1015               0 :     return true;
    1016                 : }
    1017                 : 
    1018                 : bool
    1019               0 : PHalChild::AllocUnsafeShmem(
    1020                 :         size_t aSize,
    1021                 :         Shmem::SharedMemory::SharedMemoryType aType,
    1022                 :         Shmem* aMem)
    1023                 : {
    1024                 :     Shmem::id_t aId;
    1025               0 :     nsAutoPtr<Shmem::SharedMemory> rawmem(CreateSharedMemory(aSize, aType, true, (&(aId))));
    1026               0 :     if ((!(rawmem))) {
    1027               0 :         return false;
    1028                 :     }
    1029                 : 
    1030               0 :     (*(aMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), (rawmem).forget(), aId);
    1031               0 :     return true;
    1032                 : }
    1033                 : 
    1034                 : bool
    1035               0 : PHalChild::AdoptShmem(
    1036                 :         Shmem& aMem,
    1037                 :         Shmem* aOutMem)
    1038                 : {
    1039               0 :     Shmem::SharedMemory* rawmem = (aMem).Segment(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
    1040               0 :     if (((!(rawmem))) || (IsTrackingSharedMemory(rawmem))) {
    1041               0 :         NS_RUNTIMEABORT("bad Shmem");
    1042                 :     }
    1043                 : 
    1044                 :     Shmem::id_t aId;
    1045               0 :     if ((!(AdoptSharedMemory(rawmem, (&(aId)))))) {
    1046               0 :         return false;
    1047                 :     }
    1048                 : 
    1049               0 :     (*(aOutMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), rawmem, aId);
    1050               0 :     return true;
    1051                 : }
    1052                 : 
    1053                 : bool
    1054               0 : PHalChild::DeallocShmem(Shmem& aMem)
    1055                 : {
    1056               0 :     bool ok = DestroySharedMemory(aMem);
    1057               0 :     (aMem).forget(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
    1058               0 :     return ok;
    1059                 : }
    1060                 : 
    1061                 : void
    1062               0 : PHalChild::FatalError(const char* const msg) const
    1063                 : {
    1064                 :     // Virtual method to prevent inlining.
    1065                 :     // This give us better error reporting.
    1066                 :     // See bug 589371
    1067                 : 
    1068               0 :     NS_ERROR("IPDL error:");
    1069               0 :     NS_ERROR(msg);
    1070                 : 
    1071               0 :     NS_RUNTIMEABORT("[PHalChild] abort()ing as a result");
    1072               0 : }
    1073                 : 
    1074                 : void
    1075               0 : PHalChild::DestroySubtree(ActorDestroyReason why)
    1076                 : {
    1077                 :     // Unregister from our manager.
    1078               0 :     Unregister(mId);
    1079               0 :     mId = 1;
    1080                 : 
    1081                 :     // Finally, destroy "us".
    1082               0 :     ActorDestroy(why);
    1083               0 : }
    1084                 : 
    1085                 : void
    1086               0 : PHalChild::DeallocSubtree()
    1087                 : {
    1088               0 : }
    1089                 : 
    1090                 : void
    1091               0 : PHalChild::Write(
    1092                 :         const LightConfiguration& __v,
    1093                 :         Message* __msg)
    1094                 : {
    1095               0 :     Write((__v).light(), __msg);
    1096               0 :     Write((__v).mode(), __msg);
    1097               0 :     Write((__v).flash(), __msg);
    1098               0 :     Write((__v).flashOnMS(), __msg);
    1099               0 :     Write((__v).flashOffMS(), __msg);
    1100               0 :     Write((__v).color(), __msg);
    1101               0 : }
    1102                 : 
    1103                 : bool
    1104               0 : PHalChild::Read(
    1105                 :         LightConfiguration* __v,
    1106                 :         const Message* __msg,
    1107                 :         void** __iter)
    1108                 : {
    1109               0 :     if ((!(Read((&((__v)->light())), __msg, __iter)))) {
    1110               0 :         return false;
    1111                 :     }
    1112               0 :     if ((!(Read((&((__v)->mode())), __msg, __iter)))) {
    1113               0 :         return false;
    1114                 :     }
    1115               0 :     if ((!(Read((&((__v)->flash())), __msg, __iter)))) {
    1116               0 :         return false;
    1117                 :     }
    1118               0 :     if ((!(Read((&((__v)->flashOnMS())), __msg, __iter)))) {
    1119               0 :         return false;
    1120                 :     }
    1121               0 :     if ((!(Read((&((__v)->flashOffMS())), __msg, __iter)))) {
    1122               0 :         return false;
    1123                 :     }
    1124               0 :     if ((!(Read((&((__v)->color())), __msg, __iter)))) {
    1125               0 :         return false;
    1126                 :     }
    1127               0 :     return true;
    1128                 : }
    1129                 : 
    1130                 : void
    1131               0 : PHalChild::Write(
    1132                 :         PBrowserChild* __v,
    1133                 :         Message* __msg,
    1134                 :         bool __nullable)
    1135                 : {
    1136                 :     int32 id;
    1137               0 :     if ((!(__v))) {
    1138               0 :         if ((!(__nullable))) {
    1139               0 :             NS_RUNTIMEABORT("NULL actor value passed to non-nullable param");
    1140                 :         }
    1141               0 :         id = 0;
    1142                 :     }
    1143                 :     else {
    1144               0 :         id = (__v)->mId;
    1145               0 :         if ((1) == (id)) {
    1146               0 :             NS_RUNTIMEABORT("actor has been |delete|d");
    1147                 :         }
    1148                 :     }
    1149                 : 
    1150               0 :     Write(id, __msg);
    1151               0 : }
    1152                 : 
    1153                 : bool
    1154               0 : PHalChild::Read(
    1155                 :         PBrowserChild** __v,
    1156                 :         const Message* __msg,
    1157                 :         void** __iter,
    1158                 :         bool __nullable)
    1159                 : {
    1160                 :     int32 id;
    1161               0 :     if ((!(Read((&(id)), __msg, __iter)))) {
    1162               0 :         return false;
    1163                 :     }
    1164               0 :     if (((1) == (id)) || (((0) == (id)) && ((!(__nullable))))) {
    1165               0 :         return false;
    1166                 :     }
    1167                 : 
    1168               0 :     if ((0) == (id)) {
    1169               0 :         (*(__v)) = 0;
    1170                 :     }
    1171                 :     else {
    1172               0 :         (*(__v)) = static_cast<PBrowserChild*>(Lookup(id));
    1173               0 :         if ((!((*(__v))))) {
    1174               0 :             return false;
    1175                 :         }
    1176                 :     }
    1177               0 :     return true;
    1178                 : }
    1179                 : 
    1180                 : void
    1181               0 : PHalChild::Write(
    1182                 :         const BatteryInformation& __v,
    1183                 :         Message* __msg)
    1184                 : {
    1185               0 :     Write((__v).level(), __msg);
    1186               0 :     Write((__v).charging(), __msg);
    1187               0 :     Write((__v).remainingTime(), __msg);
    1188               0 : }
    1189                 : 
    1190                 : bool
    1191               0 : PHalChild::Read(
    1192                 :         BatteryInformation* __v,
    1193                 :         const Message* __msg,
    1194                 :         void** __iter)
    1195                 : {
    1196               0 :     if ((!(Read((&((__v)->level())), __msg, __iter)))) {
    1197               0 :         return false;
    1198                 :     }
    1199               0 :     if ((!(Read((&((__v)->charging())), __msg, __iter)))) {
    1200               0 :         return false;
    1201                 :     }
    1202               0 :     if ((!(Read((&((__v)->remainingTime())), __msg, __iter)))) {
    1203               0 :         return false;
    1204                 :     }
    1205               0 :     return true;
    1206                 : }
    1207                 : 
    1208                 : void
    1209               0 : PHalChild::Write(
    1210                 :         const WakeLockInformation& __v,
    1211                 :         Message* __msg)
    1212                 : {
    1213               0 :     Write((__v).numLocks(), __msg);
    1214               0 :     Write((__v).numHidden(), __msg);
    1215               0 :     Write((__v).topic(), __msg);
    1216               0 : }
    1217                 : 
    1218                 : bool
    1219               0 : PHalChild::Read(
    1220                 :         WakeLockInformation* __v,
    1221                 :         const Message* __msg,
    1222                 :         void** __iter)
    1223                 : {
    1224               0 :     if ((!(Read((&((__v)->numLocks())), __msg, __iter)))) {
    1225               0 :         return false;
    1226                 :     }
    1227               0 :     if ((!(Read((&((__v)->numHidden())), __msg, __iter)))) {
    1228               0 :         return false;
    1229                 :     }
    1230               0 :     if ((!(Read((&((__v)->topic())), __msg, __iter)))) {
    1231               0 :         return false;
    1232                 :     }
    1233               0 :     return true;
    1234                 : }
    1235                 : 
    1236                 : void
    1237               0 : PHalChild::Write(
    1238                 :         const NetworkInformation& __v,
    1239                 :         Message* __msg)
    1240                 : {
    1241               0 :     Write((__v).bandwidth(), __msg);
    1242               0 :     Write((__v).canBeMetered(), __msg);
    1243               0 : }
    1244                 : 
    1245                 : bool
    1246               0 : PHalChild::Read(
    1247                 :         NetworkInformation* __v,
    1248                 :         const Message* __msg,
    1249                 :         void** __iter)
    1250                 : {
    1251               0 :     if ((!(Read((&((__v)->bandwidth())), __msg, __iter)))) {
    1252               0 :         return false;
    1253                 :     }
    1254               0 :     if ((!(Read((&((__v)->canBeMetered())), __msg, __iter)))) {
    1255               0 :         return false;
    1256                 :     }
    1257               0 :     return true;
    1258                 : }
    1259                 : 
    1260                 : void
    1261               0 : PHalChild::Write(
    1262                 :         const SensorData& __v,
    1263                 :         Message* __msg)
    1264                 : {
    1265               0 :     Write((__v).sensor(), __msg);
    1266               0 :     Write((__v).timestamp(), __msg);
    1267               0 :     Write((__v).values(), __msg);
    1268               0 : }
    1269                 : 
    1270                 : bool
    1271               0 : PHalChild::Read(
    1272                 :         SensorData* __v,
    1273                 :         const Message* __msg,
    1274                 :         void** __iter)
    1275                 : {
    1276               0 :     if ((!(Read((&((__v)->sensor())), __msg, __iter)))) {
    1277               0 :         return false;
    1278                 :     }
    1279               0 :     if ((!(Read((&((__v)->timestamp())), __msg, __iter)))) {
    1280               0 :         return false;
    1281                 :     }
    1282               0 :     if ((!(Read((&((__v)->values())), __msg, __iter)))) {
    1283               0 :         return false;
    1284                 :     }
    1285               0 :     return true;
    1286                 : }
    1287                 : 
    1288                 : void
    1289               0 : PHalChild::Write(
    1290                 :         PHalChild* __v,
    1291                 :         Message* __msg,
    1292                 :         bool __nullable)
    1293                 : {
    1294                 :     int32 id;
    1295               0 :     if ((!(__v))) {
    1296               0 :         if ((!(__nullable))) {
    1297               0 :             NS_RUNTIMEABORT("NULL actor value passed to non-nullable param");
    1298                 :         }
    1299               0 :         id = 0;
    1300                 :     }
    1301                 :     else {
    1302               0 :         id = (__v)->mId;
    1303               0 :         if ((1) == (id)) {
    1304               0 :             NS_RUNTIMEABORT("actor has been |delete|d");
    1305                 :         }
    1306                 :     }
    1307                 : 
    1308               0 :     Write(id, __msg);
    1309               0 : }
    1310                 : 
    1311                 : bool
    1312               0 : PHalChild::Read(
    1313                 :         PHalChild** __v,
    1314                 :         const Message* __msg,
    1315                 :         void** __iter,
    1316                 :         bool __nullable)
    1317                 : {
    1318                 :     int32 id;
    1319               0 :     if ((!(Read((&(id)), __msg, __iter)))) {
    1320               0 :         return false;
    1321                 :     }
    1322               0 :     if (((1) == (id)) || (((0) == (id)) && ((!(__nullable))))) {
    1323               0 :         return false;
    1324                 :     }
    1325                 : 
    1326               0 :     if ((0) == (id)) {
    1327               0 :         (*(__v)) = 0;
    1328                 :     }
    1329                 :     else {
    1330               0 :         (*(__v)) = static_cast<PHalChild*>(Lookup(id));
    1331               0 :         if ((!((*(__v))))) {
    1332               0 :             return false;
    1333                 :         }
    1334                 :     }
    1335               0 :     return true;
    1336                 : }
    1337                 : 
    1338                 : 
    1339                 : 
    1340                 : } // namespace hal_sandbox
    1341                 : } // namespace mozilla

Generated by: LCOV version 1.7