dom/network/src/UDPSocketChild.h

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:050bd7bc504e
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/. */
4
5 #ifndef mozilla_dom_UDPSocketChild_h__
6 #define mozilla_dom_UDPSocketChild_h__
7
8 #include "mozilla/net/PUDPSocketChild.h"
9 #include "nsIUDPSocketChild.h"
10 #include "nsCycleCollectionParticipant.h"
11 #include "nsCOMPtr.h"
12
13 #define UDPSOCKETCHILD_CID \
14 {0xb47e5a0f, 0xd384, 0x48ef, { 0x88, 0x85, 0x42, 0x59, 0x79, 0x3d, 0x9c, 0xf0 }}
15
16 namespace mozilla {
17 namespace dom {
18
19 class UDPSocketChildBase : public nsIUDPSocketChild {
20 public:
21 NS_DECL_ISUPPORTS
22
23 void AddIPDLReference();
24 void ReleaseIPDLReference();
25
26 protected:
27 UDPSocketChildBase();
28 virtual ~UDPSocketChildBase();
29 nsCOMPtr<nsIUDPSocketInternal> mSocket;
30 bool mIPCOpen;
31 };
32
33 class UDPSocketChild : public mozilla::net::PUDPSocketChild
34 , public UDPSocketChildBase
35 {
36 public:
37 NS_DECL_NSIUDPSOCKETCHILD
38 NS_IMETHOD_(MozExternalRefCountType) Release() MOZ_OVERRIDE;
39
40 UDPSocketChild();
41 virtual ~UDPSocketChild();
42
43 virtual bool RecvCallback(const nsCString& aType,
44 const UDPCallbackData& aData,
45 const nsCString& aState) MOZ_OVERRIDE;
46 private:
47 uint16_t mLocalPort;
48 nsCString mLocalAddress;
49 nsCString mFilterName;
50 };
51
52 } // namespace dom
53 } // namespace mozilla
54
55 #endif // !defined(mozilla_dom_UDPSocketChild_h__)

mercurial