Bug 1647795 - Remove some uses of "blacklist" from dom/ipc/. r=nika
authorAndrew McCreight <continuation@gmail.com>
Tue, 23 Jun 2020 17:50:23 +0000
changeset 536944 14ea312ed2ce124f37e67c301cac224d18527015
parent 536943 65edebab7a932e978ee40a98f56e6ce6c65322d1
child 536945 722bda14eeb74ad4a54709d60ddaadfabec40629
push id37533
push userdluca@mozilla.com
push dateTue, 23 Jun 2020 21:38:40 +0000
treeherdermozilla-central@d48aa0f0aa0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnika
bugs1647795
milestone79.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1647795 - Remove some uses of "blacklist" from dom/ipc/. r=nika Differential Revision: https://phabricator.services.mozilla.com/D80694
dom/ipc/ContentParent.cpp
dom/media/ipc/RDDProcessManager.cpp
gfx/ipc/GPUProcessManager.cpp
gfx/vr/ipc/VRProcessManager.cpp
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -908,17 +908,17 @@ already_AddRefed<ContentParent> ContentP
       MOZ_LOG(ContentParent::GetLog(), LogLevel::Debug,
               ("GetUsedProcess: Reused random process %p (%d) for %s",
                random.get(), (unsigned int)random->ChildID(),
                NS_ConvertUTF16toUTF8(aRemoteType).get()));
       return random.forget();
     }
   }
 
-  // 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.
   RefPtr<ContentParent> p;
   bool preallocated = false;
   if (!aRemoteType.EqualsLiteral(FILE_REMOTE_TYPE) &&
       !aRemoteType.EqualsLiteral(EXTENSION_REMOTE_TYPE) &&  // Bug 1638119
       (p = PreallocatedProcessManager::Take(aRemoteType)) &&
@@ -3234,17 +3234,17 @@ void ContentParent::RemoveShutdownBlocke
 NS_IMETHODIMP
 ContentParent::Observe(nsISupports* aSubject, const char* aTopic,
                        const char16_t* aData) {
   if (IsDead() || !mSubprocess) {
     return NS_OK;
   }
 
   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;
     }
 
     // We know prefs are ASCII here.
     NS_LossyConvertUTF16toASCII strData(aData);
 
     Pref pref(strData, /* isLocked */ false, Nothing(), Nothing());
@@ -3386,38 +3386,38 @@ ContentParent::Observe(nsISupports* aSub
     UpdateNetworkLinkType();
   }
 
   return NS_OK;
 }
 
 /* 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
-
-  for (const auto& entry : sContentPrefBranchBlacklist) {
+#undef PARENT_ONLY_PREF_LIST_ENTRY
+
+  for (const auto& entry : sParentOnlyPrefBranchList) {
     if (NS_strncmp(entry.mPrefBranch, aData, entry.mLen) == 0) {
       return false;
     }
   }
   return true;
 }
 
 void ContentParent::UpdateNetworkLinkType() {
--- a/dom/media/ipc/RDDProcessManager.cpp
+++ b/dom/media/ipc/RDDProcessManager.cpp
@@ -76,17 +76,17 @@ void RDDProcessManager::OnXPCOMShutdown(
     Preferences::RemoveObserver(mObserver, "");
     mObserver = nullptr;
   }
 
   CleanShutdown();
 }
 
 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;
   }
 
   // We know prefs are ASCII here.
   NS_LossyConvertUTF16toASCII strData(aData);
 
   mozilla::dom::Pref pref(strData, /* isLocked */ false, Nothing(), Nothing());
--- a/gfx/ipc/GPUProcessManager.cpp
+++ b/gfx/ipc/GPUProcessManager.cpp
@@ -130,17 +130,17 @@ void GPUProcessManager::OnXPCOMShutdown(
     Preferences::RemoveObserver(mObserver, "");
     mObserver = nullptr;
   }
 
   CleanShutdown();
 }
 
 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;
   }
 
   // We know prefs are ASCII here.
   NS_LossyConvertUTF16toASCII strData(aData);
 
   mozilla::dom::Pref pref(strData, /* isLocked */ false, Nothing(), Nothing());
--- a/gfx/vr/ipc/VRProcessManager.cpp
+++ b/gfx/vr/ipc/VRProcessManager.cpp
@@ -206,17 +206,17 @@ void VRProcessManager::OnXPCOMShutdown()
     Preferences::RemoveObserver(mObserver, "");
     mObserver = nullptr;
   }
 
   CleanShutdown();
 }
 
 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;
   }
 
   // We know prefs are ASCII here.
   NS_LossyConvertUTF16toASCII strData(aData);
 
   mozilla::dom::Pref pref(strData, /* isLocked */ false, Nothing(), Nothing());