Wed, 31 Dec 2014 06:55:46 +0100
Added tag TORBROWSER_REPLICA for changeset 6474c204b198
michael@0 | 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* vim: set sw=2 ts=8 et tw=80 : */ |
michael@0 | 3 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #ifndef mozilla_net_DNSRequestChild_h |
michael@0 | 8 | #define mozilla_net_DNSRequestChild_h |
michael@0 | 9 | |
michael@0 | 10 | #include "mozilla/net/PDNSRequestChild.h" |
michael@0 | 11 | #include "nsICancelable.h" |
michael@0 | 12 | #include "nsIDNSRecord.h" |
michael@0 | 13 | #include "nsIDNSListener.h" |
michael@0 | 14 | #include "nsIEventTarget.h" |
michael@0 | 15 | |
michael@0 | 16 | namespace mozilla { |
michael@0 | 17 | namespace net { |
michael@0 | 18 | |
michael@0 | 19 | class DNSRequestChild |
michael@0 | 20 | : public PDNSRequestChild |
michael@0 | 21 | , public nsICancelable |
michael@0 | 22 | { |
michael@0 | 23 | public: |
michael@0 | 24 | NS_DECL_THREADSAFE_ISUPPORTS |
michael@0 | 25 | NS_DECL_NSICANCELABLE |
michael@0 | 26 | |
michael@0 | 27 | DNSRequestChild(const nsCString& aHost, const uint32_t& aFlags, |
michael@0 | 28 | nsIDNSListener *aListener, nsIEventTarget *target); |
michael@0 | 29 | virtual ~DNSRequestChild() {} |
michael@0 | 30 | |
michael@0 | 31 | void AddIPDLReference() { |
michael@0 | 32 | AddRef(); |
michael@0 | 33 | } |
michael@0 | 34 | void ReleaseIPDLReference() { |
michael@0 | 35 | // we don't need an 'mIPCOpen' variable until/unless we add calls that might |
michael@0 | 36 | // try to send IPDL msgs to parent after ReleaseIPDLReference is called |
michael@0 | 37 | // (when IPDL channel torn down). |
michael@0 | 38 | Release(); |
michael@0 | 39 | } |
michael@0 | 40 | |
michael@0 | 41 | // Sends IPDL request to parent |
michael@0 | 42 | void StartRequest(); |
michael@0 | 43 | void CallOnLookupComplete(); |
michael@0 | 44 | |
michael@0 | 45 | private: |
michael@0 | 46 | virtual bool Recv__delete__(const DNSRequestResponse& reply) MOZ_OVERRIDE; |
michael@0 | 47 | |
michael@0 | 48 | nsCOMPtr<nsIDNSListener> mListener; |
michael@0 | 49 | nsCOMPtr<nsIEventTarget> mTarget; |
michael@0 | 50 | nsCOMPtr<nsIDNSRecord> mResultRecord; |
michael@0 | 51 | nsresult mResultStatus; |
michael@0 | 52 | nsCString mHost; |
michael@0 | 53 | uint16_t mFlags; |
michael@0 | 54 | }; |
michael@0 | 55 | |
michael@0 | 56 | } // namespace net |
michael@0 | 57 | } // namespace mozilla |
michael@0 | 58 | #endif // mozilla_net_DNSRequestChild_h |