michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "mozilla/net/PTCPServerSocketChild.h" michael@0: #include "nsITCPServerSocketChild.h" michael@0: #include "nsCycleCollectionParticipant.h" michael@0: #include "nsCOMPtr.h" michael@0: michael@0: #define TCPSERVERSOCKETCHILD_CID \ michael@0: { 0x41a77ec8, 0xfd86, 0x409e, { 0xae, 0xa9, 0xaf, 0x2c, 0xa4, 0x07, 0xef, 0x8e } } michael@0: michael@0: class nsITCPServerSocketInternal; michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: class TCPServerSocketChildBase : public nsITCPServerSocketChild { michael@0: public: michael@0: NS_DECL_CYCLE_COLLECTION_CLASS(TCPServerSocketChildBase) michael@0: NS_DECL_CYCLE_COLLECTING_ISUPPORTS michael@0: michael@0: void AddIPDLReference(); michael@0: void ReleaseIPDLReference(); michael@0: michael@0: protected: michael@0: TCPServerSocketChildBase(); michael@0: virtual ~TCPServerSocketChildBase(); michael@0: michael@0: nsCOMPtr mServerSocket; michael@0: bool mIPCOpen; michael@0: }; michael@0: michael@0: class TCPServerSocketChild : public mozilla::net::PTCPServerSocketChild michael@0: , public TCPServerSocketChildBase michael@0: { michael@0: public: michael@0: NS_DECL_NSITCPSERVERSOCKETCHILD michael@0: NS_IMETHOD_(MozExternalRefCountType) Release() MOZ_OVERRIDE; michael@0: michael@0: TCPServerSocketChild(); michael@0: ~TCPServerSocketChild(); michael@0: michael@0: virtual bool RecvCallbackAccept(PTCPSocketChild *socket) MOZ_OVERRIDE; michael@0: virtual bool RecvCallbackError(const nsString& aMessage, michael@0: const nsString& aFilename, michael@0: const uint32_t& aLineNumber, michael@0: const uint32_t& aColumnNumber) MOZ_OVERRIDE; michael@0: }; michael@0: michael@0: } // namespace dom michael@0: } // namespace mozilla