dom/network/src/TCPSocketChild.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/network/src/TCPSocketChild.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,61 @@
     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 +#ifndef mozilla_dom_TCPSocketChild_h
     1.9 +#define mozilla_dom_TCPSocketChild_h
    1.10 +
    1.11 +#include "mozilla/net/PTCPSocketChild.h"
    1.12 +#include "nsITCPSocketChild.h"
    1.13 +#include "nsCycleCollectionParticipant.h"
    1.14 +#include "nsCOMPtr.h"
    1.15 +#include "js/TypeDecls.h"
    1.16 +
    1.17 +#define TCPSOCKETCHILD_CID \
    1.18 +  { 0xa589d96f, 0x7e09, 0x4edf, { 0xa0, 0x1a, 0xeb, 0x49, 0x51, 0xf4, 0x2f, 0x37 } }
    1.19 +
    1.20 +class nsITCPSocketInternal;
    1.21 +
    1.22 +namespace mozilla {
    1.23 +namespace dom {
    1.24 +
    1.25 +class TCPSocketChildBase : public nsITCPSocketChild {
    1.26 +public:
    1.27 +  NS_DECL_CYCLE_COLLECTION_CLASS(TCPSocketChildBase)
    1.28 +  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
    1.29 +
    1.30 +  void AddIPDLReference();
    1.31 +  void ReleaseIPDLReference();
    1.32 +
    1.33 +protected:
    1.34 +  TCPSocketChildBase();
    1.35 +  virtual ~TCPSocketChildBase();
    1.36 +
    1.37 +  nsCOMPtr<nsITCPSocketInternal> mSocket;
    1.38 +  bool mIPCOpen;
    1.39 +};
    1.40 +
    1.41 +class TCPSocketChild : public mozilla::net::PTCPSocketChild
    1.42 +                     , public TCPSocketChildBase
    1.43 +{
    1.44 +public:
    1.45 +  NS_DECL_NSITCPSOCKETCHILD
    1.46 +  NS_IMETHOD_(MozExternalRefCountType) Release() MOZ_OVERRIDE;
    1.47 +
    1.48 +  TCPSocketChild();
    1.49 +  ~TCPSocketChild();
    1.50 +
    1.51 +  virtual bool RecvCallback(const nsString& aType,
    1.52 +                            const CallbackData& aData,
    1.53 +                            const nsString& aReadyState) MOZ_OVERRIDE;
    1.54 +  virtual bool RecvRequestDelete() MOZ_OVERRIDE;
    1.55 +  virtual bool RecvUpdateBufferedAmount(const uint32_t& aBufferred,
    1.56 +                                        const uint32_t& aTrackingNumber) MOZ_OVERRIDE;
    1.57 +private:
    1.58 +  JSObject* mWindowObj;
    1.59 +};
    1.60 +
    1.61 +} // namespace dom
    1.62 +} // namespace mozilla
    1.63 +
    1.64 +#endif

mercurial