gecko-dev/uriloader/prefetch
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
..
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 1394734 - Replace CONFIG['GNU_C*'] by CONFIG['CC_TYPE'] r=glandium 2017-12-07 22:09:15 +01: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 1412726: Clean up XPCOM singleton constructor refcount handling. r=froydnj 2017-10-29 16:02:40 -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