dom/network/src/TCPServerSocketParent.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 #include "mozilla/net/PNeckoParent.h"
     6 #include "mozilla/net/PTCPServerSocketParent.h"
     7 #include "nsITCPSocketParent.h"
     8 #include "nsITCPServerSocketParent.h"
     9 #include "nsCycleCollectionParticipant.h"
    10 #include "nsCOMPtr.h"
    11 #include "nsIDOMTCPSocket.h"
    13 namespace mozilla {
    14 namespace dom {
    16 class PBrowserParent;
    18 class TCPServerSocketParent : public mozilla::net::PTCPServerSocketParent
    19                             , public nsITCPServerSocketParent
    20 {
    21 public:
    22   NS_DECL_CYCLE_COLLECTION_CLASS(TCPServerSocketParent)
    23   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
    24   NS_DECL_NSITCPSERVERSOCKETPARENT
    26   TCPServerSocketParent() : mNeckoParent(nullptr), mIPCOpen(false) {}
    28   bool Init(PNeckoParent* neckoParent, const uint16_t& aLocalPort, const uint16_t& aBacklog,
    29             const nsString& aBinaryType);
    31   virtual bool RecvClose() MOZ_OVERRIDE;
    32   virtual bool RecvRequestDelete() MOZ_OVERRIDE;
    34   void AddIPDLReference();
    35   void ReleaseIPDLReference();
    37 private:
    38   virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
    40   PNeckoParent* mNeckoParent;
    41   nsCOMPtr<nsITCPSocketIntermediary> mIntermediary;
    42   nsCOMPtr<nsIDOMTCPServerSocket> mServerSocket;
    43   bool mIPCOpen;
    44 };
    46 } // namespace dom
    47 } // namespace mozilla

mercurial