Bug 1752332: Rename references to parent-only pref structures r=KrisWright

We're going to be using them in more contexts, so generalize
the name.

Depends on D141408

Differential Revision: https://phabricator.services.mozilla.com/D141409
This commit is contained in:
Tom Ritter 2022-04-20 20:21:43 +00:00
Родитель f0860a2493
Коммит b5a0bee961
1 изменённых файлов: 16 добавлений и 14 удалений

Просмотреть файл

@ -3788,32 +3788,34 @@ ContentParent::Observe(nsISupports* aSubject, const char* aTopic,
/* static */
bool ContentParent::ShouldSyncPreference(const char* aPref) {
#define PARENT_ONLY_PREF_LIST_ENTRY(s) \
#define PREF_LIST_ENTRY(s) \
{ s, (sizeof(s) / sizeof(char)) - 1 }
struct ParentOnlyPrefListEntry {
struct PrefListEntry {
const char* mPrefBranch;
size_t mLen;
};
// These prefs are not useful in child processes.
static const ParentOnlyPrefListEntry sParentOnlyPrefBranchList[] = {
PARENT_ONLY_PREF_LIST_ENTRY("app.update.lastUpdateTime."),
PARENT_ONLY_PREF_LIST_ENTRY("datareporting.policy."),
PARENT_ONLY_PREF_LIST_ENTRY("browser.safebrowsing.provider."),
PARENT_ONLY_PREF_LIST_ENTRY("browser.shell."),
PARENT_ONLY_PREF_LIST_ENTRY("browser.slowStartup."),
PARENT_ONLY_PREF_LIST_ENTRY("browser.startup."),
PARENT_ONLY_PREF_LIST_ENTRY("extensions.getAddons.cache."),
PARENT_ONLY_PREF_LIST_ENTRY("media.gmp-manager."),
PARENT_ONLY_PREF_LIST_ENTRY("media.gmp-gmpopenh264."),
PARENT_ONLY_PREF_LIST_ENTRY("privacy.sanitize."),
static const PrefListEntry sParentOnlyPrefBranchList[] = {
PREF_LIST_ENTRY("app.update.lastUpdateTime."),
PREF_LIST_ENTRY("datareporting.policy."),
PREF_LIST_ENTRY("browser.safebrowsing.provider."),
PREF_LIST_ENTRY("browser.shell."),
PREF_LIST_ENTRY("browser.slowStartup."),
PREF_LIST_ENTRY("browser.startup."),
PREF_LIST_ENTRY("extensions.getAddons.cache."),
PREF_LIST_ENTRY("media.gmp-manager."),
PREF_LIST_ENTRY("media.gmp-gmpopenh264."),
PREF_LIST_ENTRY("privacy.sanitize."),
};
#undef PARENT_ONLY_PREF_LIST_ENTRY
#undef PREF_LIST_ENTRY
for (const auto& entry : sParentOnlyPrefBranchList) {
if (strncmp(entry.mPrefBranch, aPref, entry.mLen) == 0) {
return false;
}
}
return true;
}