Bug 1519232 - simplify faulty's valid process logic; r=decoder,f=posidron
authorNathan Froyd <froydnj@mozilla.com>
Fri, 11 Jan 2019 17:44:47 -0500
changeset 453617 97c36c63095b318408a5c40d969347f4f432c86a
parent 453616 6b946ad790d09f81ed5c37db0bea635275826fcc
child 453618 4fc377013db595a8f72606eb07f2de3e75676358
push id35361
push usernbeleuzu@mozilla.com
push dateSat, 12 Jan 2019 09:41:19 +0000
treeherdermozilla-central@a44934afe25e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdecoder
bugs1519232
milestone66.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 1519232 - simplify faulty's valid process logic; r=decoder,f=posidron There's no need to explicit list out all the child process types that we care about, when a simple is-this-the-parent-process check can do the job just as well.
tools/fuzzing/faulty/Faulty.cpp
--- a/tools/fuzzing/faulty/Faulty.cpp
+++ b/tools/fuzzing/faulty/Faulty.cpp
@@ -209,27 +209,22 @@ Faulty::Faulty()
   }
 }
 
 // static
 bool Faulty::IsValidProcessType(void) {
   bool isValidProcessType;
   const bool targetChildren = !!PR_GetEnv("FAULTY_CHILDREN");
   const bool targetParent = !!PR_GetEnv("FAULTY_PARENT");
-  unsigned short int currentProcessType = XRE_GetProcessType();
+  const bool isParent = XRE_IsParentProcess();
 
   if (targetChildren && !targetParent) {
     // Fuzz every child process type but not the parent process.
-    isValidProcessType = currentProcessType == GeckoProcessType_Default;
-  } else if (!targetChildren && targetParent &&
-             (currentProcessType == GeckoProcessType_Plugin ||
-              currentProcessType == GeckoProcessType_Content ||
-              currentProcessType == GeckoProcessType_GMPlugin ||
-              currentProcessType == GeckoProcessType_GPU ||
-              currentProcessType == GeckoProcessType_VR)) {
+    isValidProcessType = isParent;
+  } else if (!targetChildren && targetParent && !isParent) {
     // Fuzz inside any of the above child process only.
     isValidProcessType = true;
   } else if (targetChildren && targetParent) {
     // Fuzz every process type.
     isValidProcessType = true;
   } else {
     // Fuzz no process type at all.
     isValidProcessType = false;