Read-only Git mirror of the Mercurial gecko repositories at https://hg.mozilla.org. How to contribute: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
Go to file
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
.cargo bug 1401647 - Fix spidermonkey mozjs / rust-bindings builds. r=nalexander 2018-01-03 14:51:52 -05:00
.vscode Bug 1423565 - Update tasks.json as per documentation. r=rillian 2017-12-06 14:59:35 +01:00
accessible Merge inbound to mozilla-central r=merge a=merge 2018-01-11 23:54:07 +02:00
browser Bug 1430175 - Update pdf.js to version 2.0.258. r=bdahl 2018-01-12 13:07:50 -05:00
build Merge m-c to inbound. a=merge 2018-01-12 11:35:56 -05:00
caps Bug 1424474 part 1. Make sure we don't call into the chrome registry's AllowContentToAccess with non-chrome URLs. r=gijs 2017-12-21 10:54:43 -05:00
chrome Bug 1426501 - Change JS code to use nsIURIMutator instead of the nsIURI.spec setter r=mayhemer 2018-01-08 15:20:29 +01:00
config Bug 1429830 - Enable TFO is a cross-compiler is used.r=nwgh 2018-01-11 23:17:44 +01:00
db Bug 1394734 - Replace CONFIG['GNU_C*'] by CONFIG['CC_TYPE'] r=glandium 2017-12-07 22:09:15 +01:00
devtools Merge inbound to mozilla-central r=merge a=merge 2018-01-11 23:54:07 +02:00
docshell Merge inbound to mozilla-central r=merge a=merge 2018-01-11 11:54:56 +02:00
dom Bug 1412726: Clean up XPCOM singleton constructor refcount handling. r=froydnj 2017-10-29 16:02:40 -07:00
editor Bug 1425652 - mosueDown, mouseUp and mouseMove should be removed from nsIHTMLObjectResizer. r=masayuki 2018-01-10 12:47:16 +09:00
embedding
extensions Bug 1412726: Clean up XPCOM singleton constructor refcount handling. r=froydnj 2017-10-29 16:02:40 -07:00
gfx Bug 1405824 - Adjust the default resource update alloc chunk size. r=jrmuizel 2018-01-12 15:11:41 +01:00
gradle/wrapper Bug 1366644 - Part 3a: Update Android build-tools (25.0.3), Gradle (3.4.1), Android-Gradle (2.3.3). r=maliu 2017-10-16 15:09:15 -07:00
hal Bug 1412048 - Replace NS_RUNTIMEABORT("...") with MOZ_CRASH("..."). r=froydnj 2017-10-24 23:30:31 -07:00
image Merge inbound to mozilla-central r=merge a=merge 2018-01-11 11:54:56 +02:00
intl Bug 1428771 - Make UCS2_CHAR_IS_BIDI check for lead surrogates corresponding to U+1E800...U+1EFFF and rename to UTF16_CODE_UNIT_IS_BIDI. r=jfkthame 2018-01-08 16:18:32 +02:00
ipc Backed out 11 changesets (bug 1382251) for failing mochitest at /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/RefPtr.h:318 r=backout a=backout on a CLOSED TREE 2018-01-11 17:20:36 +02:00
js Bug 1412726: Clean up XPCOM singleton constructor refcount handling. r=froydnj 2017-10-29 16:02:40 -07:00
layout Bug 1412726: Clean up XPCOM singleton constructor refcount handling. r=froydnj 2017-10-29 16:02:40 -07:00
media Backed out 6 changesets (bug 1393119, bug 1429819) so it can re-land after the Gecko 60 version bump instead. 2018-01-12 11:33:12 -05:00
memory Bug 1417504 - Also wrap Heap{Alloc,ReAlloc,Free} when building without our allocator. r=njn 2017-12-19 14:46:23 +09:00
mfbt Bug 1428541 - Make char16ptr_t::operator bool() explicit. r=froydnj 2017-12-24 23:33:56 +09:00
mobile Merge inbound to mozilla-central r=merge a=merge 2018-01-12 13:25:57 +02:00
modules Bug 1412726: Clean up XPCOM singleton constructor refcount handling. r=froydnj 2017-10-29 16:02:40 -07:00
mozglue Bug 1423999: Improved UIA detection that eliminates handle duplication; r=Jamie 2017-12-07 12:13:14 -07:00
netwerk Bug 1412726: Clean up XPCOM singleton constructor refcount handling. r=froydnj 2017-10-29 16:02:40 -07:00
nsprpub Bug 1420407, Land NSPR 4.18 into FF 59, NSPR_4_18_BETA5, r=me 2017-12-21 14:58:24 +01:00
other-licenses Backed out 5 changesets (bug 1418425) for Windows updater bustages and xpshell failures on toolkit/mozapps/update/tests/unit_base_updater/marSuccessPartial.js r=backout on a CLOSED TREE 2017-12-12 17:48:45 +02:00
parser Bug 1361369 - Allow async attribute on inline module scripts r=smaug 2018-01-08 15:17:34 +00:00
python Bug 1428938 - Remove legacy toolbar customization code. r=Gijs 2018-01-11 16:35:17 +00:00
rdf Bug 1421992 - script-generated patch to replace do_check_* functions with their Assert.* equivalents, rs=Gijs. 2017-12-21 11:08:17 +01:00
security No bug, Automated HPKP preload list update from host bld-linux64-spot-326 - a=hpkp-update 2018-01-11 11:24:52 -08:00
services Bug 1429245 - Optimize CommonUtils.bytesAsHex. r=tcsc 2018-01-10 16:11:22 -05:00
servo servo: Merge #19744 - style: A few trivial changes in preparation for document state invalidation (from emilio:doc-invalidation-preparation); r=upsuper 2018-01-11 07:50:55 -06:00
startupcache Bug 1408017 - Clear gStartupCacheWrapper in the dtor. r=froydnj 2017-10-26 16:47:27 -04:00
storage Bug 1412726: Clean up XPCOM singleton constructor refcount handling. r=froydnj 2017-10-29 16:02:40 -07:00
taskcluster Bug 1430087 - Build sccache with system GCC/binutils. r=nfroyd 2018-01-13 05:57:57 +09:00
testing Bug 1430176 - Do not try to force-stop native android processes like xpcshell; r=jmaher 2018-01-12 14:08:31 -07:00
third_party Merge mozilla-central to inbound. r=merge a=merge on a CLOSED TREE 2018-01-10 02:02:13 +02:00
toolkit Bug 1412726: Clean up XPCOM singleton constructor refcount handling. r=froydnj 2017-10-29 16:02:40 -07:00
tools Bug 1429898: Add active extension details to profiler metadata. r=mstange 2018-01-11 12:38:31 -08:00
uriloader Bug 1412726: Clean up XPCOM singleton constructor refcount handling. r=froydnj 2017-10-29 16:02:40 -07:00
view Bug 1278282 - Replace #if (MOZ_WIDGET_GTK == 3) by #ifdef MOZ_WIDGET_GTK r=lsalzman 2018-01-09 11:51:07 +01:00
widget Merge inbound to mozilla-central r=merge a=merge 2018-01-12 13:25:57 +02:00
xpcom Merge inbound to mozilla-central r=merge a=merge 2018-01-11 23:54:07 +02:00
xpfe Bug 1427512 - Part 29: Remove nsIDOMCSSDeclaration. r=xidorn,jryans,bz 2018-01-11 16:17:57 +08:00
.arcconfig Bug 1424950: Add missing repository.callsign to .arcconfig. r=dkl 2017-12-13 15:38:18 +01:00
.clang-format Bug 1414764 - Remove Mozilla specific options to avoid build warnings with gcc and -Wcomment enabled. r=sylvestre 2017-11-06 11:47:40 +02:00
.clang-format-ignore Backed out changeset 31f259ee387b (bug 1411004) for failing flake8 at tools/mach_commands.py:307:14 | indentation is not a multiple of four. r=backout 2017-10-31 16:20:11 +01:00
.cron.yml Bug 1418188 - Run Searchfox indexing in TaskCluster on a daily basis (r=dustin,chmanchester) 2017-11-23 07:25:12 -08:00
.eslintignore Bug 1426205 - ES module usage in exported tests cause eslint errors. r=k88hudson 2017-12-19 10:57:22 -08:00
.eslintrc.js Bug 1429705 - Enable ESLint rule mozilla/use-services for tools/profiler. r=mstange 2018-01-10 19:16:17 +00:00
.flake8
.gdbinit Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro. 2017-10-03 09:05:19 +11:00
.gdbinit_python
.gitignore Bug 1419836 - ID .gitignore entry ignores "id" locale (for mac). r=standard8 2017-11-22 10:30:55 -08:00
.hgignore Bug 1415168 - Fix 404 error when running talos speedometer locally; r=igoldan 2017-11-28 15:35:44 -05:00
.hgtags No bug - Tagging mozilla-central 1f91961bb79ad06fd4caef9e5dfd546afd5bf42c with FIREFOX_NIGHTLY_58_END. a=release DONTBUILD CLOSED TREE 2017-11-12 21:12:59 -05:00
.inferconfig
.lldbinit Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro. 2017-10-03 09:05:19 +11:00
.taskcluster.yml bug 1328719 - add task.extra.tasks_for to help rebuild the decision task. r=dustin 2018-01-03 16:16:41 -08:00
.yamllint
.ycm_extra_conf.py
aclocal.m4
AUTHORS
build.gradle (bug 1411688) Make --with-gradle handle single-locale repack r=snorp a=reland 2017-11-06 15:23:47 +02:00
client.mk Bug 1417264 - Write .mozconfig.json from Python; r=nalexander 2017-11-13 17:45:03 -08:00
client.py Bug 1399100 - fix client.py follow-up, r=kaie 2017-09-20 09:13:14 +02:00
CLOBBER Bug 1416465 - Expand pattern when track file is created rather than read. r=mshal 2017-12-02 16:51:19 +09:00
configure.in
configure.py Bug 1412460 - Don't write make variables in configure.d; r=mshal 2017-11-01 15:02:11 -07:00
GNUmakefile
gradle.properties Bug 1366644 - Pre: Bump Gradle JVM heap to allow in-process dex. r=maliu 2017-07-18 17:59:57 -07:00
gradlew
LEGAL
LICENSE
mach
Makefile.in Bug 1424651: Remove unused SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE mozconfig variable; r=ted.mielczarek 2017-12-10 23:05:05 -07:00
moz.build Bug 1403322: Switch jsreftests, jittests, test-verify to SCHEDULES; r=ahal 2017-12-20 00:39:21 +00:00
moz.configure Bug 1425035 - move --enable-ui-locale to moz.configure; r=gps 2017-12-18 14:21:26 -08:00
mozilla-config.h.in Bug 1426898 - Stop including Char16.h everywhere. r=Waldo 2017-12-23 00:53:12 +09:00
npm-shrinkwrap.json Bug 1371293 - Upgrade ESLint to version 4.8.0, configuration changes. r=mossop 2017-10-09 10:54:16 +01:00
old-configure.in Bug 1425381 - Always enable PIE on Android now that we support only >= 4.1. r=froydnj 2018-01-11 10:42:15 +09:00
package.json Bug 1371293 - Upgrade ESLint to version 4.8.0, configuration changes. r=mossop 2017-10-09 10:54:16 +01:00
README.txt
settings.gradle Bug 1360587 - Part 2. Remove bouncer apk build config; source; docs, r=nalexander 2017-10-25 22:51:44 +08:00
test.mozbuild

An explanation of the Mozilla Source Code Directory Structure and links to
project pages with documentation can be found at:

    https://developer.mozilla.org/en/Mozilla_Source_Code_Directory_Structure

For information on how to build Mozilla from the source code, see:

    https://developer.mozilla.org/en/docs/Build_Documentation

To have your bug fix / feature added to Mozilla, you should create a patch and
submit it to Bugzilla (https://bugzilla.mozilla.org). Instructions are at:

    https://developer.mozilla.org/en/docs/Creating_a_patch
    https://developer.mozilla.org/en/docs/Getting_your_patch_in_the_tree

If you have a question about developing Mozilla, and can't find the solution
on https://developer.mozilla.org, you can try asking your question in a
mozilla.* Usenet group, or on IRC at irc.mozilla.org. [The Mozilla news groups
are accessible on Google Groups, or news.mozilla.org with a NNTP reader.]

You can download nightly development builds from the Mozilla FTP server.
Keep in mind that nightly builds, which are used by Mozilla developers for
testing, may be buggy. Firefox nightlies, for example, can be found at:

    https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/
            - or -
    https://nightly.mozilla.org/