netwerk/dns/DNSRequestChild.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/dns/DNSRequestChild.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,58 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim: set sw=2 ts=8 et tw=80 : */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef mozilla_net_DNSRequestChild_h
    1.11 +#define mozilla_net_DNSRequestChild_h
    1.12 +
    1.13 +#include "mozilla/net/PDNSRequestChild.h"
    1.14 +#include "nsICancelable.h"
    1.15 +#include "nsIDNSRecord.h"
    1.16 +#include "nsIDNSListener.h"
    1.17 +#include "nsIEventTarget.h"
    1.18 +
    1.19 +namespace mozilla {
    1.20 +namespace net {
    1.21 +
    1.22 +class DNSRequestChild
    1.23 +  : public PDNSRequestChild
    1.24 +  , public nsICancelable
    1.25 +{
    1.26 +public:
    1.27 +  NS_DECL_THREADSAFE_ISUPPORTS
    1.28 +  NS_DECL_NSICANCELABLE
    1.29 +
    1.30 +  DNSRequestChild(const nsCString& aHost, const uint32_t& aFlags,
    1.31 +                  nsIDNSListener *aListener, nsIEventTarget *target);
    1.32 +  virtual ~DNSRequestChild() {}
    1.33 +
    1.34 +  void AddIPDLReference() {
    1.35 +    AddRef();
    1.36 +  }
    1.37 +  void ReleaseIPDLReference() {
    1.38 +    // we don't need an 'mIPCOpen' variable until/unless we add calls that might
    1.39 +    // try to send IPDL msgs to parent after ReleaseIPDLReference is called
    1.40 +    // (when IPDL channel torn down).
    1.41 +    Release();
    1.42 +  }
    1.43 +
    1.44 +  // Sends IPDL request to parent
    1.45 +  void StartRequest();
    1.46 +  void CallOnLookupComplete();
    1.47 +
    1.48 +private:
    1.49 +  virtual bool Recv__delete__(const DNSRequestResponse& reply) MOZ_OVERRIDE;
    1.50 +
    1.51 +  nsCOMPtr<nsIDNSListener>  mListener;
    1.52 +  nsCOMPtr<nsIEventTarget>  mTarget;
    1.53 +  nsCOMPtr<nsIDNSRecord>    mResultRecord;
    1.54 +  nsresult                  mResultStatus;
    1.55 +  nsCString                 mHost;
    1.56 +  uint16_t                  mFlags;
    1.57 +};
    1.58 +
    1.59 +} // namespace net
    1.60 +} // namespace mozilla
    1.61 +#endif // mozilla_net_DNSRequestChild_h

mercurial