michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* vim: set sw=4 ts=8 et tw=80 : */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsDNSService2_h__ michael@0: #define nsDNSService2_h__ michael@0: michael@0: #include "nsPIDNSService.h" michael@0: #include "nsIIDNService.h" michael@0: #include "nsIMemoryReporter.h" michael@0: #include "nsIObserver.h" michael@0: #include "nsHostResolver.h" michael@0: #include "nsAutoPtr.h" michael@0: #include "nsString.h" michael@0: #include "nsTHashtable.h" michael@0: #include "nsHashKeys.h" michael@0: #include "nsIObserverService.h" michael@0: #include "nsProxyRelease.h" michael@0: #include "mozilla/Mutex.h" michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: class nsDNSService MOZ_FINAL : public nsPIDNSService michael@0: , public nsIObserver michael@0: , public nsIMemoryReporter michael@0: { michael@0: public: michael@0: NS_DECL_THREADSAFE_ISUPPORTS michael@0: NS_DECL_NSPIDNSSERVICE michael@0: NS_DECL_NSIDNSSERVICE michael@0: NS_DECL_NSIOBSERVER michael@0: NS_DECL_NSIMEMORYREPORTER michael@0: michael@0: nsDNSService(); michael@0: ~nsDNSService(); michael@0: michael@0: static nsIDNSService* GetXPCOMSingleton(); michael@0: michael@0: size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const; michael@0: michael@0: private: michael@0: static nsDNSService* GetSingleton(); michael@0: michael@0: uint16_t GetAFForLookup(const nsACString &host, uint32_t flags); michael@0: michael@0: nsRefPtr mResolver; michael@0: nsCOMPtr mIDN; michael@0: michael@0: // mLock protects access to mResolver and mIPv4OnlyDomains michael@0: mozilla::Mutex mLock; michael@0: michael@0: // mIPv4OnlyDomains is a comma-separated list of domains for which only michael@0: // IPv4 DNS lookups are performed. This allows the user to disable IPv6 on michael@0: // a per-domain basis and work around broken DNS servers. See bug 68796. michael@0: nsAdoptingCString mIPv4OnlyDomains; michael@0: bool mDisableIPv6; michael@0: bool mDisablePrefetch; michael@0: bool mFirstTime; michael@0: bool mDisableDNS; michael@0: bool mOffline; michael@0: bool mNotifyResolution; michael@0: nsMainThreadPtrHandle mObserverService; michael@0: nsTHashtable mLocalDomains; michael@0: }; michael@0: michael@0: #endif //nsDNSService2_h__