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

       1                 : //
       2                 : // Automatically generated by ipdlc.
       3                 : // Edit at your own risk
       4                 : //
       5                 : 
       6                 : #ifndef PWebSocketChild_h
       7                 : #define PWebSocketChild_h
       8                 : 
       9                 : #include "mozilla/net/PWebSocket.h"
      10                 : namespace mozilla {
      11                 : namespace net {
      12                 : class PNeckoChild;
      13                 : } // namespace net
      14                 : } // namespace mozilla
      15                 : 
      16                 : namespace mozilla {
      17                 : namespace dom {
      18                 : class PBrowserChild;
      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 net {
      31                 : class PNeckoChild;
      32                 : } // namespace net
      33                 : } // namespace mozilla
      34                 : 
      35                 : namespace mozilla {
      36                 : namespace net {
      37                 : 
      38                 : 
      39                 : class /*NS_ABSTRACT_CLASS*/ PWebSocketChild :
      40                 :     protected mozilla::ipc::RPCChannel::RPCListener,
      41                 :     protected mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>
      42                 : {
      43                 :     friend class mozilla::net::PNeckoChild;
      44                 : 
      45                 : protected:
      46                 :     typedef mozilla::ipc::ActorHandle ActorHandle;
      47                 :     typedef mozilla::ipc::Shmem Shmem;
      48                 :     typedef IPC::URI URI;
      49                 :     typedef IPC::InputStream InputStream;
      50                 :     typedef mozilla::net::PNeckoChild PNeckoChild;
      51                 :     typedef mozilla::dom::PBrowserChild PBrowserChild;
      52                 :     typedef base::ProcessId ProcessId;
      53                 :     typedef mozilla::ipc::ProtocolId ProtocolId;
      54                 :     typedef mozilla::ipc::Transport Transport;
      55                 :     typedef mozilla::ipc::TransportDescriptor TransportDescriptor;
      56                 : 
      57                 :     typedef PWebSocket::State State;
      58                 : 
      59                 :     virtual bool
      60                 :     RecvOnStart(
      61                 :             const nsCString& aProtocol,
      62                 :             const nsCString& aExtensions) = 0;
      63                 :     virtual bool
      64                 :     RecvOnStop(const nsresult& aStatusCode) = 0;
      65                 :     virtual bool
      66                 :     RecvOnMessageAvailable(const nsCString& aMsg) = 0;
      67                 :     virtual bool
      68                 :     RecvOnBinaryMessageAvailable(const nsCString& aMsg) = 0;
      69                 :     virtual bool
      70                 :     RecvOnAcknowledge(const PRUint32& aSize) = 0;
      71                 :     virtual bool
      72                 :     RecvOnServerClose(
      73                 :             const PRUint16& code,
      74                 :             const nsCString& aReason) = 0;
      75                 :     virtual bool
      76                 :     Recv__delete__();
      77                 : 
      78                 :     virtual void
      79                 :     ActorDestroy(ActorDestroyReason why);
      80                 : 
      81                 : public:
      82                 :     typedef IPC::Message Message;
      83                 :     typedef mozilla::ipc::RPCChannel Channel;
      84                 :     typedef mozilla::ipc::RPCChannel::RPCListener ChannelListener;
      85                 :     typedef base::ProcessHandle ProcessHandle;
      86                 :     typedef mozilla::ipc::AsyncChannel AsyncChannel;
      87                 :     typedef mozilla::ipc::SharedMemory SharedMemory;
      88                 :     typedef mozilla::ipc::Trigger Trigger;
      89                 : 
      90                 : public:
      91                 :     PWebSocketChild();
      92                 : 
      93                 :     virtual ~PWebSocketChild();
      94                 : 
      95                 :     PNeckoChild*
      96                 :     Manager();
      97                 : 
      98                 :     PWebSocket::State
      99                 :     state();
     100                 : 
     101                 :     bool
     102                 :     SendAsyncOpen(
     103                 :             const URI& aURI,
     104                 :             const nsCString& aOrigin,
     105                 :             const nsCString& aProtocol,
     106                 :             const bool& aSecure);
     107                 : 
     108                 :     bool
     109                 :     SendClose(
     110                 :             const PRUint16& code,
     111                 :             const nsCString& reason);
     112                 : 
     113                 :     bool
     114                 :     SendSendMsg(const nsCString& aMsg);
     115                 : 
     116                 :     bool
     117                 :     SendSendBinaryMsg(const nsCString& aMsg);
     118                 : 
     119                 :     bool
     120                 :     SendSendBinaryStream(
     121                 :             const InputStream& aStream,
     122                 :             const PRUint32& aLength);
     123                 : 
     124                 :     bool
     125                 :     SendDeleteSelf();
     126                 : 
     127                 :     virtual int32
     128                 :     Register(ChannelListener* aRouted);
     129                 :     virtual int32
     130                 :     RegisterID(
     131                 :             ChannelListener* aRouted,
     132                 :             int32 aId);
     133                 :     virtual ChannelListener*
     134                 :     Lookup(int32 aId);
     135                 :     virtual void
     136                 :     Unregister(int32 aId);
     137                 :     virtual void
     138                 :     RemoveManagee(
     139                 :             int32 aProtocolId,
     140                 :             ChannelListener* aListener);
     141                 :     virtual Shmem::SharedMemory*
     142                 :     CreateSharedMemory(
     143                 :             size_t aSize,
     144                 :             Shmem::SharedMemory::SharedMemoryType type,
     145                 :             bool unsafe,
     146                 :             Shmem::id_t* aId);
     147                 :     virtual bool
     148                 :     AdoptSharedMemory(
     149                 :             Shmem::SharedMemory* segment,
     150                 :             Shmem::id_t* aId);
     151                 :     virtual Shmem::SharedMemory*
     152                 :     LookupSharedMemory(Shmem::id_t aId);
     153                 :     virtual bool
     154                 :     IsTrackingSharedMemory(Shmem::SharedMemory* segment);
     155                 :     virtual bool
     156                 :     DestroySharedMemory(Shmem& aShmem);
     157                 :     virtual ProcessHandle
     158                 :     OtherProcess() const;
     159                 :     virtual AsyncChannel*
     160                 :     GetIPCChannel();
     161                 : 
     162                 :     virtual Result
     163                 :     OnMessageReceived(const Message& __msg);
     164                 : 
     165                 :     virtual Result
     166                 :     OnMessageReceived(
     167                 :             const Message& __msg,
     168                 :             Message*& __reply);
     169                 : 
     170                 :     virtual Result
     171                 :     OnCallReceived(
     172                 :             const Message& __msg,
     173                 :             Message*& __reply);
     174                 : 
     175                 :     void
     176                 :     OnProcessingError(Result code);
     177                 : 
     178                 :     bool
     179                 :     OnReplyTimeout();
     180                 : 
     181                 :     void
     182                 :     OnChannelClose();
     183                 : 
     184                 :     void
     185                 :     OnChannelError();
     186                 : 
     187                 :     void
     188                 :     OnChannelConnected(int32 pid);
     189                 : 
     190                 :     // Methods for managing shmem
     191                 :     bool
     192                 :     AllocShmem(
     193                 :             size_t aSize,
     194                 :             Shmem::SharedMemory::SharedMemoryType aType,
     195                 :             Shmem* aMem);
     196                 : 
     197                 :     bool
     198                 :     AllocUnsafeShmem(
     199                 :             size_t aSize,
     200                 :             Shmem::SharedMemory::SharedMemoryType aType,
     201                 :             Shmem* aMem);
     202                 : 
     203                 :     bool
     204                 :     AdoptShmem(
     205                 :             Shmem& aMem,
     206                 :             Shmem* aOutMem);
     207                 : 
     208                 :     bool
     209                 :     DeallocShmem(Shmem& aMem);
     210                 : 
     211                 : private:
     212                 :     virtual void
     213                 :     FatalError(const char* const msg) const;
     214                 : 
     215                 :     void
     216                 :     DestroySubtree(ActorDestroyReason why);
     217                 : 
     218                 :     void
     219                 :     DeallocSubtree();
     220                 : 
     221                 :     template<typename T>
     222                 :     void
     223               0 :     Write(
     224                 :             const T& __v,
     225                 :             Message* __msg)
     226                 :     {
     227               0 :         IPC::WriteParam(__msg, __v);
     228               0 :     }
     229                 : 
     230                 :     template<typename T>
     231                 :     bool
     232               0 :     Read(
     233                 :             T* __v,
     234                 :             const Message* __msg,
     235                 :             void** __iter)
     236                 :     {
     237               0 :         return IPC::ReadParam(__msg, __iter, __v);
     238                 :     }
     239                 : 
     240                 :     void
     241                 :     Write(
     242                 :             PWebSocketChild* __v,
     243                 :             Message* __msg,
     244                 :             bool __nullable);
     245                 : 
     246                 :     bool
     247                 :     Read(
     248                 :             PWebSocketChild** __v,
     249                 :             const Message* __msg,
     250                 :             void** __iter,
     251                 :             bool __nullable) NS_WARN_UNUSED_RESULT;
     252                 : 
     253                 :     Channel* mChannel;
     254                 :     int32 mId;
     255                 :     mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>* mManager;
     256                 :     State mState;
     257                 : };
     258                 : 
     259                 : 
     260                 : } // namespace net
     261                 : } // namespace mozilla
     262                 : 
     263                 : #if 0
     264                 : 
     265                 : //-----------------------------------------------------------------------------
     266                 : // Skeleton implementation of abstract actor class
     267                 : 
     268                 : // Header file contents
     269                 : namespace mozilla {
     270                 : namespace net {
     271                 : class WebSocketChild :
     272                 :     public PWebSocketChild
     273                 : {
     274                 :     virtual bool
     275                 :     RecvOnStart(
     276                 :             const nsCString& aProtocol,
     277                 :             const nsCString& aExtensions);
     278                 : 
     279                 :     virtual bool
     280                 :     RecvOnStop(const nsresult& aStatusCode);
     281                 : 
     282                 :     virtual bool
     283                 :     RecvOnMessageAvailable(const nsCString& aMsg);
     284                 : 
     285                 :     virtual bool
     286                 :     RecvOnBinaryMessageAvailable(const nsCString& aMsg);
     287                 : 
     288                 :     virtual bool
     289                 :     RecvOnAcknowledge(const PRUint32& aSize);
     290                 : 
     291                 :     virtual bool
     292                 :     RecvOnServerClose(
     293                 :             const PRUint16& code,
     294                 :             const nsCString& aReason);
     295                 : 
     296                 :     WebSocketChild();
     297                 :     virtual ~WebSocketChild();
     298                 : };
     299                 : } // namespace net
     300                 : } // namespace mozilla
     301                 : 
     302                 : 
     303                 : // C++ file contents
     304                 : namespace mozilla {
     305                 : namespace net {
     306                 : bool
     307                 : WebSocketChild::RecvOnStart(
     308                 :         const nsCString& aProtocol,
     309                 :         const nsCString& aExtensions)
     310                 : {
     311                 :     return false;
     312                 : }
     313                 : 
     314                 : bool
     315                 : WebSocketChild::RecvOnStop(const nsresult& aStatusCode)
     316                 : {
     317                 :     return false;
     318                 : }
     319                 : 
     320                 : bool
     321                 : WebSocketChild::RecvOnMessageAvailable(const nsCString& aMsg)
     322                 : {
     323                 :     return false;
     324                 : }
     325                 : 
     326                 : bool
     327                 : WebSocketChild::RecvOnBinaryMessageAvailable(const nsCString& aMsg)
     328                 : {
     329                 :     return false;
     330                 : }
     331                 : 
     332                 : bool
     333                 : WebSocketChild::RecvOnAcknowledge(const PRUint32& aSize)
     334                 : {
     335                 :     return false;
     336                 : }
     337                 : 
     338                 : bool
     339                 : WebSocketChild::RecvOnServerClose(
     340                 :         const PRUint16& code,
     341                 :         const nsCString& aReason)
     342                 : {
     343                 :     return false;
     344                 : }
     345                 : 
     346                 : WebSocketChild::WebSocketChild()
     347                 : {
     348                 :     MOZ_COUNT_CTOR(WebSocketChild);
     349                 : }
     350                 : 
     351                 : WebSocketChild::~WebSocketChild()
     352                 : {
     353                 :     MOZ_COUNT_DTOR(WebSocketChild);
     354                 : }
     355                 : 
     356                 : } // namespace net
     357                 : } // namespace mozilla
     358                 : #endif // if 0
     359                 : 
     360                 : #endif // ifndef PWebSocketChild_h

Generated by: LCOV version 1.7