gecko-dev/modules/libpref
Nicholas Nethercote 12640bca82 Bug 1563555 - Generate static pref getters usable from Rust code. r=glandium
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
2019-08-07 05:16:55 +00:00
..
docs Bug 1563555 - Generate static pref getters usable from Rust code. r=glandium 2019-08-07 05:16:55 +00:00
init Bug 1563555 - Generate static pref getters usable from Rust code. r=glandium 2019-08-07 05:16:55 +00:00
parser Bug 1559642 - Fix -D ellipsis-inclusive-range-patterns warnings. r=froydnj 2019-06-19 23:58:54 +00:00
test Bug 1563555 - Generate static pref getters usable from Rust code. r=glandium 2019-08-07 05:16:55 +00:00
components.conf Bug 1550422 - P7. Add VR process selector to prefs module. r=spohl 2019-05-25 10:12:43 +00:00
greprefs.js
moz.build Bug 1563555 - Generate static pref getters usable from Rust code. r=glandium 2019-08-07 05:16:55 +00:00
nsIPrefBranch.idl Bug 1557501. Stop using [array] in nsIPrefBranch. r=njn 2019-06-07 01:01:12 +00:00
nsIPrefLocalizedString.idl Bug 1545851, part 2 - Mark nsISupportsPrimitive and subinterfaces as builtinclass. r=froydnj 2019-04-22 14:35:18 +00:00
nsIPrefService.idl Bug 1552795 - Remove all trailing whitespaces in idl files r=Ehsan 2019-05-22 22:37:14 +00:00
nsIRelativeFilePref.idl Bug 1552795 - Remove all trailing whitespaces in idl files r=Ehsan 2019-05-22 22:37:14 +00:00
nsRelativeFilePref.h
Preferences.cpp Bug 1563555 - Generate static pref getters usable from Rust code. r=glandium 2019-08-07 05:16:55 +00:00
Preferences.h Bug 1567074 - Document libpref properly. r=jya 2019-08-01 02:11:07 +00:00
SharedPrefMap.cpp Bug 1554559 - P2. Add option for pref entry in SharedPrefMap to be skipped by iterator. r=njn 2019-06-11 06:29:26 +00:00
SharedPrefMap.h Bug 1562436 - Adjust first pref returned if it is to be skipped. r=njn 2019-07-01 23:49:41 +00:00
StaticPrefsBase.h Bug 1569835 - Don't record accesses to static preference atomics, r=njn. 2019-08-03 05:14:07 +00:00