DNSServiceBase.h (1073B)
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/. */ 6 7 #ifndef mozilla_net_DNSServiceBase_h 8 #define mozilla_net_DNSServiceBase_h 9 10 #include "mozilla/Atomics.h" 11 #include "nsIObserver.h" 12 #include "nsString.h" 13 14 class nsIPrefBranch; 15 16 namespace mozilla::net { 17 18 class DNSServiceBase : public nsIObserver { 19 public: 20 NS_DECL_THREADSAFE_ISUPPORTS 21 22 DNSServiceBase() = default; 23 24 protected: 25 virtual ~DNSServiceBase() = default; 26 void AddPrefObserver(nsIPrefBranch* aPrefs); 27 virtual void ReadPrefs(const char* aName); 28 bool DNSForbiddenByActiveProxy(const nsACString& aHostname, uint32_t aFlags); 29 30 mozilla::Atomic<bool, mozilla::Relaxed> mDisablePrefetch{false}; 31 32 mozilla::Atomic<uint32_t, mozilla::Relaxed> mSocksProxyVersion{0}; 33 }; 34 35 } // namespace mozilla::net 36 37 #endif // mozilla_net_DNSServiceBase_h