mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
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:
parent
ef57c7df72
commit
ffb8a027cc
@ -3796,32 +3796,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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user