gecko-dev/xpcom
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
..
base Bug 1411001 - Remove the +x permissions on cpp & h files r=froydnj 2017-10-23 20:59:55 +02:00
build Bug 1411001 - Remove the +x permissions on cpp & h files r=froydnj 2017-10-23 20:59:55 +02:00
components Bug 1409249: Require singleton constructors to return explicit already_AddRefed. r=froydnj 2017-10-16 21:08:42 -07:00
doc
ds Bug 1411034 - Remove the const to fix the -Wignored-qualifiers warning r=erahm 2017-10-23 22:42:35 +02:00
glue Bug 1386876 - Replace all uses of DISABLE_STL_WRAPPING with a template, remove DISABLE_STL_WRAPPING. r=glandium 2017-09-11 11:33:26 -07:00
idl-parser Bug 338865 - Scriptable XPIDL iface inheriting from noscript iface should throw error. r=froydnj 2017-09-12 15:03:14 -07:00
io Bug 1411520 - nsMultiplexInputStream must use CancelableRunnable because it can be used in workers, r=bkelly 2017-10-25 20:18:58 +02:00
libxpt/xptcall Bug 1403959, part 2 - Automatically generated eslint fixes. r=froydnj 2017-09-28 15:49:04 -07:00
reflect Bug 1409227 (part 4) - Replace nsMemory::Clone(id, sizeof(nsID)) with nsID::Clone(id). r=mccr8. 2017-10-18 10:39:20 +11:00
rust Bug 1403213 - Move nsstring into servo/support/gecko/nsstring, r=froydnj 2017-10-23 15:37:25 -04:00
string Bug 1410276 - Add a canary field to nsStringBuffer. r=bz 2017-10-25 23:21:47 +11:00
system Bug 1406212 - Remove multiprocessBlockPolicy. r=Felipe 2017-10-12 11:16:46 -07:00
tests Bug 1313150 - Remove |weak| parameter from nsIMutableArray methods. r=froydnj 2017-10-21 23:53:02 +09:00
threads merge mozilla-inbound to mozilla-central. r=merge a=merge 2017-10-24 11:52:35 +02:00
typelib Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
windbgdlg
xpidl Bug 1390916 - Always use --track instead of --no-remove for install manifests; r=gps 2017-08-08 17:07:07 -04:00
moz.build Bug 1403213 - Move nsstring into servo/support/gecko/nsstring, r=froydnj 2017-10-23 15:37:25 -04:00
xpcom-config.h.in Bug 1326145 - Remove HAVE_CPP_AMBIGUITY_RESOLVING_USING. r=froydnj 2016-12-29 18:05:20 +11:00
xpcom-private.h.in