LCOV - code coverage report
Current view: directory - objdir/ipc/ipdl/_ipdlheaders/mozilla/hal_sandbox - PHalParent.h (source / functions) Found Hit Coverage
Test: app.info Lines: 5 0 0.0 %
Date: 2012-06-02 Functions: 26 0 0.0 %

       1                 : //
       2                 : // Automatically generated by ipdlc.
       3                 : // Edit at your own risk
       4                 : //
       5                 : 
       6                 : #ifndef PHalParent_h
       7                 : #define PHalParent_h
       8                 : 
       9                 : #include "mozilla/hal_sandbox/PHal.h"
      10                 : namespace mozilla {
      11                 : namespace dom {
      12                 : class PContentParent;
      13                 : } // namespace dom
      14                 : } // namespace mozilla
      15                 : 
      16                 : namespace mozilla {
      17                 : namespace dom {
      18                 : class PBrowserParent;
      19                 : } // namespace dom
      20                 : } // namespace mozilla
      21                 : 
      22                 : #ifdef DEBUG
      23                 : #include "prenv.h"
      24                 : #endif // DEBUG
      25                 : #include "base/id_map.h"
      26                 : #include "mozilla/ipc/RPCChannel.h"
      27                 : 
      28                 : 
      29                 : namespace mozilla {
      30                 : namespace dom {
      31                 : class PContentParent;
      32                 : } // namespace dom
      33                 : } // namespace mozilla
      34                 : 
      35                 : namespace mozilla {
      36                 : namespace hal_sandbox {
      37                 : 
      38                 : 
      39                 : class /*NS_ABSTRACT_CLASS*/ PHalParent :
      40                 :     protected mozilla::ipc::RPCChannel::RPCListener,
      41                 :     protected mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>
      42                 : {
      43                 :     friend class mozilla::dom::PContentParent;
      44                 : 
      45                 : protected:
      46                 :     typedef mozilla::ipc::ActorHandle ActorHandle;
      47                 :     typedef mozilla::hal::BatteryInformation BatteryInformation;
      48                 :     typedef mozilla::hal::LightConfiguration LightConfiguration;
      49                 :     typedef mozilla::hal::SensorData SensorData;
      50                 :     typedef mozilla::hal::NetworkInformation NetworkInformation;
      51                 :     typedef mozilla::hal::WakeLockInformation WakeLockInformation;
      52                 :     typedef mozilla::ipc::Shmem Shmem;
      53                 :     typedef mozilla::hal::FlashMode FlashMode;
      54                 :     typedef mozilla::hal::LightType LightType;
      55                 :     typedef mozilla::hal::LightMode LightMode;
      56                 :     typedef mozilla::hal::SensorType SensorType;
      57                 :     typedef mozilla::hal::WakeLockControl WakeLockControl;
      58                 :     typedef mozilla::dom::PContentParent PContentParent;
      59                 :     typedef mozilla::dom::PBrowserParent PBrowserParent;
      60                 :     typedef base::ProcessId ProcessId;
      61                 :     typedef mozilla::ipc::ProtocolId ProtocolId;
      62                 :     typedef mozilla::ipc::Transport Transport;
      63                 :     typedef mozilla::ipc::TransportDescriptor TransportDescriptor;
      64                 : 
      65                 :     typedef PHal::State State;
      66                 : 
      67                 :     virtual bool
      68                 :     RecvVibrate(
      69                 :             const InfallibleTArray<uint32>& pattern,
      70                 :             const InfallibleTArray<uint64>& id,
      71                 :             PBrowserParent* browser) = 0;
      72                 :     virtual bool
      73                 :     RecvCancelVibrate(
      74                 :             const InfallibleTArray<uint64>& id,
      75                 :             PBrowserParent* browser) = 0;
      76                 :     virtual bool
      77                 :     RecvEnableBatteryNotifications() = 0;
      78                 :     virtual bool
      79                 :     RecvDisableBatteryNotifications() = 0;
      80                 :     virtual bool
      81                 :     RecvGetCurrentBatteryInformation(BatteryInformation* aBatteryInfo) = 0;
      82                 :     virtual bool
      83                 :     RecvEnableNetworkNotifications() = 0;
      84                 :     virtual bool
      85                 :     RecvDisableNetworkNotifications() = 0;
      86                 :     virtual bool
      87                 :     RecvGetCurrentNetworkInformation(NetworkInformation* aNetworkInfo) = 0;
      88                 :     virtual bool
      89                 :     RecvGetScreenEnabled(bool* enabled) = 0;
      90                 :     virtual bool
      91                 :     RecvSetScreenEnabled(const bool& enabled) = 0;
      92                 :     virtual bool
      93                 :     RecvGetScreenBrightness(double* brightness) = 0;
      94                 :     virtual bool
      95                 :     RecvSetScreenBrightness(const double& brightness) = 0;
      96                 :     virtual bool
      97                 :     RecvAdjustSystemClock(const int32& aDeltaMilliseconds) = 0;
      98                 :     virtual bool
      99                 :     RecvSetTimezone(const nsCString& aTimezoneSpec) = 0;
     100                 :     virtual bool
     101                 :     RecvSetLight(
     102                 :             const LightType& light,
     103                 :             const LightConfiguration& aConfig,
     104                 :             bool* status) = 0;
     105                 :     virtual bool
     106                 :     RecvGetLight(
     107                 :             const LightType& light,
     108                 :             LightConfiguration* aConfig,
     109                 :             bool* status) = 0;
     110                 :     virtual bool
     111                 :     RecvReboot() = 0;
     112                 :     virtual bool
     113                 :     RecvPowerOff() = 0;
     114                 :     virtual bool
     115                 :     RecvModifyWakeLock(
     116                 :             const nsString& aTopic,
     117                 :             const WakeLockControl& aLockAdjust,
     118                 :             const WakeLockControl& aHiddenAdjust) = 0;
     119                 :     virtual bool
     120                 :     RecvEnableWakeLockNotifications() = 0;
     121                 :     virtual bool
     122                 :     RecvDisableWakeLockNotifications() = 0;
     123                 :     virtual bool
     124                 :     RecvGetWakeLockInfo(
     125                 :             const nsString& aTopic,
     126                 :             WakeLockInformation* aWakeLockInfo) = 0;
     127                 :     virtual bool
     128                 :     RecvEnableSensorNotifications(const SensorType& aSensor) = 0;
     129                 :     virtual bool
     130                 :     RecvDisableSensorNotifications(const SensorType& aSensor) = 0;
     131                 :     virtual bool
     132                 :     Recv__delete__();
     133                 : 
     134                 :     virtual void
     135                 :     ActorDestroy(ActorDestroyReason why);
     136                 : 
     137                 : public:
     138                 :     typedef IPC::Message Message;
     139                 :     typedef mozilla::ipc::RPCChannel Channel;
     140                 :     typedef mozilla::ipc::RPCChannel::RPCListener ChannelListener;
     141                 :     typedef base::ProcessHandle ProcessHandle;
     142                 :     typedef mozilla::ipc::AsyncChannel AsyncChannel;
     143                 :     typedef mozilla::ipc::SharedMemory SharedMemory;
     144                 :     typedef mozilla::ipc::Trigger Trigger;
     145                 : 
     146                 : public:
     147                 :     PHalParent();
     148                 : 
     149                 :     virtual ~PHalParent();
     150                 : 
     151                 :     PContentParent*
     152                 :     Manager();
     153                 : 
     154                 :     PHal::State
     155                 :     state();
     156                 : 
     157                 :     bool
     158                 :     SendNotifyBatteryChange(const BatteryInformation& aBatteryInfo) NS_WARN_UNUSED_RESULT;
     159                 : 
     160                 :     bool
     161                 :     SendNotifyNetworkChange(const NetworkInformation& aNetworkInfo) NS_WARN_UNUSED_RESULT;
     162                 : 
     163                 :     bool
     164                 :     SendNotifyWakeLockChange(const WakeLockInformation& aWakeLockInfo) NS_WARN_UNUSED_RESULT;
     165                 : 
     166                 :     bool
     167                 :     SendNotifySensorChange(const SensorData& aSensorData) NS_WARN_UNUSED_RESULT;
     168                 : 
     169                 :     virtual int32
     170                 :     Register(ChannelListener* aRouted);
     171                 :     virtual int32
     172                 :     RegisterID(
     173                 :             ChannelListener* aRouted,
     174                 :             int32 aId);
     175                 :     virtual ChannelListener*
     176                 :     Lookup(int32 aId);
     177                 :     virtual void
     178                 :     Unregister(int32 aId);
     179                 :     virtual void
     180                 :     RemoveManagee(
     181                 :             int32 aProtocolId,
     182                 :             ChannelListener* aListener);
     183                 :     virtual Shmem::SharedMemory*
     184                 :     CreateSharedMemory(
     185                 :             size_t aSize,
     186                 :             Shmem::SharedMemory::SharedMemoryType type,
     187                 :             bool unsafe,
     188                 :             Shmem::id_t* aId);
     189                 :     virtual bool
     190                 :     AdoptSharedMemory(
     191                 :             Shmem::SharedMemory* segment,
     192                 :             Shmem::id_t* aId);
     193                 :     virtual Shmem::SharedMemory*
     194                 :     LookupSharedMemory(Shmem::id_t aId);
     195                 :     virtual bool
     196                 :     IsTrackingSharedMemory(Shmem::SharedMemory* segment);
     197                 :     virtual bool
     198                 :     DestroySharedMemory(Shmem& aShmem);
     199                 :     virtual ProcessHandle
     200                 :     OtherProcess() const;
     201                 :     virtual AsyncChannel*
     202                 :     GetIPCChannel();
     203                 : 
     204                 :     virtual Result
     205                 :     OnMessageReceived(const Message& __msg);
     206                 : 
     207                 :     virtual Result
     208                 :     OnMessageReceived(
     209                 :             const Message& __msg,
     210                 :             Message*& __reply);
     211                 : 
     212                 :     virtual Result
     213                 :     OnCallReceived(
     214                 :             const Message& __msg,
     215                 :             Message*& __reply);
     216                 : 
     217                 :     void
     218                 :     OnProcessingError(Result code);
     219                 : 
     220                 :     bool
     221                 :     OnReplyTimeout();
     222                 : 
     223                 :     void
     224                 :     OnChannelClose();
     225                 : 
     226                 :     void
     227                 :     OnChannelError();
     228                 : 
     229                 :     void
     230                 :     OnChannelConnected(int32 pid);
     231                 : 
     232                 :     // Methods for managing shmem
     233                 :     bool
     234                 :     AllocShmem(
     235                 :             size_t aSize,
     236                 :             Shmem::SharedMemory::SharedMemoryType aType,
     237                 :             Shmem* aMem);
     238                 : 
     239                 :     bool
     240                 :     AllocUnsafeShmem(
     241                 :             size_t aSize,
     242                 :             Shmem::SharedMemory::SharedMemoryType aType,
     243                 :             Shmem* aMem);
     244                 : 
     245                 :     bool
     246                 :     AdoptShmem(
     247                 :             Shmem& aMem,
     248                 :             Shmem* aOutMem);
     249                 : 
     250                 :     bool
     251                 :     DeallocShmem(Shmem& aMem);
     252                 : 
     253                 : private:
     254                 :     virtual void
     255                 :     FatalError(const char* const msg) const;
     256                 : 
     257                 :     void
     258                 :     DestroySubtree(ActorDestroyReason why);
     259                 : 
     260                 :     void
     261                 :     DeallocSubtree();
     262                 : 
     263                 :     template<typename T>
     264                 :     void
     265               0 :     Write(
     266                 :             const T& __v,
     267                 :             Message* __msg)
     268                 :     {
     269               0 :         IPC::WriteParam(__msg, __v);
     270               0 :     }
     271                 : 
     272                 :     template<typename T>
     273                 :     bool
     274               0 :     Read(
     275                 :             T* __v,
     276                 :             const Message* __msg,
     277                 :             void** __iter)
     278                 :     {
     279               0 :         return IPC::ReadParam(__msg, __iter, __v);
     280                 :     }
     281                 : 
     282                 :     void
     283                 :     Write(
     284                 :             const LightConfiguration& __v,
     285                 :             Message* __msg);
     286                 : 
     287                 :     bool
     288                 :     Read(
     289                 :             LightConfiguration* __v,
     290                 :             const Message* __msg,
     291                 :             void** __iter) NS_WARN_UNUSED_RESULT;
     292                 : 
     293                 :     void
     294                 :     Write(
     295                 :             PBrowserParent* __v,
     296                 :             Message* __msg,
     297                 :             bool __nullable);
     298                 : 
     299                 :     bool
     300                 :     Read(
     301                 :             PBrowserParent** __v,
     302                 :             const Message* __msg,
     303                 :             void** __iter,
     304                 :             bool __nullable) NS_WARN_UNUSED_RESULT;
     305                 : 
     306                 :     void
     307                 :     Write(
     308                 :             const BatteryInformation& __v,
     309                 :             Message* __msg);
     310                 : 
     311                 :     bool
     312                 :     Read(
     313                 :             BatteryInformation* __v,
     314                 :             const Message* __msg,
     315                 :             void** __iter) NS_WARN_UNUSED_RESULT;
     316                 : 
     317                 :     void
     318                 :     Write(
     319                 :             const WakeLockInformation& __v,
     320                 :             Message* __msg);
     321                 : 
     322                 :     bool
     323                 :     Read(
     324                 :             WakeLockInformation* __v,
     325                 :             const Message* __msg,
     326                 :             void** __iter) NS_WARN_UNUSED_RESULT;
     327                 : 
     328                 :     void
     329                 :     Write(
     330                 :             const NetworkInformation& __v,
     331                 :             Message* __msg);
     332                 : 
     333                 :     bool
     334                 :     Read(
     335                 :             NetworkInformation* __v,
     336                 :             const Message* __msg,
     337                 :             void** __iter) NS_WARN_UNUSED_RESULT;
     338                 : 
     339                 :     void
     340                 :     Write(
     341                 :             const SensorData& __v,
     342                 :             Message* __msg);
     343                 : 
     344                 :     bool
     345                 :     Read(
     346                 :             SensorData* __v,
     347                 :             const Message* __msg,
     348                 :             void** __iter) NS_WARN_UNUSED_RESULT;
     349                 : 
     350                 :     void
     351                 :     Write(
     352                 :             PHalParent* __v,
     353                 :             Message* __msg,
     354                 :             bool __nullable);
     355                 : 
     356                 :     bool
     357                 :     Read(
     358                 :             PHalParent** __v,
     359                 :             const Message* __msg,
     360                 :             void** __iter,
     361                 :             bool __nullable) NS_WARN_UNUSED_RESULT;
     362                 : 
     363                 :     Channel* mChannel;
     364                 :     int32 mId;
     365                 :     mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>* mManager;
     366                 :     State mState;
     367                 : };
     368                 : 
     369                 : 
     370                 : } // namespace hal_sandbox
     371                 : } // namespace mozilla
     372                 : 
     373                 : #if 0
     374                 : 
     375                 : //-----------------------------------------------------------------------------
     376                 : // Skeleton implementation of abstract actor class
     377                 : 
     378                 : // Header file contents
     379                 : namespace mozilla {
     380                 : namespace hal_sandbox {
     381                 : class HalParent :
     382                 :     public PHalParent
     383                 : {
     384                 :     virtual bool
     385                 :     RecvVibrate(
     386                 :             const InfallibleTArray<uint32>& pattern,
     387                 :             const InfallibleTArray<uint64>& id,
     388                 :             PBrowserParent* browser);
     389                 : 
     390                 :     virtual bool
     391                 :     RecvCancelVibrate(
     392                 :             const InfallibleTArray<uint64>& id,
     393                 :             PBrowserParent* browser);
     394                 : 
     395                 :     virtual bool
     396                 :     RecvEnableBatteryNotifications();
     397                 : 
     398                 :     virtual bool
     399                 :     RecvDisableBatteryNotifications();
     400                 : 
     401                 :     virtual bool
     402                 :     RecvGetCurrentBatteryInformation(BatteryInformation* aBatteryInfo);
     403                 : 
     404                 :     virtual bool
     405                 :     RecvEnableNetworkNotifications();
     406                 : 
     407                 :     virtual bool
     408                 :     RecvDisableNetworkNotifications();
     409                 : 
     410                 :     virtual bool
     411                 :     RecvGetCurrentNetworkInformation(NetworkInformation* aNetworkInfo);
     412                 : 
     413                 :     virtual bool
     414                 :     RecvGetScreenEnabled(bool* enabled);
     415                 : 
     416                 :     virtual bool
     417                 :     RecvSetScreenEnabled(const bool& enabled);
     418                 : 
     419                 :     virtual bool
     420                 :     RecvGetScreenBrightness(double* brightness);
     421                 : 
     422                 :     virtual bool
     423                 :     RecvSetScreenBrightness(const double& brightness);
     424                 : 
     425                 :     virtual bool
     426                 :     RecvAdjustSystemClock(const int32& aDeltaMilliseconds);
     427                 : 
     428                 :     virtual bool
     429                 :     RecvSetTimezone(const nsCString& aTimezoneSpec);
     430                 : 
     431                 :     virtual bool
     432                 :     RecvSetLight(
     433                 :             const LightType& light,
     434                 :             const LightConfiguration& aConfig,
     435                 :             bool* status);
     436                 : 
     437                 :     virtual bool
     438                 :     RecvGetLight(
     439                 :             const LightType& light,
     440                 :             LightConfiguration* aConfig,
     441                 :             bool* status);
     442                 : 
     443                 :     virtual bool
     444                 :     RecvReboot();
     445                 : 
     446                 :     virtual bool
     447                 :     RecvPowerOff();
     448                 : 
     449                 :     virtual bool
     450                 :     RecvModifyWakeLock(
     451                 :             const nsString& aTopic,
     452                 :             const WakeLockControl& aLockAdjust,
     453                 :             const WakeLockControl& aHiddenAdjust);
     454                 : 
     455                 :     virtual bool
     456                 :     RecvEnableWakeLockNotifications();
     457                 : 
     458                 :     virtual bool
     459                 :     RecvDisableWakeLockNotifications();
     460                 : 
     461                 :     virtual bool
     462                 :     RecvGetWakeLockInfo(
     463                 :             const nsString& aTopic,
     464                 :             WakeLockInformation* aWakeLockInfo);
     465                 : 
     466                 :     virtual bool
     467                 :     RecvEnableSensorNotifications(const SensorType& aSensor);
     468                 : 
     469                 :     virtual bool
     470                 :     RecvDisableSensorNotifications(const SensorType& aSensor);
     471                 : 
     472                 :     HalParent();
     473                 :     virtual ~HalParent();
     474                 : };
     475                 : } // namespace hal_sandbox
     476                 : } // namespace mozilla
     477                 : 
     478                 : 
     479                 : // C++ file contents
     480                 : namespace mozilla {
     481                 : namespace hal_sandbox {
     482                 : bool
     483                 : HalParent::RecvVibrate(
     484                 :         const InfallibleTArray<uint32>& pattern,
     485                 :         const InfallibleTArray<uint64>& id,
     486                 :         PBrowserParent* browser)
     487                 : {
     488                 :     return false;
     489                 : }
     490                 : 
     491                 : bool
     492                 : HalParent::RecvCancelVibrate(
     493                 :         const InfallibleTArray<uint64>& id,
     494                 :         PBrowserParent* browser)
     495                 : {
     496                 :     return false;
     497                 : }
     498                 : 
     499                 : bool
     500                 : HalParent::RecvEnableBatteryNotifications()
     501                 : {
     502                 :     return false;
     503                 : }
     504                 : 
     505                 : bool
     506                 : HalParent::RecvDisableBatteryNotifications()
     507                 : {
     508                 :     return false;
     509                 : }
     510                 : 
     511                 : bool
     512                 : HalParent::RecvGetCurrentBatteryInformation(BatteryInformation* aBatteryInfo)
     513                 : {
     514                 :     return false;
     515                 : }
     516                 : 
     517                 : bool
     518                 : HalParent::RecvEnableNetworkNotifications()
     519                 : {
     520                 :     return false;
     521                 : }
     522                 : 
     523                 : bool
     524                 : HalParent::RecvDisableNetworkNotifications()
     525                 : {
     526                 :     return false;
     527                 : }
     528                 : 
     529                 : bool
     530                 : HalParent::RecvGetCurrentNetworkInformation(NetworkInformation* aNetworkInfo)
     531                 : {
     532                 :     return false;
     533                 : }
     534                 : 
     535                 : bool
     536                 : HalParent::RecvGetScreenEnabled(bool* enabled)
     537                 : {
     538                 :     return false;
     539                 : }
     540                 : 
     541                 : bool
     542                 : HalParent::RecvSetScreenEnabled(const bool& enabled)
     543                 : {
     544                 :     return false;
     545                 : }
     546                 : 
     547                 : bool
     548                 : HalParent::RecvGetScreenBrightness(double* brightness)
     549                 : {
     550                 :     return false;
     551                 : }
     552                 : 
     553                 : bool
     554                 : HalParent::RecvSetScreenBrightness(const double& brightness)
     555                 : {
     556                 :     return false;
     557                 : }
     558                 : 
     559                 : bool
     560                 : HalParent::RecvAdjustSystemClock(const int32& aDeltaMilliseconds)
     561                 : {
     562                 :     return false;
     563                 : }
     564                 : 
     565                 : bool
     566                 : HalParent::RecvSetTimezone(const nsCString& aTimezoneSpec)
     567                 : {
     568                 :     return false;
     569                 : }
     570                 : 
     571                 : bool
     572                 : HalParent::RecvSetLight(
     573                 :         const LightType& light,
     574                 :         const LightConfiguration& aConfig,
     575                 :         bool* status)
     576                 : {
     577                 :     return false;
     578                 : }
     579                 : 
     580                 : bool
     581                 : HalParent::RecvGetLight(
     582                 :         const LightType& light,
     583                 :         LightConfiguration* aConfig,
     584                 :         bool* status)
     585                 : {
     586                 :     return false;
     587                 : }
     588                 : 
     589                 : bool
     590                 : HalParent::RecvReboot()
     591                 : {
     592                 :     return false;
     593                 : }
     594                 : 
     595                 : bool
     596                 : HalParent::RecvPowerOff()
     597                 : {
     598                 :     return false;
     599                 : }
     600                 : 
     601                 : bool
     602                 : HalParent::RecvModifyWakeLock(
     603                 :         const nsString& aTopic,
     604                 :         const WakeLockControl& aLockAdjust,
     605                 :         const WakeLockControl& aHiddenAdjust)
     606                 : {
     607                 :     return false;
     608                 : }
     609                 : 
     610                 : bool
     611                 : HalParent::RecvEnableWakeLockNotifications()
     612                 : {
     613                 :     return false;
     614                 : }
     615                 : 
     616                 : bool
     617                 : HalParent::RecvDisableWakeLockNotifications()
     618                 : {
     619                 :     return false;
     620                 : }
     621                 : 
     622                 : bool
     623                 : HalParent::RecvGetWakeLockInfo(
     624                 :         const nsString& aTopic,
     625                 :         WakeLockInformation* aWakeLockInfo)
     626                 : {
     627                 :     return false;
     628                 : }
     629                 : 
     630                 : bool
     631                 : HalParent::RecvEnableSensorNotifications(const SensorType& aSensor)
     632                 : {
     633                 :     return false;
     634                 : }
     635                 : 
     636                 : bool
     637                 : HalParent::RecvDisableSensorNotifications(const SensorType& aSensor)
     638                 : {
     639                 :     return false;
     640                 : }
     641                 : 
     642                 : HalParent::HalParent()
     643                 : {
     644                 :     MOZ_COUNT_CTOR(HalParent);
     645                 : }
     646                 : 
     647                 : HalParent::~HalParent()
     648                 : {
     649                 :     MOZ_COUNT_DTOR(HalParent);
     650                 : }
     651                 : 
     652                 : } // namespace hal_sandbox
     653                 : } // namespace mozilla
     654                 : #endif // if 0
     655                 : 
     656                 : #endif // ifndef PHalParent_h

Generated by: LCOV version 1.7