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

     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"
    11 #include "nsCOMPtr.h"
    13 #define UDPSOCKETCHILD_CID \
    14   {0xb47e5a0f, 0xd384, 0x48ef, { 0x88, 0x85, 0x42, 0x59, 0x79, 0x3d, 0x9c, 0xf0 }}
    16 namespace mozilla {
    17 namespace dom {
    19 class UDPSocketChildBase : public nsIUDPSocketChild {
    20 public:
    21   NS_DECL_ISUPPORTS
    23   void AddIPDLReference();
    24   void ReleaseIPDLReference();
    26 protected:
    27   UDPSocketChildBase();
    28   virtual ~UDPSocketChildBase();
    29   nsCOMPtr<nsIUDPSocketInternal> mSocket;
    30   bool mIPCOpen;
    31 };
    33 class UDPSocketChild : public mozilla::net::PUDPSocketChild
    34                      , public UDPSocketChildBase
    35 {
    36 public:
    37   NS_DECL_NSIUDPSOCKETCHILD
    38   NS_IMETHOD_(MozExternalRefCountType) Release() MOZ_OVERRIDE;
    40   UDPSocketChild();
    41   virtual ~UDPSocketChild();
    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 };
    52 } // namespace dom
    53 } // namespace mozilla
    55 #endif // !defined(mozilla_dom_UDPSocketChild_h__)

mercurial