TCPServerSocketParent.h (1575B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this file, 5 * You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef mozilla_dom_TCPServerSocketParent_h 8 #define mozilla_dom_TCPServerSocketParent_h 9 10 #include "mozilla/net/PNeckoParent.h" 11 #include "mozilla/net/PTCPServerSocketParent.h" 12 #include "nsCOMPtr.h" 13 #include "nsCycleCollectionParticipant.h" 14 15 namespace mozilla::dom { 16 17 class TCPServerSocket; 18 class TCPServerSocketEvent; 19 class TCPSocketParent; 20 21 class TCPServerSocketParent : public mozilla::net::PTCPServerSocketParent, 22 public nsISupports { 23 public: 24 NS_DECL_CYCLE_COLLECTION_CLASS(TCPServerSocketParent) 25 NS_DECL_CYCLE_COLLECTING_ISUPPORTS 26 27 TCPServerSocketParent(PNeckoParent* neckoParent, uint16_t aLocalPort, 28 uint16_t aBacklog, bool aUseArrayBuffers); 29 30 void Init(); 31 32 mozilla::ipc::IPCResult RecvClose(); 33 mozilla::ipc::IPCResult RecvRequestDelete(); 34 35 void AddIPDLReference(); 36 void ReleaseIPDLReference(); 37 38 void OnConnect(TCPServerSocketEvent* event); 39 40 private: 41 ~TCPServerSocketParent(); 42 43 nsresult SendCallbackAccept(TCPSocketParent* socket); 44 45 virtual void ActorDestroy(ActorDestroyReason why) override; 46 47 PNeckoParent* mNeckoParent; 48 RefPtr<TCPServerSocket> mServerSocket; 49 bool mIPCOpen; 50 }; 51 52 } // namespace mozilla::dom 53 54 #endif // mozilla_dom_TCPServerSocketParent_h