1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef mozilla_dom_UDPSocketChild_h__
6 #define mozilla_dom_UDPSocketChild_h__
8 #include "mozilla/net/PUDPSocketChild.h"
9 #include "nsIUDPSocketChild.h"
10 #include "nsCycleCollectionParticipant.h"
13 #define UDPSOCKETCHILD_CID \
14 {0xb47e5a0f, 0xd384, 0x48ef, { 0x88, 0x85, 0x42, 0x59, 0x79, 0x3d, 0x9c, 0xf0 }}
19 class UDPSocketChildBase
: public nsIUDPSocketChild
{
23 void AddIPDLReference();
24 void ReleaseIPDLReference();
28 virtual ~UDPSocketChildBase();
29 nsCOMPtr
<nsIUDPSocketInternal
> mSocket
;
33 class UDPSocketChild
: public mozilla::net::PUDPSocketChild
34 , public UDPSocketChildBase
37 NS_DECL_NSIUDPSOCKETCHILD
38 NS_IMETHOD_(MozExternalRefCountType
) Release() MOZ_OVERRIDE
;
41 virtual ~UDPSocketChild();
43 virtual bool RecvCallbackOpened(const UDPAddressInfo
& aAddressInfo
) MOZ_OVERRIDE
;
44 virtual bool RecvCallbackClosed() MOZ_OVERRIDE
;
45 virtual bool RecvCallbackReceivedData(const UDPAddressInfo
& aAddressInfo
,
46 const InfallibleTArray
<uint8_t>& aData
) MOZ_OVERRIDE
;
47 virtual bool RecvCallbackError(const nsCString
& aMessage
,
48 const nsCString
& aFilename
,
49 const uint32_t& aLineNumber
) MOZ_OVERRIDE
;
52 nsresult
SendDataInternal(const UDPSocketAddr
& aAddr
,
54 const uint32_t aByteLength
);
57 nsCString mLocalAddress
;
58 nsCString mFilterName
;
62 } // namespace mozilla
64 #endif // !defined(mozilla_dom_UDPSocketChild_h__)