gecko-dev/netwerk/dns
Kris Maglione a75561bd62 Bug 1412726: Clean up XPCOM singleton constructor refcount handling. r=froydnj
This is a follow-up to bug 1409249. There are a lot of places where our
factory singleton constructors either don't correctly handle their returned
references being released by the component manager, or do handle it, but in
ways that are not obvious.

This patch handles a few places where we can sometimes wind up with dangling
singleton pointers, adds some explanatory comments and sanity check
assertions, and replaces some uses of manual refcounting with StaticRefPtr and
ClearOnShutdown.

There are still some places where we may wind up with odd behavior if the
first QI for a getService call fails. In those cases, we wind up destroying
the first instance of a service that we create, and re-creating a new one
later.

MozReview-Commit-ID: ANYndvd7aZx

--HG--
extra : rebase_source : acfb0611a028fef6b9387eb5d1d9e285782fbc7c
2017-10-29 16:02:40 -07:00
..
mdns Bug 1394734 - Replace CONFIG['GNU_C*'] by CONFIG['CC_TYPE'] r=glandium 2017-12-07 22:09:15 +01:00
ChildDNSService.cpp Bug 1412726: Clean up XPCOM singleton constructor refcount handling. r=froydnj 2017-10-29 16:02:40 -07:00
ChildDNSService.h Bug 1409249: Require singleton constructors to return explicit already_AddRefed. r=froydnj 2017-10-16 21:08:42 -07:00
DNS.cpp Bug 1422173 - Backed out changeset 34cfc821e335 (Bug 1417827) r=me 2017-12-04 16:02:58 +01:00
DNS.h Bug 1422173 - Backed out changeset 34cfc821e335 (Bug 1417827) r=me 2017-12-04 16:02:58 +01:00
DNSListenerProxy.cpp
DNSListenerProxy.h Bug 1372453 - Part 2: Name the caller of ProxyReleaseEvent. r=billm 2017-06-14 09:27:17 +08:00
DNSRequestChild.cpp Bug 1378930 - Part 2: Remove the aName parameter from SchedulerGroup/DocGroup/DispatcherTrait. r=billm 2017-07-26 16:13:35 +08:00
DNSRequestChild.h Bug 1337893 - Part 2: Making the DNS cache be aware of originAttributes. r=valentin 2017-02-14 12:25:35 +08:00
DNSRequestParent.cpp Bug 1365101 - Convert NS_GetCurrentThread uses in netwerk/ (r=meyhemer) 2017-06-12 20:21:43 -07:00
DNSRequestParent.h Bug 1337893 - Part 2: Making the DNS cache be aware of originAttributes. r=valentin 2017-02-14 12:25:35 +08:00
GetAddrInfo.cpp Bug 1422173 - Backed out changeset 27719294cb73 (Bug 1420677) r=me 2017-12-04 16:02:59 +01:00
GetAddrInfo.h Bug 1422173 - Backed out changeset 27719294cb73 (Bug 1420677) r=me 2017-12-04 16:02:59 +01:00
PDNSParams.h
PDNSRequest.ipdl Bug 1337893 - Part 1: Updating idl and ipdl files of DNS to make them originAttributes aware. r=valentin 2017-02-15 11:53:37 +08:00
PDNSRequestParams.ipdlh
effective_tld_names.dat Bug 1415870 - Update psl list and related tests. r=gerv 2017-11-15 12:35:07 +00:00
moz.build Bug 1394734 - Replace CONFIG['GNU_C*'] by CONFIG['CC_TYPE'] r=glandium 2017-12-07 22:09:15 +01:00
nsDNSService2.cpp Bug 1412726: Clean up XPCOM singleton constructor refcount handling. r=froydnj 2017-10-29 16:02:40 -07:00
nsDNSService2.h Bug 1409249: Require singleton constructors to return explicit already_AddRefed. r=froydnj 2017-10-16 21:08:42 -07:00
nsEffectiveTLDService.cpp Bug 1396958 - Make eTLD cache thread-safe. r=valentin 2017-09-05 12:26:51 -07:00
nsEffectiveTLDService.h Bug 1380154 - Part 3: Cache most recently used eTLD entries. r=njn, r=jduell 2017-08-08 12:21:10 -07:00
nsHostResolver.cpp Bug 1427373 - Convert nsHostResolver.mDB from PLDHashTable to nsRefPtrHashtable r=mayhemer 2018-01-07 23:22:01 +01:00
nsHostResolver.h Bug 1427373 - Convert nsHostResolver.mDB from PLDHashTable to nsRefPtrHashtable r=mayhemer 2018-01-07 23:22:01 +01:00
nsIDNKitInterface.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
nsIDNSListener.idl
nsIDNSRecord.idl
nsIDNSService.idl Bug 1398646: Forbid sync DNS resolution on the main thread. r=valentin 2017-09-10 19:13:42 -07:00
nsIDNService.cpp Bug 1414096 (attempt 2) - Remove support for nsISupportsString values in nsPrefBranch::{get,set}ComplexValue(). r=florian. 2017-11-10 09:07:48 +11:00
nsIDNService.h Bug 1402048 - Remove the legacy non-IDNA2008 code path from nsIDNService, now that we always require ICU to build. r=valentin 2017-09-22 19:25:50 +01:00
nsIEffectiveTLDService.idl
nsIIDNService.idl
nsPIDNSService.idl
prepare_tlds.py Bug 1380154 - Part 2: Generate a DAFSA and use it for eTLDs. r=jduell 2017-07-17 16:10:18 -07:00
punycode.c
punycode.h