Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 3 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #ifndef mozilla_dom_TCPSocketChild_h |
michael@0 | 6 | #define mozilla_dom_TCPSocketChild_h |
michael@0 | 7 | |
michael@0 | 8 | #include "mozilla/net/PTCPSocketChild.h" |
michael@0 | 9 | #include "nsITCPSocketChild.h" |
michael@0 | 10 | #include "nsCycleCollectionParticipant.h" |
michael@0 | 11 | #include "nsCOMPtr.h" |
michael@0 | 12 | #include "js/TypeDecls.h" |
michael@0 | 13 | |
michael@0 | 14 | #define TCPSOCKETCHILD_CID \ |
michael@0 | 15 | { 0xa589d96f, 0x7e09, 0x4edf, { 0xa0, 0x1a, 0xeb, 0x49, 0x51, 0xf4, 0x2f, 0x37 } } |
michael@0 | 16 | |
michael@0 | 17 | class nsITCPSocketInternal; |
michael@0 | 18 | |
michael@0 | 19 | namespace mozilla { |
michael@0 | 20 | namespace dom { |
michael@0 | 21 | |
michael@0 | 22 | class TCPSocketChildBase : public nsITCPSocketChild { |
michael@0 | 23 | public: |
michael@0 | 24 | NS_DECL_CYCLE_COLLECTION_CLASS(TCPSocketChildBase) |
michael@0 | 25 | NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
michael@0 | 26 | |
michael@0 | 27 | void AddIPDLReference(); |
michael@0 | 28 | void ReleaseIPDLReference(); |
michael@0 | 29 | |
michael@0 | 30 | protected: |
michael@0 | 31 | TCPSocketChildBase(); |
michael@0 | 32 | virtual ~TCPSocketChildBase(); |
michael@0 | 33 | |
michael@0 | 34 | nsCOMPtr<nsITCPSocketInternal> mSocket; |
michael@0 | 35 | bool mIPCOpen; |
michael@0 | 36 | }; |
michael@0 | 37 | |
michael@0 | 38 | class TCPSocketChild : public mozilla::net::PTCPSocketChild |
michael@0 | 39 | , public TCPSocketChildBase |
michael@0 | 40 | { |
michael@0 | 41 | public: |
michael@0 | 42 | NS_DECL_NSITCPSOCKETCHILD |
michael@0 | 43 | NS_IMETHOD_(MozExternalRefCountType) Release() MOZ_OVERRIDE; |
michael@0 | 44 | |
michael@0 | 45 | TCPSocketChild(); |
michael@0 | 46 | ~TCPSocketChild(); |
michael@0 | 47 | |
michael@0 | 48 | virtual bool RecvCallback(const nsString& aType, |
michael@0 | 49 | const CallbackData& aData, |
michael@0 | 50 | const nsString& aReadyState) MOZ_OVERRIDE; |
michael@0 | 51 | virtual bool RecvRequestDelete() MOZ_OVERRIDE; |
michael@0 | 52 | virtual bool RecvUpdateBufferedAmount(const uint32_t& aBufferred, |
michael@0 | 53 | const uint32_t& aTrackingNumber) MOZ_OVERRIDE; |
michael@0 | 54 | private: |
michael@0 | 55 | JSObject* mWindowObj; |
michael@0 | 56 | }; |
michael@0 | 57 | |
michael@0 | 58 | } // namespace dom |
michael@0 | 59 | } // namespace mozilla |
michael@0 | 60 | |
michael@0 | 61 | #endif |