2013-12-11 11:03:51 -08:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* vim: set sw=4 ts=8 et tw=80 : */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-08-28 17:24:06 -07:00
|
|
|
#ifndef nsDNSService2_h__
|
|
|
|
#define nsDNSService2_h__
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsPIDNSService.h"
|
|
|
|
#include "nsIIDNService.h"
|
2013-11-06 21:35:30 -08:00
|
|
|
#include "nsIMemoryReporter.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsIObserver.h"
|
|
|
|
#include "nsHostResolver.h"
|
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
#include "nsString.h"
|
2012-05-11 12:59:19 -07:00
|
|
|
#include "nsTHashtable.h"
|
|
|
|
#include "nsHashKeys.h"
|
2014-04-15 13:13:00 -07:00
|
|
|
#include "nsIObserverService.h"
|
|
|
|
#include "nsProxyRelease.h"
|
Rollup of bug 645263 and bug 646259: Switch to mozilla:: sync primitives. r=cjones,dbaron,doublec,ehsan src=bsmedberg
Bug 645263, part 0: Count sync primitive ctor/dtors. r=dbaron
Bug 645263, part 1: Migrate content/media to mozilla:: sync primitives. r=doublec
Bug 645263, part 2: Migrate modules/plugin to mozilla:: sync primitives. sr=bsmedberg
Bug 645263, part 3: Migrate nsComponentManagerImpl to mozilla:: sync primitives. sr=bsmedberg
Bug 645263, part 4: Migrate everything else to mozilla:: sync primitives. r=dbaron
Bug 645263, part 5: Remove nsAutoLock.*. sr=bsmedberg
Bug 645263, part 6: Make editor test be nicer to deadlock detector. r=ehsan
Bug 645263, part 7: Disable tracemalloc backtraces for xpcshell tests. r=dbaron
Bug 646259: Fix nsCacheService to use a CondVar for notifying. r=cjones
2011-03-31 21:29:02 -07:00
|
|
|
#include "mozilla/Mutex.h"
|
2012-06-05 20:18:25 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-12-07 22:09:10 -08:00
|
|
|
class nsDNSService MOZ_FINAL : public nsPIDNSService
|
2012-06-05 20:18:25 -07:00
|
|
|
, public nsIObserver
|
2013-12-07 22:09:10 -08:00
|
|
|
, public nsIMemoryReporter
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
2013-07-18 19:24:13 -07:00
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_DECL_NSPIDNSSERVICE
|
|
|
|
NS_DECL_NSIDNSSERVICE
|
|
|
|
NS_DECL_NSIOBSERVER
|
2013-12-07 22:09:10 -08:00
|
|
|
NS_DECL_NSIMEMORYREPORTER
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
nsDNSService();
|
|
|
|
~nsDNSService();
|
|
|
|
|
2013-12-11 11:03:51 -08:00
|
|
|
static nsIDNSService* GetXPCOMSingleton();
|
|
|
|
|
2013-11-24 15:24:12 -08:00
|
|
|
size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
private:
|
2013-12-11 11:03:51 -08:00
|
|
|
static nsDNSService* GetSingleton();
|
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
uint16_t GetAFForLookup(const nsACString &host, uint32_t flags);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
nsRefPtr<nsHostResolver> mResolver;
|
|
|
|
nsCOMPtr<nsIIDNService> mIDN;
|
|
|
|
|
|
|
|
// mLock protects access to mResolver and mIPv4OnlyDomains
|
Rollup of bug 645263 and bug 646259: Switch to mozilla:: sync primitives. r=cjones,dbaron,doublec,ehsan src=bsmedberg
Bug 645263, part 0: Count sync primitive ctor/dtors. r=dbaron
Bug 645263, part 1: Migrate content/media to mozilla:: sync primitives. r=doublec
Bug 645263, part 2: Migrate modules/plugin to mozilla:: sync primitives. sr=bsmedberg
Bug 645263, part 3: Migrate nsComponentManagerImpl to mozilla:: sync primitives. sr=bsmedberg
Bug 645263, part 4: Migrate everything else to mozilla:: sync primitives. r=dbaron
Bug 645263, part 5: Remove nsAutoLock.*. sr=bsmedberg
Bug 645263, part 6: Make editor test be nicer to deadlock detector. r=ehsan
Bug 645263, part 7: Disable tracemalloc backtraces for xpcshell tests. r=dbaron
Bug 646259: Fix nsCacheService to use a CondVar for notifying. r=cjones
2011-03-31 21:29:02 -07:00
|
|
|
mozilla::Mutex mLock;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// mIPv4OnlyDomains is a comma-separated list of domains for which only
|
|
|
|
// IPv4 DNS lookups are performed. This allows the user to disable IPv6 on
|
|
|
|
// a per-domain basis and work around broken DNS servers. See bug 68796.
|
2014-04-15 13:13:00 -07:00
|
|
|
nsAdoptingCString mIPv4OnlyDomains;
|
|
|
|
bool mDisableIPv6;
|
|
|
|
bool mDisablePrefetch;
|
|
|
|
bool mFirstTime;
|
|
|
|
bool mOffline;
|
|
|
|
bool mNotifyResolution;
|
|
|
|
nsMainThreadPtrHandle<nsIObserverService> mObserverService;
|
|
|
|
nsTHashtable<nsCStringHashKey> mLocalDomains;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
2012-08-28 17:24:06 -07:00
|
|
|
|
|
|
|
#endif //nsDNSService2_h__
|