dom/network/src/TCPServerSocketParent.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/network/src/TCPServerSocketParent.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,47 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.6 + * You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#include "mozilla/net/PNeckoParent.h"
     1.9 +#include "mozilla/net/PTCPServerSocketParent.h"
    1.10 +#include "nsITCPSocketParent.h"
    1.11 +#include "nsITCPServerSocketParent.h"
    1.12 +#include "nsCycleCollectionParticipant.h"
    1.13 +#include "nsCOMPtr.h"
    1.14 +#include "nsIDOMTCPSocket.h"
    1.15 +
    1.16 +namespace mozilla {
    1.17 +namespace dom {
    1.18 +
    1.19 +class PBrowserParent;
    1.20 +
    1.21 +class TCPServerSocketParent : public mozilla::net::PTCPServerSocketParent
    1.22 +                            , public nsITCPServerSocketParent
    1.23 +{
    1.24 +public:
    1.25 +  NS_DECL_CYCLE_COLLECTION_CLASS(TCPServerSocketParent)
    1.26 +  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
    1.27 +  NS_DECL_NSITCPSERVERSOCKETPARENT
    1.28 +
    1.29 +  TCPServerSocketParent() : mNeckoParent(nullptr), mIPCOpen(false) {}
    1.30 +
    1.31 +  bool Init(PNeckoParent* neckoParent, const uint16_t& aLocalPort, const uint16_t& aBacklog,
    1.32 +            const nsString& aBinaryType);
    1.33 +
    1.34 +  virtual bool RecvClose() MOZ_OVERRIDE;
    1.35 +  virtual bool RecvRequestDelete() MOZ_OVERRIDE;
    1.36 +
    1.37 +  void AddIPDLReference();
    1.38 +  void ReleaseIPDLReference();
    1.39 +
    1.40 +private:
    1.41 +  virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
    1.42 +
    1.43 +  PNeckoParent* mNeckoParent;
    1.44 +  nsCOMPtr<nsITCPSocketIntermediary> mIntermediary;
    1.45 +  nsCOMPtr<nsIDOMTCPServerSocket> mServerSocket;
    1.46 +  bool mIPCOpen;
    1.47 +};
    1.48 +
    1.49 +} // namespace dom
    1.50 +} // namespace mozilla

mercurial