gecko-dev/modules
Daniel Holbert 20cc0e0a3f Bug 1826234: Fix GetObserverService error-handling check in Preferences::InitInitialObjects. r=xpcom-reviewers,emilio
In mozilla-central before this patch, we had a boilerplate
NS_ENSURE_SUCCESS(rv, rv) after our call to GetObserverService()

This expression *does not actually test whether GetObserverService() succeeded*
though, since GetObserverService doesn't touch rv!  When GetObserverService()
fails, it just returns nullptr.  So we should be testing it for success with a
null-check.

In fact, we did *used to* test for success with a null-check, but that was
replaced by this ineffective NS_ENSURE_SUCCESS by accident in Bug 1276488, as
part of a large patch that was geared at adding diagnostics.

So: let's just restore the null-check. It's unlikely to be tripped, since
GetObserverService only returns nullptr at xpcom shutdown time (and this code
runs at startup); but explicitly handling that by returning a failure code
seems to be the right thing to do.  And more importantly, the NS_ENSURE_SUCCESS
can be made to misfire if we happen to have a stray error code from some
earlier call remaining in 'rv'.

Differential Revision: https://phabricator.services.mozilla.com/D174544
2023-04-04 01:06:01 +00:00
..
brotli Bug 1821026 - Vendor brotli using `mach vendor` r=jfkthame 2023-03-08 17:13:24 +00:00
fdlibm Bug 1760633: Apply the fdlibm patches for the new files to the in-tree files r=arai 2023-01-06 20:12:33 +00:00
freetype2 Bug 1815879 - Update freetype2 to 2.13.0. r=jfkthame 2023-02-14 03:31:03 +00:00
libjar Bug 1818305: apply code formatting via Lando 2023-03-15 19:55:42 +00:00
libmar Bug 1824512 - Make modules/libmar/src buildable outside of a unified build environment r=andi 2023-03-30 13:48:32 +00:00
libpref Bug 1826234: Fix GetObserverService error-handling check in Preferences::InitInitialObjects. r=xpcom-reviewers,emilio 2023-04-04 01:06:01 +00:00
woff2 Bug 1821011 - Vendor woff2 using `mach vendor` r=jfkthame 2023-03-08 17:13:08 +00:00
xz-embedded
zlib Bug 1816737 - silence warning spam in (third-party) zlib code r=glandium 2023-02-17 01:29:01 +00:00
moz.build