michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "mozilla/net/PNeckoParent.h" michael@0: #include "mozilla/net/PTCPServerSocketParent.h" michael@0: #include "nsITCPSocketParent.h" michael@0: #include "nsITCPServerSocketParent.h" michael@0: #include "nsCycleCollectionParticipant.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsIDOMTCPSocket.h" michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: class PBrowserParent; michael@0: michael@0: class TCPServerSocketParent : public mozilla::net::PTCPServerSocketParent michael@0: , public nsITCPServerSocketParent michael@0: { michael@0: public: michael@0: NS_DECL_CYCLE_COLLECTION_CLASS(TCPServerSocketParent) michael@0: NS_DECL_CYCLE_COLLECTING_ISUPPORTS michael@0: NS_DECL_NSITCPSERVERSOCKETPARENT michael@0: michael@0: TCPServerSocketParent() : mNeckoParent(nullptr), mIPCOpen(false) {} michael@0: michael@0: bool Init(PNeckoParent* neckoParent, const uint16_t& aLocalPort, const uint16_t& aBacklog, michael@0: const nsString& aBinaryType); michael@0: michael@0: virtual bool RecvClose() MOZ_OVERRIDE; michael@0: virtual bool RecvRequestDelete() MOZ_OVERRIDE; michael@0: michael@0: void AddIPDLReference(); michael@0: void ReleaseIPDLReference(); michael@0: michael@0: private: michael@0: virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE; michael@0: michael@0: PNeckoParent* mNeckoParent; michael@0: nsCOMPtr mIntermediary; michael@0: nsCOMPtr mServerSocket; michael@0: bool mIPCOpen; michael@0: }; michael@0: michael@0: } // namespace dom michael@0: } // namespace mozilla