gecko-dev/netwerk
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 1409249: Require singleton constructors to return explicit already_AddRefed. r=froydnj 2017-10-16 21:08:42 -07:00
build Backed out changeset dab1c5badddb (bug 1407679) for failing server startup in mochitests on Android. r=backout on a CLOSED TREE 2017-10-24 21:18:26 +02:00
cache merge mozilla-central to autoland. r=merge a=merge 2017-10-24 23:59:14 +02:00
cache2 Bug 1411001 - Remove the +x permissions on cpp & h files r=froydnj 2017-10-23 20:59:55 +02:00
cookie Bug 870460 - Part 4: Make the lifecycle of cookie thread alongwith the profile. r=ngwh 2017-10-25 01:30:00 -04:00
dns Bug 1409249: Require singleton constructors to return explicit already_AddRefed. r=froydnj 2017-10-16 21:08:42 -07:00
ipc Bug 1384679 - Fix timing for TFO. r=mcmanus r=honza 2017-10-17 15:28:33 +02:00
locales
mime Bug 1390428 (part 1) - Remove many nsXPIDLCString local variables. r=erahm. 2017-08-16 13:58:35 +10:00
protocol Backed out changeset 84cb594525ad (bug 1400655) for eslint failure in devtools/client/jsonview/test/browser_jsonview_serviceworker.js. r=backout 2017-10-26 00:24:57 +02:00
sctp Backed out 2 changesets (bug 1400563) for Windows non-stylo mochitest-chrome leak 2017-10-25 07:53:23 -07:00
socket Bug 1411001 - Remove the +x permissions on cpp & h files r=froydnj 2017-10-23 20:59:55 +02:00
srtp
streamconv Bug 1410146 - Fix UnknownDecoder. r=mayhemer 2017-10-24 14:23:00 -04:00
system Bug 1411001 - Remove the +x permissions on cpp & h files r=froydnj 2017-10-23 20:59:55 +02:00
test Bug 675518 - Add crashtest. r=me 2017-10-25 14:58:33 -04:00
wifi Bug 1372453 - Part 2: Name the caller of ProxyReleaseEvent. r=billm 2017-06-14 09:27:17 +08:00
moz.build
necko-config.h.in Bug 1391467 - Remove --enable-necko-protocols. r=gps,valentin 2017-08-17 17:30:57 -07:00