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"
15 namespace mozilla::dom
{
17 class TCPServerSocket
;
18 class TCPServerSocketEvent
;
19 class TCPSocketParent
;
21 class TCPServerSocketParent
: public mozilla::net::PTCPServerSocketParent
,
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
);
32 mozilla::ipc::IPCResult
RecvClose();
33 mozilla::ipc::IPCResult
RecvRequestDelete();
35 void AddIPDLReference();
36 void ReleaseIPDLReference();
38 void OnConnect(TCPServerSocketEvent
* event
);
41 ~TCPServerSocketParent();
43 nsresult
SendCallbackAccept(TCPSocketParent
* socket
);
45 virtual void ActorDestroy(ActorDestroyReason why
) override
;
47 PNeckoParent
* mNeckoParent
;
48 RefPtr
<TCPServerSocket
> mServerSocket
;
52 } // namespace mozilla::dom
54 #endif // mozilla_dom_TCPServerSocketParent_h