mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1647795 - Remove some uses of "blacklist" from dom/ipc/. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D80694
This commit is contained in:
parent
de4bc9e6bd
commit
01610277f9
@ -913,7 +913,7 @@ already_AddRefed<ContentParent> ContentParent::GetUsedBrowserProcess(
|
||||
}
|
||||
}
|
||||
|
||||
// Try to take the preallocated process except for blacklisted types.
|
||||
// Try to take the preallocated process except for certain remote types.
|
||||
// The preallocated process manager might not had the chance yet to release
|
||||
// the process after a very recent ShutDownProcess, let's make sure we don't
|
||||
// try to reuse a process that is being shut down.
|
||||
@ -3239,7 +3239,7 @@ ContentParent::Observe(nsISupports* aSubject, const char* aTopic,
|
||||
}
|
||||
|
||||
if (!strcmp(aTopic, "nsPref:changed")) {
|
||||
// A pref changed. If it's not on the blacklist, inform child processes.
|
||||
// A pref changed. If it is useful to do so, inform child processes.
|
||||
if (!ShouldSyncPreference(aData)) {
|
||||
return NS_OK;
|
||||
}
|
||||
@ -3391,28 +3391,28 @@ ContentParent::Observe(nsISupports* aSubject, const char* aTopic,
|
||||
|
||||
/* static */
|
||||
bool ContentParent::ShouldSyncPreference(const char16_t* aData) {
|
||||
#define BLACKLIST_ENTRY(s) \
|
||||
#define PARENT_ONLY_PREF_LIST_ENTRY(s) \
|
||||
{ s, (sizeof(s) / sizeof(char16_t)) - 1 }
|
||||
struct BlacklistEntry {
|
||||
struct ParentOnlyPrefListEntry {
|
||||
const char16_t* mPrefBranch;
|
||||
size_t mLen;
|
||||
};
|
||||
// These prefs are not useful in child processes.
|
||||
static const BlacklistEntry sContentPrefBranchBlacklist[] = {
|
||||
BLACKLIST_ENTRY(u"app.update.lastUpdateTime."),
|
||||
BLACKLIST_ENTRY(u"datareporting.policy."),
|
||||
BLACKLIST_ENTRY(u"browser.safebrowsing.provider."),
|
||||
BLACKLIST_ENTRY(u"browser.shell."),
|
||||
BLACKLIST_ENTRY(u"browser.slowStartup."),
|
||||
BLACKLIST_ENTRY(u"browser.startup."),
|
||||
BLACKLIST_ENTRY(u"extensions.getAddons.cache."),
|
||||
BLACKLIST_ENTRY(u"media.gmp-manager."),
|
||||
BLACKLIST_ENTRY(u"media.gmp-gmpopenh264."),
|
||||
BLACKLIST_ENTRY(u"privacy.sanitize."),
|
||||
static const ParentOnlyPrefListEntry sParentOnlyPrefBranchList[] = {
|
||||
PARENT_ONLY_PREF_LIST_ENTRY(u"app.update.lastUpdateTime."),
|
||||
PARENT_ONLY_PREF_LIST_ENTRY(u"datareporting.policy."),
|
||||
PARENT_ONLY_PREF_LIST_ENTRY(u"browser.safebrowsing.provider."),
|
||||
PARENT_ONLY_PREF_LIST_ENTRY(u"browser.shell."),
|
||||
PARENT_ONLY_PREF_LIST_ENTRY(u"browser.slowStartup."),
|
||||
PARENT_ONLY_PREF_LIST_ENTRY(u"browser.startup."),
|
||||
PARENT_ONLY_PREF_LIST_ENTRY(u"extensions.getAddons.cache."),
|
||||
PARENT_ONLY_PREF_LIST_ENTRY(u"media.gmp-manager."),
|
||||
PARENT_ONLY_PREF_LIST_ENTRY(u"media.gmp-gmpopenh264."),
|
||||
PARENT_ONLY_PREF_LIST_ENTRY(u"privacy.sanitize."),
|
||||
};
|
||||
#undef BLACKLIST_ENTRY
|
||||
#undef PARENT_ONLY_PREF_LIST_ENTRY
|
||||
|
||||
for (const auto& entry : sContentPrefBranchBlacklist) {
|
||||
for (const auto& entry : sParentOnlyPrefBranchList) {
|
||||
if (NS_strncmp(entry.mPrefBranch, aData, entry.mLen) == 0) {
|
||||
return false;
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ void RDDProcessManager::OnXPCOMShutdown() {
|
||||
}
|
||||
|
||||
void RDDProcessManager::OnPreferenceChange(const char16_t* aData) {
|
||||
// A pref changed. If it's not on the blacklist, inform child processes.
|
||||
// A pref changed. If it is useful to do so, inform child processes.
|
||||
if (!dom::ContentParent::ShouldSyncPreference(aData)) {
|
||||
return;
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ void GPUProcessManager::OnXPCOMShutdown() {
|
||||
}
|
||||
|
||||
void GPUProcessManager::OnPreferenceChange(const char16_t* aData) {
|
||||
// A pref changed. If it's not on the blacklist, inform child processes.
|
||||
// A pref changed. If it is useful to do so, inform child processes.
|
||||
if (!dom::ContentParent::ShouldSyncPreference(aData)) {
|
||||
return;
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ void VRProcessManager::OnXPCOMShutdown() {
|
||||
}
|
||||
|
||||
void VRProcessManager::OnPreferenceChange(const char16_t* aData) {
|
||||
// A pref changed. If it's not on the blacklist, inform child processes.
|
||||
// A pref changed. If it is useful to do so, inform child processes.
|
||||
if (!dom::ContentParent::ShouldSyncPreference(aData)) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user