DNSRequestParent.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef mozilla_net_DNSRequestParent_h
  6. #define mozilla_net_DNSRequestParent_h
  7. #include "mozilla/net/PDNSRequestParent.h"
  8. #include "nsIDNSService.h"
  9. #include "nsIDNSListener.h"
  10. namespace mozilla {
  11. namespace net {
  12. class DNSRequestParent
  13. : public PDNSRequestParent
  14. , public nsIDNSListener
  15. {
  16. public:
  17. NS_DECL_ISUPPORTS
  18. NS_DECL_NSIDNSLISTENER
  19. DNSRequestParent();
  20. void DoAsyncResolve(const nsACString &hostname, uint32_t flags,
  21. const nsACString &networkInterface);
  22. // Pass args here rather than storing them in the parent; they are only
  23. // needed if the request is to be canceled.
  24. bool RecvCancelDNSRequest(const nsCString& hostName,
  25. const uint32_t& flags,
  26. const nsCString& networkInterface,
  27. const nsresult& reason) override;
  28. bool Recv__delete__() override;
  29. protected:
  30. virtual void ActorDestroy(ActorDestroyReason why) override;
  31. private:
  32. virtual ~DNSRequestParent();
  33. uint32_t mFlags;
  34. bool mIPCClosed; // true if IPDL channel has been closed (child crash)
  35. };
  36. } // namespace net
  37. } // namespace mozilla
  38. #endif // mozilla_net_DNSRequestParent_h