Bumping gaia.json for 1 gaia revision(s) a=gaia-bump
[gecko.git] / dom / network / TCPServerSocketParent.h
blob6e567e85f31bdaf3bfdfee59f77c92746cde852f
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/. */
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"
13 namespace mozilla {
14 namespace dom {
16 class PBrowserParent;
18 class TCPServerSocketParent : public mozilla::net::PTCPServerSocketParent
19 , public nsITCPServerSocketParent
21 public:
22 NS_DECL_CYCLE_COLLECTION_CLASS(TCPServerSocketParent)
23 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
24 NS_DECL_NSITCPSERVERSOCKETPARENT
26 TCPServerSocketParent() : mNeckoParent(nullptr), mIPCOpen(false) {}
28 bool Init(PNeckoParent* neckoParent, const uint16_t& aLocalPort, const uint16_t& aBacklog,
29 const nsString& aBinaryType);
31 virtual bool RecvClose() MOZ_OVERRIDE;
32 virtual bool RecvRequestDelete() MOZ_OVERRIDE;
34 void AddIPDLReference();
35 void ReleaseIPDLReference();
37 private:
38 ~TCPServerSocketParent() {}
40 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
42 PNeckoParent* mNeckoParent;
43 nsCOMPtr<nsITCPSocketIntermediary> mIntermediary;
44 nsCOMPtr<nsIDOMTCPServerSocket> mServerSocket;
45 bool mIPCOpen;
48 } // namespace dom
49 } // namespace mozilla