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 | #include "mozilla/net/PTCPServerSocketChild.h" |
michael@0 | 6 | #include "nsITCPServerSocketChild.h" |
michael@0 | 7 | #include "nsCycleCollectionParticipant.h" |
michael@0 | 8 | #include "nsCOMPtr.h" |
michael@0 | 9 | |
michael@0 | 10 | #define TCPSERVERSOCKETCHILD_CID \ |
michael@0 | 11 | { 0x41a77ec8, 0xfd86, 0x409e, { 0xae, 0xa9, 0xaf, 0x2c, 0xa4, 0x07, 0xef, 0x8e } } |
michael@0 | 12 | |
michael@0 | 13 | class nsITCPServerSocketInternal; |
michael@0 | 14 | |
michael@0 | 15 | namespace mozilla { |
michael@0 | 16 | namespace dom { |
michael@0 | 17 | |
michael@0 | 18 | class TCPServerSocketChildBase : public nsITCPServerSocketChild { |
michael@0 | 19 | public: |
michael@0 | 20 | NS_DECL_CYCLE_COLLECTION_CLASS(TCPServerSocketChildBase) |
michael@0 | 21 | NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
michael@0 | 22 | |
michael@0 | 23 | void AddIPDLReference(); |
michael@0 | 24 | void ReleaseIPDLReference(); |
michael@0 | 25 | |
michael@0 | 26 | protected: |
michael@0 | 27 | TCPServerSocketChildBase(); |
michael@0 | 28 | virtual ~TCPServerSocketChildBase(); |
michael@0 | 29 | |
michael@0 | 30 | nsCOMPtr<nsITCPServerSocketInternal> mServerSocket; |
michael@0 | 31 | bool mIPCOpen; |
michael@0 | 32 | }; |
michael@0 | 33 | |
michael@0 | 34 | class TCPServerSocketChild : public mozilla::net::PTCPServerSocketChild |
michael@0 | 35 | , public TCPServerSocketChildBase |
michael@0 | 36 | { |
michael@0 | 37 | public: |
michael@0 | 38 | NS_DECL_NSITCPSERVERSOCKETCHILD |
michael@0 | 39 | NS_IMETHOD_(MozExternalRefCountType) Release() MOZ_OVERRIDE; |
michael@0 | 40 | |
michael@0 | 41 | TCPServerSocketChild(); |
michael@0 | 42 | ~TCPServerSocketChild(); |
michael@0 | 43 | |
michael@0 | 44 | virtual bool RecvCallbackAccept(PTCPSocketChild *socket) MOZ_OVERRIDE; |
michael@0 | 45 | virtual bool RecvCallbackError(const nsString& aMessage, |
michael@0 | 46 | const nsString& aFilename, |
michael@0 | 47 | const uint32_t& aLineNumber, |
michael@0 | 48 | const uint32_t& aColumnNumber) MOZ_OVERRIDE; |
michael@0 | 49 | }; |
michael@0 | 50 | |
michael@0 | 51 | } // namespace dom |
michael@0 | 52 | } // namespace mozilla |