dom/network/src/UDPSocketChild.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
michael@0 3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4
michael@0 5 #ifndef mozilla_dom_UDPSocketChild_h__
michael@0 6 #define mozilla_dom_UDPSocketChild_h__
michael@0 7
michael@0 8 #include "mozilla/net/PUDPSocketChild.h"
michael@0 9 #include "nsIUDPSocketChild.h"
michael@0 10 #include "nsCycleCollectionParticipant.h"
michael@0 11 #include "nsCOMPtr.h"
michael@0 12
michael@0 13 #define UDPSOCKETCHILD_CID \
michael@0 14 {0xb47e5a0f, 0xd384, 0x48ef, { 0x88, 0x85, 0x42, 0x59, 0x79, 0x3d, 0x9c, 0xf0 }}
michael@0 15
michael@0 16 namespace mozilla {
michael@0 17 namespace dom {
michael@0 18
michael@0 19 class UDPSocketChildBase : public nsIUDPSocketChild {
michael@0 20 public:
michael@0 21 NS_DECL_ISUPPORTS
michael@0 22
michael@0 23 void AddIPDLReference();
michael@0 24 void ReleaseIPDLReference();
michael@0 25
michael@0 26 protected:
michael@0 27 UDPSocketChildBase();
michael@0 28 virtual ~UDPSocketChildBase();
michael@0 29 nsCOMPtr<nsIUDPSocketInternal> mSocket;
michael@0 30 bool mIPCOpen;
michael@0 31 };
michael@0 32
michael@0 33 class UDPSocketChild : public mozilla::net::PUDPSocketChild
michael@0 34 , public UDPSocketChildBase
michael@0 35 {
michael@0 36 public:
michael@0 37 NS_DECL_NSIUDPSOCKETCHILD
michael@0 38 NS_IMETHOD_(MozExternalRefCountType) Release() MOZ_OVERRIDE;
michael@0 39
michael@0 40 UDPSocketChild();
michael@0 41 virtual ~UDPSocketChild();
michael@0 42
michael@0 43 virtual bool RecvCallback(const nsCString& aType,
michael@0 44 const UDPCallbackData& aData,
michael@0 45 const nsCString& aState) MOZ_OVERRIDE;
michael@0 46 private:
michael@0 47 uint16_t mLocalPort;
michael@0 48 nsCString mLocalAddress;
michael@0 49 nsCString mFilterName;
michael@0 50 };
michael@0 51
michael@0 52 } // namespace dom
michael@0 53 } // namespace mozilla
michael@0 54
michael@0 55 #endif // !defined(mozilla_dom_UDPSocketChild_h__)

mercurial