gecko-dev/toolkit
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
..
components Bug 1412726: Clean up XPCOM singleton constructor refcount handling. r=froydnj 2017-10-29 16:02:40 -07:00
content Bug 1428938 - Remove legacy toolbar customization code. r=Gijs 2018-01-11 16:35:17 +00:00
crashreporter Backed out changeset 6d539e4a02bd (bug 1403519) for lint failures on a CLOSED TREE 2018-01-11 22:32:27 +02:00
forgetaboutsite Bug 1421992 - Hand written cleanup patch to make tests pass after removing obsolete xpcshell functions. r=Gijs,ochameau a=Aryx 2017-12-21 11:11:57 +01:00
library Bug 1403844 - Verify COSE signature on add-ons, r=keeler 2018-01-08 11:46:51 +01:00
locales Bug 1284391 - Remove ui.allow_platform_file_picker pref on GTK widget. r=karlt 2018-01-11 13:10:28 +00:00
modules Backed out changeset 6d539e4a02bd (bug 1403519) for lint failures on a CLOSED TREE 2018-01-11 22:32:27 +02:00
mozapps Bug 1412726: Clean up XPCOM singleton constructor refcount handling. r=froydnj 2017-10-29 16:02:40 -07:00
pluginproblem Bug 1409148 - Add dynamic sizing on the plugin overlay. r=dthayer,johannh 2017-11-10 14:05:04 -02:00
profile Bug 1417940 - Change various instances of manually calling getService to use Services.jsm in toolkit/. r=mossop 2017-11-09 16:36:57 +00:00
system Bug 1297686 - List GIO handlers in the protocol handler list, in the handlers dialog, and in preferences. r=paolo 2017-12-29 07:27:42 +00:00
themes Bug 1284391 - Remove ui.allow_platform_file_picker pref on GTK widget. r=karlt 2018-01-11 13:10:28 +00:00
xre Bug 1278282 - Remove the 'MOZ_WIDGET_GTK == 2' defines r=karlt,lsalzman 2018-01-10 08:52:04 +01:00
.eslintrc.js Bug 1421968 - Enable ESLint rule mozilla/use-services by default, but whitelist it for various directories still to be fixed. r=mossop 2017-11-28 19:24:12 +00:00
moz.build Bug 1278282 - update of the moz.build files to remove gtk2 references r=lsalzman 2018-01-10 10:04:59 +01:00
moz.configure Bug 1278282 - update of the moz.build files to remove gtk2 references r=lsalzman 2018-01-10 10:04:59 +01:00
nss.configure
toolkit.mozbuild Bug 1378200 - Remove MOZ_PERMISSIONS define guards. r=mystor 2017-12-14 03:32:41 +05:30