gecko-dev/uriloader
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
..
base Bug 1419597 - Part 18: Remove IsInnerWindow and IsOuterWindow methods, r=smaug 2017-11-23 13:12:13 -05:00
exthandler Bug 1278282 - update of the moz.build files to remove gtk2 references r=lsalzman 2018-01-10 10:04:59 +01:00
prefetch Bug 1412726: Clean up XPCOM singleton constructor refcount handling. r=froydnj 2017-10-29 16:02:40 -07:00
moz.build Bug 1345506 - add BUG_COMPONENT to uriloader/* files. r=paolo 2017-03-09 15:06:25 -05:00