michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set sw=2 ts=8 et tw=80 : */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_net_DNSRequestChild_h michael@0: #define mozilla_net_DNSRequestChild_h michael@0: michael@0: #include "mozilla/net/PDNSRequestChild.h" michael@0: #include "nsICancelable.h" michael@0: #include "nsIDNSRecord.h" michael@0: #include "nsIDNSListener.h" michael@0: #include "nsIEventTarget.h" michael@0: michael@0: namespace mozilla { michael@0: namespace net { michael@0: michael@0: class DNSRequestChild michael@0: : public PDNSRequestChild michael@0: , public nsICancelable michael@0: { michael@0: public: michael@0: NS_DECL_THREADSAFE_ISUPPORTS michael@0: NS_DECL_NSICANCELABLE michael@0: michael@0: DNSRequestChild(const nsCString& aHost, const uint32_t& aFlags, michael@0: nsIDNSListener *aListener, nsIEventTarget *target); michael@0: virtual ~DNSRequestChild() {} michael@0: michael@0: void AddIPDLReference() { michael@0: AddRef(); michael@0: } michael@0: void ReleaseIPDLReference() { michael@0: // we don't need an 'mIPCOpen' variable until/unless we add calls that might michael@0: // try to send IPDL msgs to parent after ReleaseIPDLReference is called michael@0: // (when IPDL channel torn down). michael@0: Release(); michael@0: } michael@0: michael@0: // Sends IPDL request to parent michael@0: void StartRequest(); michael@0: void CallOnLookupComplete(); michael@0: michael@0: private: michael@0: virtual bool Recv__delete__(const DNSRequestResponse& reply) MOZ_OVERRIDE; michael@0: michael@0: nsCOMPtr mListener; michael@0: nsCOMPtr mTarget; michael@0: nsCOMPtr mResultRecord; michael@0: nsresult mResultStatus; michael@0: nsCString mHost; michael@0: uint16_t mFlags; michael@0: }; michael@0: michael@0: } // namespace net michael@0: } // namespace mozilla michael@0: #endif // mozilla_net_DNSRequestChild_h