This makes prefs definition simpler, more consistent, and less error-prone.
The patch also changes the form of the "not Android" condition to one used more
widely in all.js.
Differential Revision: https://phabricator.services.mozilla.com/D41299
--HG--
extra : moz-landing-system : lando
This makes prefs definition simpler, more consistent, and less error-prone.
Differential Revision: https://phabricator.services.mozilla.com/D41298
--HG--
extra : moz-landing-system : lando
A `CacheData` object holds two things: a VarCache/mirror variable address, and
a default value. The previous patch removed the use of the default value.
Therefore, `CacheData` now only holds an address, so there's no need for a
distinct heap object for it, and we can eliminate `CacheData` entirely and just
use the mirror variable address (a `void*`) directly.
The removal of the `CacheData` objects removes one reason for `gCacheData` to
exist (which is to have an owner for those objects). The other reason is to
detect if two or more prefs get VarCached onto a single variable. But given
that VarCaches are on the way out in favour of static prefs (bug 1448219) this
checking is no longer important. So the commit removes `gCacheData` as well.
The above changes save 20-32 KiB per process on 64-bit platforms.
The patch also removes `gCacheDataDesc`, a diagnostic thing from bug 1276488
that isn't relevant with `gCacheData` removed. This means the return type of
`InitInitialObjects` can be simplified.
Finally, the commit renames a few things, taking another step along the path of
renaming VarCache prefs as mirrored prefs, a much better name.
Differential Revision: https://phabricator.services.mozilla.com/D40906
--HG--
extra : moz-landing-system : lando
This patch changes how a VarCache pref works when deleted (in some cases) --
the VarCache variable keeps its existing value instead of being reset to a
pre-specified default.
In bug 1570212 I have made sure that no VarCache prefs exhibit this behaviour
in practice any more, so this change should not affect functionality. There is
an assertion that checks this.
The next patch will take advantage of this change by removing the need to
store the pre-specified defaults, which will save memory.
Differential Revision: https://phabricator.services.mozilla.com/D39805
--HG--
extra : moz-landing-system : lando
The patch:
- changes `privacy.resistFingerprinting.target_video_res` to a static pref;
- changes `privacy.resistFingerprinting.video_frames_per_sec` and
`privacy.resistFingerprinting.video_dropped_ratio` to code constants;
- removes the unused `RFP_TIMER_VALUE_DEFAULT` and `RFP_JITTER_VALUE_DEFAULT`
constants.
Differential Revision: https://phabricator.services.mozilla.com/D40904
--HG--
extra : moz-landing-system : lando
Fix overly-long lines, add '.' to the end of sentences, put things in a more
sensible order, etc. (No functional changes.)
Differential Revision: https://phabricator.services.mozilla.com/D40903
--HG--
extra : moz-landing-system : lando
We don't want to enable audio competing by default, so hide this feature behind a static pref.
Differential Revision: https://phabricator.services.mozilla.com/D38143
--HG--
extra : moz-landing-system : lando
Another step in the renaming of VarCache variables as mirror variables,
matching the 'mirror' field used in StaticPrefList.yaml.
Differential Revision: https://phabricator.services.mozilla.com/D40794
--HG--
extra : moz-landing-system : lando
Bindgen is no longer necessary now that Rust bindings are generated by
generate_static_pref_list.py.
Differential Revision: https://phabricator.services.mozilla.com/D40793
--HG--
extra : moz-landing-system : lando
Converts privacy.fuzzyfox.clockgrainus varcache pref to a static pref. This pref used two #define values, which I also removed.
Differential Revision: https://phabricator.services.mozilla.com/D41102
--HG--
extra : moz-landing-system : lando
Converts mozilla.widget.disable-native-theme varcache pref to a static pref and updates uses of its associated global variable with the pref. This also renames the pref to widget.disable-native-theme to group with other widget prefs.
Differential Revision: https://phabricator.services.mozilla.com/D40721
--HG--
extra : moz-landing-system : lando
Converts layout.framevisibility.amountscrollbeforeupdatevertical and layout.framevisibility.amountscrollbeforeupdatehorizontal to static prefs.
Differential Revision: https://phabricator.services.mozilla.com/D40718
--HG--
extra : moz-landing-system : lando
Converts dom.largeAllocation.testing.allHttpLoads varcache pref to a static pref.
Differential Revision: https://phabricator.services.mozilla.com/D40716
--HG--
extra : moz-landing-system : lando
Converts dom.ipc.processPriorityManager.backgroundPerceivableGracePeriodMS and dom.ipc.processPriorityManager.backgroundGracePeriodMS to static prefs and removes the initializer function they were in, as they were the last prefs initialized there.
Differential Revision: https://phabricator.services.mozilla.com/D40702
--HG--
extra : moz-landing-system : lando
(a) Substitute Cross-Origin header with COEP
(b) Forcing cors in FetchDriver is removed since COEP doesn't need to IIUC
Differential Revision: https://phabricator.services.mozilla.com/D38788
--HG--
extra : moz-landing-system : lando
test_list_json_searchdefault.js is repurposed, as the tests in the searchconfig sub-directory already check the default engine.
Differential Revision: https://phabricator.services.mozilla.com/D41035
--HG--
extra : moz-landing-system : lando
Avoiding lots of `if (isParent)` conditions reduces code size by 2016 bytes for
a local build on my Linux64 box.
Differential Revision: https://phabricator.services.mozilla.com/D40921
--HG--
extra : moz-landing-system : lando
It's defined first as false, and again later in the file as true. This patch
removes the first definition, which is currently overridden by the second.
Depends on D40919
Differential Revision: https://phabricator.services.mozilla.com/D40920
--HG--
extra : moz-landing-system : lando
security-prefs.js is #included into greprefs.js, but there's no good reason for
it to be separate from all.js. Having it separate makes it easier to overlook,
and all.js has a bunch of `security.*` prefs in it anyway.
This patch inlines it into all.js. It inlines it at the start of the file to
minimize the risk of the change, so that the prefs end up in greprefs.js in the
same order as before.
Differential Revision: https://phabricator.services.mozilla.com/D40919
--HG--
extra : moz-landing-system : lando
It's much nicer.
One nice thing about this is that the new code is subject to the existing
threadedness checking, which identified that several of these should be atomic
because they're accessed off the main thread.
Differential Revision: https://phabricator.services.mozilla.com/D40792
--HG--
extra : moz-landing-system : lando
Bindgen is no longer necessary now that Rust bindings are generated by
generate_static_pref_list.py.
Differential Revision: https://phabricator.services.mozilla.com/D40793
--HG--
extra : moz-landing-system : lando
It's much nicer.
One nice thing about this is that the new code is subject to the existing
threadedness checking, which identified that several of these should be atomic
because they're accessed off the main thread.
Differential Revision: https://phabricator.services.mozilla.com/D40792
--HG--
extra : moz-landing-system : lando
This patch introduces a new Rust crate called `static_prefs`.
It also changes generate_static_pref_list.py to generate two new files.
- StaticPrefsCGetters.cpp: contains C getters, which are just wrappers around
the C++ getters. This is included into Preferences.cpp.
- static_prefs.rs: contains declarations for the C getters, plus the `pref!`
macro which provides nice syntax for calling the C getters. This is included
into static_prefs/src/lib.rs.
The new code is only generated for prefs marked with the new `rust` field in
the YAML. It's opt-in because there's no point generating additional code for
900+ static prefs when only about 20 are currently used from Rust.
This patch only marks a single pref (`browser.display.document_color_use`) with
`rust: true`. That pref isn't accessed from Rust code in this patch, but it's
necessary because the generated Rust code is invalid if there are zero
Rust-accessed prefs. (The next patch will access that pref and others from Rust
code.
Differential Revision: https://phabricator.services.mozilla.com/D40791
--HG--
extra : moz-landing-system : lando
generate_static_pref_list currently has two functions:
- generate_header(): this checks the YAML and generates most of the code.
- emit_header(): this does a bit of additional code generation and writes the
code to file.
This patch gives it a cleaner structure:
- check_pref_list(): this checks the YAML.
- generate_code(): this generates all the code. (It calls check_pref_list()
first.)
- emit_code(): this just writes the code to file.
The patch also improves the testing in test_generate_static_pref_list.py,
so that it checks the full contents of all generated files.
All these improvements will help with the next patch, which adds two additional
generated files.
The patch also fixes a couple of minor errors in the comment at the top of
StaticPrefList.yaml.
Differential Revision: https://phabricator.services.mozilla.com/D40790
--HG--
extra : moz-landing-system : lando
We don't want to enable audio competing by default, so hide this feature behind a static pref.
Differential Revision: https://phabricator.services.mozilla.com/D38143
--HG--
extra : moz-landing-system : lando