Closed Bug 1560837 Opened 5 months ago Closed 5 months ago

Make APZ static prefs follow the naming convention

Categories

(Core :: Preferences: Backend, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: njn, Assigned: njn)

Details

Attachments

(1 file)

No description provided.
Pushed by nnethercote@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/fb0a0b7ac94c
Make APZ static prefs follow the naming convention. r=froydnj
Blocks: 1561491
No longer blocks: 1561491
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
Assignee: nobody → n.nethercote

Why do we have a naming convention for these methods that's different from the naming convention for static methods in general?

From: https://searchfox.org/mozilla-central/source/modules/libpref/init/StaticPrefList.h#84-89:

// - <pref-name-id> is the name of the static getter function generated within
//   the StaticPrefs class. For consistency, the identifier for every pref
//   should be created by starting with <pref-name-string> and converting any
//   '.' or '-' chars to '_'. For example, "foo.bar_baz" becomes
//   |foo_bar_baz|. This is arguably ugly, but clear, and you can search for
//   both using the regexp /foo.bar.baz/.

Also, we use the Google C++ style now, which says this:

Regular functions have mixed case; accessors and mutators may be named like variables.

These functions are accessors, so variable naming rules can be applied:

The names of variables (including function parameters) and data members are all lowercase, with underscores between words

You need to log in before you can comment on or make changes to this bug.