Closed Bug 1563139 Opened 5 years ago Closed 5 years ago

Split StaticPrefs.h into multiple files

Categories

(Core :: Preferences: Backend, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: n.nethercote, Assigned: n.nethercote)

References

Details

Attachments

(4 files)

StaticPrefs.h is included almost everywhere, and it also changes frequently. As a result, it triggers a lot of recompilation for people.

I plan to split the file into pieces, where all the prefs with the same first segment go in the same file. E.g. all the "gfx.*" prefs would go into StaticPrefs_gfx.h. Most files will only need to import one or two of these smaller headers, which should greatly reduce the amount of recompilation triggered by changes.

I was going to do this in a single bug (bug 1560530) but I have now decided to split it up across multiple bugs.

Depends on: 1564724
Depends on: 1565110
Type: enhancement → task

Another change of plan: now that static prefs are in a YAML file, splitting the resulting headers is easier, because they are generated code rather than checked-in code. So the remaining parts can be done in this single bug.

Keywords: meta
Summary: [meta] Split StaticPrefs.h into multiple files → Split StaticPrefs.h into multiple files

These files exist because they were the proof-of-concept first step for
splitting the static prefs header files. Now that those header files can be
generated from a script, we need to move the accessibility.* prefs into the
YAML file.

StaticPrefs.h will be removed two commits from now, so update these comments.

The patch removes the comment above SetUsesContainerScrolling() because it's
wrong -- that function doesn't use static prefs at all -- and make it
inlinable.

Depends on D39132

Instead of generating a single init/StaticPrefList.h, we now generate:

  • init/StaticPrefListAll.h;
  • StaticPrefsAll.h;
  • one init/StaticPrefList_*.h file for each pref group;
  • one StaticPrefs_*.h file for each pref group.

StaticPrefs.h still exists -- it's equivalent to all the StaticPrefs_*.h
files combined -- so no .cpp files are changed by this commit. The next
commit will remove that file and replace inclusions of it with inclusions of
the new files.

The patch also adds checking of the type of the do_not_use_directly field.

Depends on D39133

This requires replacing inclusions of it with inclusions of more specific prefs
files.

The exception is that StaticPrefsAll.h, which is equivalent to StaticPrefs.h,
and is used in Codegen.py because doing something smarter is tricky and
suitable for a follow-up. As a result, any change to StaticPrefList.yaml will
still trigger recompilation of all the generated DOM bindings files, but that's
still a big improvement over trigger recompilation of every file that uses
static prefs.

Most of the changes in this commit are very boring. The only changes that are
not boring are modules/libpref/*, Codegen.py, and ServoBindings.toml.

Depends on D39134

Pushed by nnethercote@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c31527d8984e
Remove StaticPref{s,List}_accessibility.h. r=glandium
https://hg.mozilla.org/integration/autoland/rev/f293ea1956d9
Update comments mentioning StaticPrefs.h. r=glandium
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Assignee: nobody → n.nethercote
Pushed by nnethercote@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9d2dadd7a194
Generate multiple pref list headers instead of just one. r=glandium
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: