KrisWright: If you are interested in doing some conversions, a good place to start would be
dom/base/TimeoutManager.cpp. There are 13 VarCache prefs there that look straightforward.
The following steps should work for most (but not all) VarCache prefs.
- Find an existing VarCache pref to convert, by searching for
- Look for the pref's entry in a prefs data file, usually
modules/libpref/init/all.js. (You won't always find one.)
- Add a new entry to
modules/libpref/init/StaticPrefList.yaml, based on what you found in the above two steps.
- Note that sometimes the default value given in those two locations won't agree, in which case you probably should use the
- Remove the entry from
all.js, if present.
- Remove the
Add*VarCache call, along with the mirror variable it used, and any accompanying stuff such as:
- any constant for the default value;
- any static bool being used to prevent
Add*VarCache from being called more than once.
- Replace uses of the mirror variable with
- If there are no such uses, give it a
mirror value of
- Unless the pref is never used at all, in which case remove it!
- Also look for any entries in other prefs files, particularly
browser/app/profile/firefox.js. If they are equivalent to the
StaticPrefList.yaml entry, then remove them. (This is surprisingly common.) Or if they can be merged into the
StaticPrefList.yaml entry (e.g. with
#ifdef ANDROID), then do that.
It's usually best to do one pref per commit, because it makes reviewing and bisecting any regressions easier. Sometimes you might have two or three tightly-coupled prefs, in which case doing them in a single commit might be better.
You can look at commits in bugs blocking this bug for examples of previous conversions. They all predate the introduction of
StaticPrefList.yaml, and therefore add the new static pref to
StaticPrefList.h instead, but otherwise they'll match the steps above.