|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
|
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 #include "mozilla/net/PNeckoParent.h" |
|
6 #include "mozilla/net/PTCPServerSocketParent.h" |
|
7 #include "nsITCPSocketParent.h" |
|
8 #include "nsITCPServerSocketParent.h" |
|
9 #include "nsCycleCollectionParticipant.h" |
|
10 #include "nsCOMPtr.h" |
|
11 #include "nsIDOMTCPSocket.h" |
|
12 |
|
13 namespace mozilla { |
|
14 namespace dom { |
|
15 |
|
16 class PBrowserParent; |
|
17 |
|
18 class TCPServerSocketParent : public mozilla::net::PTCPServerSocketParent |
|
19 , public nsITCPServerSocketParent |
|
20 { |
|
21 public: |
|
22 NS_DECL_CYCLE_COLLECTION_CLASS(TCPServerSocketParent) |
|
23 NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
|
24 NS_DECL_NSITCPSERVERSOCKETPARENT |
|
25 |
|
26 TCPServerSocketParent() : mNeckoParent(nullptr), mIPCOpen(false) {} |
|
27 |
|
28 bool Init(PNeckoParent* neckoParent, const uint16_t& aLocalPort, const uint16_t& aBacklog, |
|
29 const nsString& aBinaryType); |
|
30 |
|
31 virtual bool RecvClose() MOZ_OVERRIDE; |
|
32 virtual bool RecvRequestDelete() MOZ_OVERRIDE; |
|
33 |
|
34 void AddIPDLReference(); |
|
35 void ReleaseIPDLReference(); |
|
36 |
|
37 private: |
|
38 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE; |
|
39 |
|
40 PNeckoParent* mNeckoParent; |
|
41 nsCOMPtr<nsITCPSocketIntermediary> mIntermediary; |
|
42 nsCOMPtr<nsIDOMTCPServerSocket> mServerSocket; |
|
43 bool mIPCOpen; |
|
44 }; |
|
45 |
|
46 } // namespace dom |
|
47 } // namespace mozilla |