Bug 1805294 [wpt PR 37463] - WebKit export of https://bugs.webkit.org/show_bug.cgi...
[gecko.git] / dom / network / TCPServerSocketParent.h
blobbbebaa186065bead2576be52a3b0be8752f2e4d1
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/. */
7 #ifndef mozilla_dom_TCPServerSocketParent_h
8 #define mozilla_dom_TCPServerSocketParent_h
10 #include "mozilla/net/PNeckoParent.h"
11 #include "mozilla/net/PTCPServerSocketParent.h"
12 #include "nsCycleCollectionParticipant.h"
13 #include "nsCOMPtr.h"
15 namespace mozilla::dom {
17 class TCPServerSocket;
18 class TCPServerSocketEvent;
19 class TCPSocketParent;
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
27 TCPServerSocketParent(PNeckoParent* neckoParent, uint16_t aLocalPort,
28 uint16_t aBacklog, bool aUseArrayBuffers);
30 void Init();
32 mozilla::ipc::IPCResult RecvClose();
33 mozilla::ipc::IPCResult RecvRequestDelete();
35 void AddIPDLReference();
36 void ReleaseIPDLReference();
38 void OnConnect(TCPServerSocketEvent* event);
40 private:
41 ~TCPServerSocketParent();
43 nsresult SendCallbackAccept(TCPSocketParent* socket);
45 virtual void ActorDestroy(ActorDestroyReason why) override;
47 PNeckoParent* mNeckoParent;
48 RefPtr<TCPServerSocket> mServerSocket;
49 bool mIPCOpen;
52 } // namespace mozilla::dom
54 #endif // mozilla_dom_TCPServerSocketParent_h