Closed Bug 1560530 Opened 5 years ago Closed 5 years ago

Start splitting StaticPrefs.h into multiple files

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

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

References

Details

Attachments

(1 file, 1 obsolete file)

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.

Nathan gave me the nice idea of changing StaticPrefs from a class to a namespace. This is relevant because a C++ class must be declared in a single file, but the contents of a namespace can be spread across multiple files. And because class qualification and namespace qualification both use :: in C++, the use points won't need to change.

Assignee: nobody → n.nethercote
Priority: -- → P2
Depends on: 1561216
Attachment #9073759 - Attachment description: Bug 1560530 - Remove unnecessary `mozilla::` qualifiers in Preferences.cpp. r=froydnj → Bug 1561216 - Remove unnecessary `mozilla::` qualifiers in Preferences.cpp. r=froydnj
Attachment #9073759 - Attachment is obsolete: true
Attachment #9073759 - Attachment is obsolete: false
Attachment #9073759 - Attachment is obsolete: true

This implements the machinery for the splitting of static prefs headers, and
uses it for a single header. #includes are used in such a way that the amount
of boilerplate for each static prefs header file is minimal.

The next patch will split the remaining prefs into more header files.

froydnj: I just landed bug 1562331 so I'm now ready to move forward on this bug. Let me know what you think of the first patch! :)

Summary: Split StaticPrefs.h into multiple files → Start splitting StaticPrefs.h into multiple files
Blocks: 1563139

I was going to do this all in a single bug, but I will now do it across multiple bugs. Bug 1563139 is the tracking bug.

No longer depends on: 1561216
Pushed by nnethercote@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/50cc53e85760
Split StaticPrefs_accessibility.h from StaticPrefs.h. r=froydnj
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: