gecko-dev/modules/libpref/test
Nicholas Nethercote 7974362afd Bug 1567329 - Append _AtStartup to once static pref getters. r=erahm
Currently it's completely unclear at use sites that the getters for `once`
static prefs return the pref value from startup, rather than the current pref
value. (Bugs have been caused by this.) This commit improves things by changing
the getter name to make it clear that the pref value obtained is from startup.

This required changing things within libpref so it distinguishes between the
"base id" (`foo_bar`) and the "full id" (`foo_bar` or
`foo_bar_DoNotUseDirectly` or `foo_bar_AtStartup` or
`foo_bar_AtStartup_DoNotUseDirectly`; the name used depends on the `mirror` and
`do_not_use_directly` values in the YAML definition.) The "full id" is used in
most places, while the "base id" is used for the `GetPrefName_*` and
`GetPrefDefault_*` functions.

(This is a nice demonstration of the benefits of the YAML file, BTW. Making
this change with the old code would have involved adding an entry to every
single pref in StaticPrefList.h.)

The patch also rejigs the comment at the top of StaticPrefList.yaml, to clarify
some things.

Differential Revision: https://phabricator.services.mozilla.com/D38604

--HG--
extra : moz-landing-system : lando
2019-07-22 02:10:14 +00:00
..
gtest Bug 1550422 - P11. Add atomic float preferences support. r=njn 2019-05-26 14:29:37 +00:00
unit Bug 1561435 - Format modules/, a=automatic-formatting 2019-07-05 10:54:01 +02:00
unit_ipc Bug 1561435 - Format modules/, a=automatic-formatting 2019-07-05 10:54:01 +02:00
python.ini Bug 1564724 - Generate StaticPrefList.h from StaticPrefList.yaml. r=glandium 2019-07-18 00:08:20 +00:00
test_generate_static_pref_list.py Bug 1567329 - Append _AtStartup to once static pref getters. r=erahm 2019-07-22 02:10:14 +00:00