netwerk/dns/nsDNSService2.h

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     2 /* vim: set sw=4 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 nsDNSService2_h__
     8 #define nsDNSService2_h__
    10 #include "nsPIDNSService.h"
    11 #include "nsIIDNService.h"
    12 #include "nsIMemoryReporter.h"
    13 #include "nsIObserver.h"
    14 #include "nsHostResolver.h"
    15 #include "nsAutoPtr.h"
    16 #include "nsString.h"
    17 #include "nsTHashtable.h"
    18 #include "nsHashKeys.h"
    19 #include "nsIObserverService.h"
    20 #include "nsProxyRelease.h"
    21 #include "mozilla/Mutex.h"
    22 #include "mozilla/Attributes.h"
    24 class nsDNSService MOZ_FINAL : public nsPIDNSService
    25                              , public nsIObserver
    26                              , public nsIMemoryReporter
    27 {
    28 public:
    29     NS_DECL_THREADSAFE_ISUPPORTS
    30     NS_DECL_NSPIDNSSERVICE
    31     NS_DECL_NSIDNSSERVICE
    32     NS_DECL_NSIOBSERVER
    33     NS_DECL_NSIMEMORYREPORTER
    35     nsDNSService();
    36     ~nsDNSService();
    38     static nsIDNSService* GetXPCOMSingleton();
    40     size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
    42 private:
    43     static nsDNSService* GetSingleton();
    45     uint16_t GetAFForLookup(const nsACString &host, uint32_t flags);
    47     nsRefPtr<nsHostResolver>  mResolver;
    48     nsCOMPtr<nsIIDNService>   mIDN;
    50     // mLock protects access to mResolver and mIPv4OnlyDomains
    51     mozilla::Mutex            mLock;
    53     // mIPv4OnlyDomains is a comma-separated list of domains for which only
    54     // IPv4 DNS lookups are performed. This allows the user to disable IPv6 on
    55     // a per-domain basis and work around broken DNS servers. See bug 68796.
    56     nsAdoptingCString                         mIPv4OnlyDomains;
    57     bool                                      mDisableIPv6;
    58     bool                                      mDisablePrefetch;
    59     bool                                      mFirstTime;
    60     bool                                      mDisableDNS;
    61     bool                                      mOffline;
    62     bool                                      mNotifyResolution;
    63     nsMainThreadPtrHandle<nsIObserverService> mObserverService;
    64     nsTHashtable<nsCStringHashKey>            mLocalDomains;
    65 };
    67 #endif //nsDNSService2_h__

mercurial