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

Generated by: LCOV version 1.7