gecko-dev/xpcom/components
Kris Maglione 257d9118dc Bug 1409249: Require singleton constructors to return explicit already_AddRefed. r=froydnj
Right now, NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR expects singleton
constructors to return already-addrefed raw pointers, and while it accepts
constructors that return already_AddRefed, most existing don't do so.

Meanwhile, the convention elsewhere is that a raw pointer return value is
owned by the callee, and that the caller needs to addref it if it wants to
keep its own reference to it.

The difference in convention makes it easy to leak (I've definitely caused
more than one shutdown leak this way), so it would be better if we required
the singleton getters to return an explicit already_AddRefed, which would
behave the same for all callers.


This also cleans up several singleton constructors that left a dangling
pointer to their singletons when their initialization methods failed, when
they released their references without clearing their global raw pointers.

MozReview-Commit-ID: 9peyG4pRYcr

--HG--
extra : rebase_source : 2f5bd89c17cb554541be38444672a827c1392f3f
2017-10-16 21:08:42 -07:00
..
GenericFactory.cpp Bug 1332631 part G - file moves from xpcom/glue to xpcom/components, and remove GenericModule which is no longer useful, r=froydnj 2017-01-20 14:41:10 -05:00
GenericFactory.h Bug 1332631 part G - file moves from xpcom/glue to xpcom/components, and remove GenericModule which is no longer useful, r=froydnj 2017-01-20 14:41:10 -05:00
ManifestParser.cpp Backed out changeset 05fc8d2d7ca9 (bug 863246) for failing various reftests, e.g. parser/htmlparser/tests/reftest/bug535530-2.html. r=backout on a CLOSED TREE 2017-08-25 16:44:40 +02:00
ManifestParser.h Bug 1060419 - make ManifestParser use Printf.h, r=froydnj 2016-12-15 20:13:08 -07:00
Module.h Update configs. IGNORE BROKEN CHANGESETS CLOSED TREE NO BUG a=release ba=release 2017-09-21 16:42:31 +02:00
ModuleLoader.h
ModuleUtils.h Bug 1409249: Require singleton constructors to return explicit already_AddRefed. r=froydnj 2017-10-16 21:08:42 -07:00
moz.build Bug 1351732 - Part 2: Replace use of PLArena with ArenaAllocator in xpcom. r=froydnj 2017-03-30 16:46:58 -07:00
nsCategoryCache.cpp Bug 1360971 - Part 1: Add the nsCategoryCache<T>::GetCachedEntries() API; r=froydnj 2017-05-08 10:31:13 -04:00
nsCategoryCache.h Bug 1360971 - Part 1: Add the nsCategoryCache<T>::GetCachedEntries() API; r=froydnj 2017-05-08 10:31:13 -04:00
nsCategoryManager.cpp Bug 1390428 (part 2, attempt 2) - Remove more nsXPIDLCString local variables. r=erahm. 2017-08-21 20:01:27 +10:00
nsCategoryManager.h Bug 1351732 - Part 2: Replace use of PLArena with ArenaAllocator in xpcom. r=froydnj 2017-03-30 16:46:58 -07:00
nsCategoryManagerUtils.h
nsComponentManager.cpp Bug 1313150 - Remove |weak| parameter from nsIMutableArray methods. r=froydnj 2017-10-21 23:53:02 +09:00
nsComponentManager.h Bug 1351732 - Part 2: Replace use of PLArena with ArenaAllocator in xpcom. r=froydnj 2017-03-30 16:46:58 -07:00
nsComponentManagerUtils.cpp Bug 1368994 - Remove !compMgr warning. r=froydnj 2017-07-26 14:00:10 -07:00
nsComponentManagerUtils.h Bug 1332631 part G - file moves from xpcom/glue to xpcom/components, and remove GenericModule which is no longer useful, r=froydnj 2017-01-20 14:41:10 -05:00
nsICategoryManager.idl
nsIClassInfo.idl Bug 1409598 - Change nsIXPCScriptable::className and nsIClassInfo::{contractID,classDescription} from string to AUTF8String. r=froydnj. 2017-10-18 13:17:26 +11:00
nsIComponentManager.idl
nsIComponentRegistrar.idl
nsIFactory.idl
nsIModule.idl
nsIServiceManager.idl Bug 1389848: Make isServiceInstantiated*() return false rather than throw for uninstantiated services. r=ehsan 2017-08-12 16:15:19 -07:00
nsServiceManagerUtils.h Bug 1332631 part G - file moves from xpcom/glue to xpcom/components, and remove GenericModule which is no longer useful, r=froydnj 2017-01-20 14:41:10 -05:00