Backed out changeset 2450366cf7ca (bug 1891629) for causing win msix mochitest failures
[gecko.git] / dom / network / TCPServerSocketChild.h
blobb6773cb61bdba7e05c1c3148012987577460e935
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_TCPServerSocketChild_h
8 #define mozilla_dom_TCPServerSocketChild_h
10 #include "mozilla/net/PTCPServerSocketChild.h"
11 #include "nsCycleCollectionParticipant.h"
12 #include "nsCOMPtr.h"
14 #define TCPSERVERSOCKETCHILD_CID \
15 { \
16 0x41a77ec8, 0xfd86, 0x409e, { \
17 0xae, 0xa9, 0xaf, 0x2c, 0xa4, 0x07, 0xef, 0x8e \
18 } \
21 class nsITCPServerSocketInternal;
23 namespace mozilla::dom {
25 class TCPServerSocket;
27 class TCPServerSocketChildBase : public nsISupports {
28 public:
29 NS_DECL_CYCLE_COLLECTION_CLASS(TCPServerSocketChildBase)
30 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
32 void AddIPDLReference();
33 void ReleaseIPDLReference();
35 protected:
36 TCPServerSocketChildBase();
37 virtual ~TCPServerSocketChildBase();
39 RefPtr<TCPServerSocket> mServerSocket;
40 bool mIPCOpen;
43 class TCPServerSocketChild : public mozilla::net::PTCPServerSocketChild,
44 public TCPServerSocketChildBase {
45 public:
46 NS_IMETHOD_(MozExternalRefCountType) Release() override;
48 TCPServerSocketChild(TCPServerSocket* aServerSocket, uint16_t aLocalPort,
49 uint16_t aBacklog, bool aUseArrayBuffers);
50 ~TCPServerSocketChild();
52 void Close();
54 mozilla::ipc::IPCResult RecvCallbackAccept(PTCPSocketChild* socket);
57 } // namespace mozilla::dom
59 #endif // mozilla_dom_TCPServerSocketChild_h