author arthur.iakab <>
Tue, 03 Apr 2018 18:30:58 +0300
changeset 411462 5ec55f7a95f94cf39d57cdf36abecab914ea48eb
parent 406956 b87c9f3e9d5d314b553cd411a1554fa7cd11528f
child 419175 610da3d903bec2983d0e56d051d7d915a6bb86bb
permissions -rw-r--r--
Backed out changeset 3ff8ce674396 (bug 1447460) on request of tomprince a=backout

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et tw=80 : */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at */

#ifndef mozilla_net_DNSRequestChild_h
#define mozilla_net_DNSRequestChild_h

#include "mozilla/net/PDNSRequestChild.h"
#include "nsICancelable.h"
#include "nsIDNSRecord.h"
#include "nsIDNSListener.h"
#include "nsIEventTarget.h"

namespace mozilla {
namespace net {

class DNSRequestChild final
  : public PDNSRequestChild
  , public nsICancelable

  DNSRequestChild(const nsACString& aHost,
                  const OriginAttributes& aOriginAttributes,
                  const uint32_t& aFlags,
                  const nsACString& aNetworkInterface,
                  nsIDNSListener *aListener, nsIEventTarget *target);

  void AddIPDLReference() {
  void ReleaseIPDLReference();

  // Sends IPDL request to parent
  void StartRequest();
  void CallOnLookupComplete();

  friend class CancelDNSRequestEvent;
  friend class ChildDNSService;
  virtual ~DNSRequestChild() {}

  virtual mozilla::ipc::IPCResult RecvLookupCompleted(const DNSRequestResponse& reply) override;
  virtual void ActorDestroy(ActorDestroyReason why) override;

  nsCOMPtr<nsIDNSListener>  mListener;
  nsCOMPtr<nsIEventTarget>  mTarget;
  nsCOMPtr<nsIDNSRecord>    mResultRecord;
  nsresult                  mResultStatus;
  nsCString                 mHost;
  const OriginAttributes    mOriginAttributes;
  uint16_t                  mFlags;
  nsCString                 mNetworkInterface;
  bool                      mIPCOpen;

} // namespace net
} // namespace mozilla

#endif // mozilla_net_DNSRequestChild_h