dom/network/src/TCPServerSocketChild.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/network/src/TCPServerSocketChild.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,52 @@
     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/PTCPServerSocketChild.h"
     1.9 +#include "nsITCPServerSocketChild.h"
    1.10 +#include "nsCycleCollectionParticipant.h"
    1.11 +#include "nsCOMPtr.h"
    1.12 +
    1.13 +#define TCPSERVERSOCKETCHILD_CID \
    1.14 +  { 0x41a77ec8, 0xfd86, 0x409e, { 0xae, 0xa9, 0xaf, 0x2c, 0xa4, 0x07, 0xef, 0x8e } }
    1.15 +
    1.16 +class nsITCPServerSocketInternal;
    1.17 +
    1.18 +namespace mozilla {
    1.19 +namespace dom {
    1.20 +
    1.21 +class TCPServerSocketChildBase : public nsITCPServerSocketChild {
    1.22 +public:
    1.23 +  NS_DECL_CYCLE_COLLECTION_CLASS(TCPServerSocketChildBase)
    1.24 +  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
    1.25 +
    1.26 +  void AddIPDLReference();
    1.27 +  void ReleaseIPDLReference();
    1.28 +
    1.29 +protected:
    1.30 +  TCPServerSocketChildBase();
    1.31 +  virtual ~TCPServerSocketChildBase();
    1.32 +
    1.33 +  nsCOMPtr<nsITCPServerSocketInternal> mServerSocket;
    1.34 +  bool mIPCOpen;
    1.35 +};
    1.36 +
    1.37 +class TCPServerSocketChild : public mozilla::net::PTCPServerSocketChild
    1.38 +                           , public TCPServerSocketChildBase
    1.39 +{
    1.40 +public:
    1.41 +  NS_DECL_NSITCPSERVERSOCKETCHILD
    1.42 +  NS_IMETHOD_(MozExternalRefCountType) Release() MOZ_OVERRIDE;
    1.43 +
    1.44 +  TCPServerSocketChild();
    1.45 +  ~TCPServerSocketChild();
    1.46 +
    1.47 +  virtual bool RecvCallbackAccept(PTCPSocketChild *socket)  MOZ_OVERRIDE;
    1.48 +  virtual bool RecvCallbackError(const nsString& aMessage,
    1.49 +                                 const nsString& aFilename,
    1.50 +                                 const uint32_t& aLineNumber,
    1.51 +                                 const uint32_t& aColumnNumber) MOZ_OVERRIDE;
    1.52 +};
    1.53 +
    1.54 +} // namespace dom
    1.55 +} // namespace mozilla

mercurial