gecko-dev/uriloader/prefetch
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
..
OfflineCacheUpdateChild.cpp Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm 2016-11-15 04:26:00 +01:00
OfflineCacheUpdateChild.h Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm 2016-11-15 04:26:00 +01:00
OfflineCacheUpdateGlue.cpp
OfflineCacheUpdateGlue.h
OfflineCacheUpdateParent.cpp Bug 1316683 - Part 5: Avoid going into SpiderMonkey for retrieving origin attributes; r=baku 2017-04-12 11:32:19 -04:00
OfflineCacheUpdateParent.h
POfflineCacheUpdate.ipdl
moz.build Bug 1345506 - add BUG_COMPONENT to uriloader/* files. r=paolo 2017-03-09 15:06:25 -05:00
nsCPrefetchService.h
nsIOfflineCacheUpdate.idl Bug 1355216 - Mark last parameters that are almost always falsy as optional, r=froydnj. 2017-04-12 00:07:30 +02:00
nsIPrefetchService.idl Bug 1222633 - Add rel=preload - nsPrefetchService part. r=smaug 2017-07-10 15:05:23 +02:00
nsOfflineCacheUpdate.cpp Bug 1313150 - Remove |weak| parameter from nsIMutableArray methods. r=froydnj 2017-10-21 23:53:02 +09:00
nsOfflineCacheUpdate.h Bug 1409249: Require singleton constructors to return explicit already_AddRefed. r=froydnj 2017-10-16 21:08:42 -07:00
nsOfflineCacheUpdateService.cpp Bug 1409249: Require singleton constructors to return explicit already_AddRefed. r=froydnj 2017-10-16 21:08:42 -07:00
nsPrefetchService.cpp Bug 1390428 (part 9) - Remove nsXPIDLCString. r=erahm. 2017-08-17 15:29:03 +10:00
nsPrefetchService.h Bug 1222633 - Add rel=preload - nsPrefetchService part. r=smaug 2017-07-10 15:05:23 +02:00