netwerk/dns/DNSRequestChild.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial