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: #ifndef mozilla_dom_UDPSocketChild_h__ michael@0: #define mozilla_dom_UDPSocketChild_h__ michael@0: michael@0: #include "mozilla/net/PUDPSocketChild.h" michael@0: #include "nsIUDPSocketChild.h" michael@0: #include "nsCycleCollectionParticipant.h" michael@0: #include "nsCOMPtr.h" michael@0: michael@0: #define UDPSOCKETCHILD_CID \ michael@0: {0xb47e5a0f, 0xd384, 0x48ef, { 0x88, 0x85, 0x42, 0x59, 0x79, 0x3d, 0x9c, 0xf0 }} michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: class UDPSocketChildBase : public nsIUDPSocketChild { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: michael@0: void AddIPDLReference(); michael@0: void ReleaseIPDLReference(); michael@0: michael@0: protected: michael@0: UDPSocketChildBase(); michael@0: virtual ~UDPSocketChildBase(); michael@0: nsCOMPtr mSocket; michael@0: bool mIPCOpen; michael@0: }; michael@0: michael@0: class UDPSocketChild : public mozilla::net::PUDPSocketChild michael@0: , public UDPSocketChildBase michael@0: { michael@0: public: michael@0: NS_DECL_NSIUDPSOCKETCHILD michael@0: NS_IMETHOD_(MozExternalRefCountType) Release() MOZ_OVERRIDE; michael@0: michael@0: UDPSocketChild(); michael@0: virtual ~UDPSocketChild(); michael@0: michael@0: virtual bool RecvCallback(const nsCString& aType, michael@0: const UDPCallbackData& aData, michael@0: const nsCString& aState) MOZ_OVERRIDE; michael@0: private: michael@0: uint16_t mLocalPort; michael@0: nsCString mLocalAddress; michael@0: nsCString mFilterName; michael@0: }; michael@0: michael@0: } // namespace dom michael@0: } // namespace mozilla michael@0: michael@0: #endif // !defined(mozilla_dom_UDPSocketChild_h__)