netwerk/dns/nsDNSService2.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/dns/nsDNSService2.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,67 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* vim: set sw=4 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 nsDNSService2_h__
    1.11 +#define nsDNSService2_h__
    1.12 +
    1.13 +#include "nsPIDNSService.h"
    1.14 +#include "nsIIDNService.h"
    1.15 +#include "nsIMemoryReporter.h"
    1.16 +#include "nsIObserver.h"
    1.17 +#include "nsHostResolver.h"
    1.18 +#include "nsAutoPtr.h"
    1.19 +#include "nsString.h"
    1.20 +#include "nsTHashtable.h"
    1.21 +#include "nsHashKeys.h"
    1.22 +#include "nsIObserverService.h"
    1.23 +#include "nsProxyRelease.h"
    1.24 +#include "mozilla/Mutex.h"
    1.25 +#include "mozilla/Attributes.h"
    1.26 +
    1.27 +class nsDNSService MOZ_FINAL : public nsPIDNSService
    1.28 +                             , public nsIObserver
    1.29 +                             , public nsIMemoryReporter
    1.30 +{
    1.31 +public:
    1.32 +    NS_DECL_THREADSAFE_ISUPPORTS
    1.33 +    NS_DECL_NSPIDNSSERVICE
    1.34 +    NS_DECL_NSIDNSSERVICE
    1.35 +    NS_DECL_NSIOBSERVER
    1.36 +    NS_DECL_NSIMEMORYREPORTER
    1.37 +
    1.38 +    nsDNSService();
    1.39 +    ~nsDNSService();
    1.40 +
    1.41 +    static nsIDNSService* GetXPCOMSingleton();
    1.42 +
    1.43 +    size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
    1.44 +
    1.45 +private:
    1.46 +    static nsDNSService* GetSingleton();
    1.47 +
    1.48 +    uint16_t GetAFForLookup(const nsACString &host, uint32_t flags);
    1.49 +
    1.50 +    nsRefPtr<nsHostResolver>  mResolver;
    1.51 +    nsCOMPtr<nsIIDNService>   mIDN;
    1.52 +
    1.53 +    // mLock protects access to mResolver and mIPv4OnlyDomains
    1.54 +    mozilla::Mutex            mLock;
    1.55 +
    1.56 +    // mIPv4OnlyDomains is a comma-separated list of domains for which only
    1.57 +    // IPv4 DNS lookups are performed. This allows the user to disable IPv6 on
    1.58 +    // a per-domain basis and work around broken DNS servers. See bug 68796.
    1.59 +    nsAdoptingCString                         mIPv4OnlyDomains;
    1.60 +    bool                                      mDisableIPv6;
    1.61 +    bool                                      mDisablePrefetch;
    1.62 +    bool                                      mFirstTime;
    1.63 +    bool                                      mDisableDNS;
    1.64 +    bool                                      mOffline;
    1.65 +    bool                                      mNotifyResolution;
    1.66 +    nsMainThreadPtrHandle<nsIObserverService> mObserverService;
    1.67 +    nsTHashtable<nsCStringHashKey>            mLocalDomains;
    1.68 +};
    1.69 +
    1.70 +#endif //nsDNSService2_h__

mercurial