Bug 1529022 - Add a GeckoChildProcessHosts iterator r=jld
authorTarek Ziadé <tarek@mozilla.com>
Fri, 21 Jun 2019 01:33:47 +0000
changeset 479794 182966bfca87b7f3b4897b760113da45c84c043a
parent 479793 97119554c8a19c62da581f17b40a77a1ddc5b063
child 479795 b8c319d5968f957d34e359829690614a9b69b95a
push id88281
push usertziade@mozilla.com
push dateFri, 21 Jun 2019 01:34:22 +0000
treeherderautoland@182966bfca87 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjld
bugs1529022
milestone69.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 1529022 - Add a GeckoChildProcessHosts iterator r=jld Adds GeckoChildProcessHost::GetAll() and use it in ChromeUtils::GetProcInfo() Differential Revision: https://phabricator.services.mozilla.com/D33920
dom/base/ChromeUtils.cpp
ipc/glue/GeckoChildProcessHost.cpp
ipc/glue/GeckoChildProcessHost.h
widget/ProcInfo.h
widget/android/ProcInfo.cpp
widget/cocoa/ProcInfo.mm
widget/gtk/ProcInfo.cpp
widget/windows/ProcInfo.cpp
xpcom/build/GeckoProcessTypes.h
--- a/dom/base/ChromeUtils.cpp
+++ b/dom/base/ChromeUtils.cpp
@@ -25,16 +25,17 @@
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/IdleDeadline.h"
 #include "mozilla/dom/JSWindowActorService.h"
 #include "mozilla/dom/Promise.h"
 #include "mozilla/dom/ReportingHeader.h"
 #include "mozilla/dom/UnionTypes.h"
 #include "mozilla/dom/WindowBinding.h"  // For IdleRequestCallback/Options
 #include "mozilla/gfx/GPUProcessManager.h"
+#include "mozilla/ipc/GeckoChildProcessHost.h"
 #include "mozilla/net/UrlClassifierFeatureFactory.h"
 #include "mozilla/net/SocketProcessHost.h"
 #include "IOActivityMonitor.h"
 #include "nsIOService.h"
 #include "nsThreadUtils.h"
 #include "mozJSComponentLoader.h"
 #include "GeckoProfiler.h"
 #include "nsIException.h"
@@ -687,77 +688,103 @@ already_AddRefed<Promise> ChromeUtils::R
   RefPtr<nsISerialEventTarget> target =
       global->EventTargetFor(TaskCategory::Performance);
 
   // Getting the parent proc info
   mozilla::GetProcInfo(parentPid, 0, mozilla::ProcType::Browser)
       ->Then(
           target, __func__,
           [target, domPromise, parentPid](ProcInfo aParentInfo) {
-            // Iterate over each child process to build an array of promises.
-            nsTArray<ContentParent*> parents;
-            ContentParent::GetAll(parents);
+            // Get a list of ContentParent
+            nsTArray<ContentParent*> contentParents;
+            ContentParent::GetAll(contentParents);
             nsTArray<RefPtr<ProcInfoPromise>> promises;
-            for (ContentParent* contentParent : parents) {
-              // Getting the child process id.
-              int32_t childPid = contentParent->Pid();
-              if (childPid == -1) {
-                continue;
-              }
-              // Converting the Content Type into a ProcType
-              nsAutoString processType;
-              processType.Assign(contentParent->GetRemoteType());
-              mozilla::ProcType type = mozilla::ProcType::Unknown;
-              if (processType.EqualsLiteral(DEFAULT_REMOTE_TYPE)) {
-                type = mozilla::ProcType::Web;
-              } else if (processType.EqualsLiteral(FILE_REMOTE_TYPE)) {
-                type = mozilla::ProcType::File;
-              } else if (processType.EqualsLiteral(EXTENSION_REMOTE_TYPE)) {
-                type = mozilla::ProcType::Extension;
-              } else if (processType.EqualsLiteral(
-                             PRIVILEGEDABOUT_REMOTE_TYPE)) {
-                type = mozilla::ProcType::PrivilegedAbout;
-              } else if (processType.EqualsLiteral(
-                             LARGE_ALLOCATION_REMOTE_TYPE)) {
-                type = mozilla::ProcType::WebLargeAllocation;
-              }
+            mozilla::ipc::GeckoChildProcessHost::GetAll(
+                [&promises, contentParents](
+                    mozilla::ipc::GeckoChildProcessHost* aGeckoProcess) {
+                  if (!aGeckoProcess->GetChildProcessHandle()) {
+                    return;
+                  }
 
-              promises.AppendElement(mozilla::GetProcInfo(
-                  (base::ProcessId)childPid, contentParent->ChildID(), type,
-                  contentParent->Process()));
-            }
-
-            // Getting the Socket Process
-            int32_t SocketPid = net::gIOService->SocketProcessPid();
-            if (SocketPid != 0) {
-              promises.AppendElement(mozilla::GetProcInfo(
-                  (base::ProcessId)SocketPid, 0, mozilla::ProcType::Socket,
-                  net::gIOService->SocketProcess()));
-            }
+                  base::ProcessId childPid =
+                      base::GetProcId(aGeckoProcess->GetChildProcessHandle());
+                  int32_t childId = 0;
+                  mozilla::ProcType type;
+                  switch (aGeckoProcess->GetProcessType()) {
+                    case GeckoProcessType::GeckoProcessType_Content: {
+                      ContentParent* contentParent = nullptr;
+                      // This loop can become slow as we get more processes in
+                      // Fission, so might need some refactoring in the future.
+                      for (ContentParent* parent : contentParents) {
+                        // find the match
+                        if (parent->Process() == aGeckoProcess) {
+                          contentParent = parent;
+                          break;
+                        }
+                      }
+                      if (!contentParent) {
+                        return;
+                      }
+                      // Converting the Content Type into a ProcType
+                      nsAutoString processType;
+                      processType.Assign(contentParent->GetRemoteType());
+                      if (processType.EqualsLiteral(DEFAULT_REMOTE_TYPE)) {
+                        type = mozilla::ProcType::Web;
+                      } else if (processType.EqualsLiteral(FILE_REMOTE_TYPE)) {
+                        type = mozilla::ProcType::File;
+                      } else if (processType.EqualsLiteral(
+                                     EXTENSION_REMOTE_TYPE)) {
+                        type = mozilla::ProcType::Extension;
+                      } else if (processType.EqualsLiteral(
+                                     PRIVILEGEDABOUT_REMOTE_TYPE)) {
+                        type = mozilla::ProcType::PrivilegedAbout;
+                      } else if (processType.EqualsLiteral(
+                                     LARGE_ALLOCATION_REMOTE_TYPE)) {
+                        type = mozilla::ProcType::WebLargeAllocation;
+                      }
+                      childId = contentParent->ChildID();
+                      break;
+                    }
+                    case GeckoProcessType::GeckoProcessType_Default:
+                      type = mozilla::ProcType::Browser;
+                      break;
+                    case GeckoProcessType::GeckoProcessType_Plugin:
+                      type = mozilla::ProcType::Plugin;
+                      break;
+                    case GeckoProcessType::GeckoProcessType_GMPlugin:
+                      type = mozilla::ProcType::GMPlugin;
+                      break;
+                    case GeckoProcessType::GeckoProcessType_GPU:
+                      type = mozilla::ProcType::GPU;
+                      break;
+                    case GeckoProcessType::GeckoProcessType_VR:
+                      type = mozilla::ProcType::VR;
+                      break;
+                    case GeckoProcessType::GeckoProcessType_RDD:
+                      type = mozilla::ProcType::RDD;
+                      break;
+                    case GeckoProcessType::GeckoProcessType_Socket:
+                      type = mozilla::ProcType::Socket;
+                      break;
+                    case GeckoProcessType::GeckoProcessType_RemoteSandboxBroker:
+                      type = mozilla::ProcType::RemoteSandboxBroker;
+                      break;
+                    default:
+                      type = mozilla::ProcType::Unknown;
+                  }
 
-            // Getting the GPU and RDD processes on supported platforms
-            gfx::GPUProcessManager* pm = gfx::GPUProcessManager::Get();
-            if (pm) {
-              base::ProcessId GpuPid = pm->GPUProcessPid();
-              if (GpuPid != -1) {
-                promises.AppendElement(mozilla::GetProcInfo(
-                    GpuPid, 0, mozilla::ProcType::Gpu, pm->Process()));
-              }
-            }
-            RDDProcessManager* RDDPm = RDDProcessManager::Get();
-            if (RDDPm) {
-              base::ProcessId RDDPid = RDDPm->RDDProcessPid();
-              if (RDDPid != -1) {
-                promises.AppendElement(mozilla::GetProcInfo(
-                    RDDPid, 0, mozilla::ProcType::Rdd, RDDPm->Process()));
-              }
-            }
-
-            // two more processes to add: VR and GMP
-            // see https://bugzilla.mozilla.org/show_bug.cgi?id=1529022
+                  promises.AppendElement(
+#ifdef XP_MACOSX
+                      mozilla::GetProcInfo(childPid, childId, type,
+                                           aGeckoProcess->GetChildTask())
+#else
+                      mozilla::GetProcInfo(childPid, childId, type)
+#endif
+                  );
+                });
 
             auto ProcInfoResolver =
                 [domPromise, parentPid, parentInfo = aParentInfo](
                     const nsTArray<ProcInfo>& aChildrenInfo) {
                   mozilla::dom::ParentProcInfoDictionary procInfo;
                   // parent, basic info.
                   procInfo.mPid = parentPid;
                   procInfo.mFilename.Assign(parentInfo.filename);
--- a/ipc/glue/GeckoChildProcessHost.cpp
+++ b/ipc/glue/GeckoChildProcessHost.cpp
@@ -32,16 +32,17 @@
 
 #include "nsDirectoryServiceDefs.h"
 #include "nsIFile.h"
 #include "nsPrintfCString.h"
 #include "nsIObserverService.h"
 
 #include "mozilla/ipc/BrowserProcessSubThread.h"
 #include "mozilla/ipc/EnvironmentMap.h"
+#include "mozilla/LinkedList.h"
 #include "mozilla/Omnijar.h"
 #include "mozilla/RecordReplay.h"
 #include "mozilla/RDDProcessHost.h"
 #include "mozilla/Scoped.h"
 #include "mozilla/Services.h"
 #include "mozilla/SharedThreadPool.h"
 #include "mozilla/StaticMutex.h"
 #include "mozilla/Telemetry.h"
@@ -97,16 +98,21 @@ using mozilla::ScopedPRFileDesc;
 #  include "mozilla/jni/Refs.h"
 #  include "mozilla/jni/Utils.h"
 #endif
 
 static bool ShouldHaveDirectoryService() {
   return GeckoProcessType_Default == XRE_GetProcessType();
 }
 
+mozilla::StaticAutoPtr<mozilla::LinkedList<GeckoChildProcessHost>>
+    GeckoChildProcessHost::sGeckoChildProcessHosts;
+
+mozilla::StaticMutex GeckoChildProcessHost::sMutex;
+
 GeckoChildProcessHost::GeckoChildProcessHost(GeckoProcessType aProcessType,
                                              bool aIsFileContent)
     : mProcessType(aProcessType),
       mIsFileContent(aIsFileContent),
       mMonitor("mozilla.ipc.GeckChildProcessHost.mMonitor"),
       mLaunchOptions(MakeUnique<base::LaunchOptions>()),
       mProcessState(CREATING_CHANNEL),
 #ifdef XP_WIN
@@ -117,16 +123,21 @@ GeckoChildProcessHost::GeckoChildProcess
       mSandboxLevel(0),
 #endif
       mChildProcessHandle(0),
 #if defined(MOZ_WIDGET_COCOA)
       mChildTask(MACH_PORT_NULL),
 #endif
       mDestroying(false) {
   MOZ_COUNT_CTOR(GeckoChildProcessHost);
+  StaticMutexAutoLock lock(sMutex);
+  if (!sGeckoChildProcessHosts) {
+    sGeckoChildProcessHosts = new mozilla::LinkedList<GeckoChildProcessHost>();
+  }
+  sGeckoChildProcessHosts->insertBack(this);
 }
 
 GeckoChildProcessHost::~GeckoChildProcessHost()
 
 {
   AssertIOThread();
   MOZ_RELEASE_ASSERT(mDestroying);
 
@@ -163,18 +174,29 @@ GeckoChildProcessHost::~GeckoChildProces
 #if defined(MOZ_SANDBOX) && defined(XP_WIN)
   if (mSandboxBroker) {
     mSandboxBroker->Shutdown();
     mSandboxBroker = nullptr;
   }
 #endif
 }
 
+void GeckoChildProcessHost::RemoveFromProcessList() {
+  StaticMutexAutoLock lock(sMutex);
+  if (!sGeckoChildProcessHosts) {
+    return;
+  }
+  LinkedListElement<GeckoChildProcessHost>::removeFrom(
+      *sGeckoChildProcessHosts);
+}
+
 void GeckoChildProcessHost::Destroy() {
   MOZ_RELEASE_ASSERT(!mDestroying);
+  // We can remove from the list before it's really destroyed
+  RemoveFromProcessList();
   RefPtr<HandlePromise> whenReady = mHandlePromise;
 
   if (!whenReady) {
     // AsyncLaunch not called yet, so dispatch immediately.
     whenReady = HandlePromise::CreateAndReject(LaunchError{}, __func__);
   }
 
   using Value = HandlePromise::ResolveOrRejectValue;
@@ -1454,8 +1476,18 @@ bool GeckoChildProcessHost::StartMacSand
     default:
       return true;
   }
   return mozilla::StartMacSandboxIfEnabled(sandboxType, aArgc, aArgv,
                                            aErrorMessage);
 }
 
 #endif /* XP_MACOSX && MOZ_SANDBOX */
+
+/* static */
+void GeckoChildProcessHost::GetAll(const GeckoProcessCallback& aCallback) {
+  StaticMutexAutoLock lock(sMutex);
+  for (GeckoChildProcessHost* gp = sGeckoChildProcessHosts->getFirst(); gp;
+       gp = static_cast<mozilla::LinkedListElement<GeckoChildProcessHost>*>(gp)
+                ->getNext()) {
+    aCallback(gp);
+  }
+}
--- a/ipc/glue/GeckoChildProcessHost.h
+++ b/ipc/glue/GeckoChildProcessHost.h
@@ -9,16 +9,17 @@
 
 #include "base/file_path.h"
 #include "base/process_util.h"
 #include "base/waitable_event.h"
 #include "chrome/common/child_process_host.h"
 
 #include "mozilla/ipc/FileDescriptor.h"
 #include "mozilla/Atomics.h"
+#include "mozilla/LinkedList.h"
 #include "mozilla/Monitor.h"
 #include "mozilla/MozPromise.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/UniquePtr.h"
 
 #include "nsCOMPtr.h"
 #include "nsXULAppAPI.h"  // for GeckoProcessType
 #include "nsString.h"
@@ -32,17 +33,18 @@
 #endif
 
 struct _MacSandboxInfo;
 typedef _MacSandboxInfo MacSandboxInfo;
 
 namespace mozilla {
 namespace ipc {
 
-class GeckoChildProcessHost : public ChildProcessHost {
+class GeckoChildProcessHost : public ChildProcessHost,
+                              public LinkedListElement<GeckoChildProcessHost> {
  protected:
   typedef mozilla::Monitor Monitor;
   typedef std::vector<std::string> StringVector;
 
  public:
   typedef base::ProcessHandle ProcessHandle;
 
   explicit GeckoChildProcessHost(GeckoProcessType aProcessType,
@@ -148,20 +150,25 @@ class GeckoChildProcessHost : public Chi
 
   // The sandbox type that will be use when sandboxing is
   // enabled in the derived class and FillMacSandboxInfo
   // has not been overridden.
   static MacSandboxType GetDefaultMacSandboxType() {
     return MacSandboxType_Utility;
   };
 #endif
+  typedef std::function<void(GeckoChildProcessHost*)> GeckoProcessCallback;
+
+  // Iterates over all instances and calls aCallback with each one of them.
+  // This method will lock any addition/removal of new processes
+  // so you need to make sure the callback is as fast as possible.
+  static void GetAll(const GeckoProcessCallback& aCallback);
 
  protected:
   ~GeckoChildProcessHost();
-
   GeckoProcessType mProcessType;
   bool mIsFileContent;
   Monitor mMonitor;
   FilePath mProcessPath;
   // GeckoChildProcessHost holds the launch options so they can be set
   // up on the main thread using main-thread-only APIs like prefs, and
   // then used for the actual launch on another thread.  This pointer
   // is set to null to free the options after the child is launched.
@@ -236,16 +243,19 @@ class GeckoChildProcessHost : public Chi
 
   static BinPathType GetPathToBinary(FilePath& exePath,
                                      GeckoProcessType processType);
 
   // The buffer is passed to preserve its lifetime until we are done
   // with launching the sub-process.
   void GetChildLogName(const char* origLogName, nsACString& buffer);
 
+  // Removes the instance from sGeckoChildProcessHosts
+  void RemoveFromProcessList();
+
   // In between launching the subprocess and handing off its IPC
   // channel, there's a small window of time in which *we* might still
   // be the channel listener, and receive messages.  That's bad
   // because we have no idea what to do with those messages.  So queue
   // them here until we hand off the eventual listener.
   //
   // FIXME/cjones: this strongly indicates bad design.  Shame on us.
   std::queue<IPC::Message> mQueue;
@@ -253,17 +263,19 @@ class GeckoChildProcessHost : public Chi
   // Set this up before we're called from a different thread.
 #if defined(OS_LINUX)
   nsCString mTmpDirName;
 #endif
 
   mozilla::Atomic<bool> mDestroying;
 
   static uint32_t sNextUniqueID;
-
+  static StaticAutoPtr<LinkedList<GeckoChildProcessHost>>
+      sGeckoChildProcessHosts;
+  static StaticMutex sMutex;
 #if defined(MOZ_WIDGET_ANDROID)
   void LaunchAndroidService(
       const char* type, const std::vector<std::string>& argv,
       const base::file_handle_mapping_vector& fds_to_remap,
       ProcessHandle* process_handle);
 #endif  // defined(MOZ_WIDGET_ANDROID)
 };
 
--- a/widget/ProcInfo.h
+++ b/widget/ProcInfo.h
@@ -19,24 +19,26 @@ class GeckoChildProcessHost;
 // Process types
 enum class ProcType {
   // These must match the ones in ContentParent.h and E10SUtils.jsm
   Web,
   File,
   Extension,
   PrivilegedAbout,
   WebLargeAllocation,
-  // GPU process (only on Windows)
-  Gpu,
-  // RDD process (Windows and macOS)
-  Rdd,
-  // Socket process
+  // the rest matches GeckoProcessTypes.h
+  Browser,  // Default is named Browser here
+  Plugin,
+  IPDLUnitTest,
+  GMPlugin,
+  GPU,
+  VR,
+  RDD,
   Socket,
-  // Main process
-  Browser,
+  RemoteSandboxBroker,
   // Unknown type of process
   Unknown
 };
 
 struct ThreadInfo {
   // Thread Id.
   base::ProcessId tid = 0;
   // Thread name, if any.
@@ -71,14 +73,19 @@ struct ProcInfo {
 typedef MozPromise<ProcInfo, nsresult, true> ProcInfoPromise;
 
 /*
  * GetProcInfo() uses a background thread to perform system calls.
  *
  * Depending on the platform, this call can be quite expensive and the
  * promise may return after several ms.
  */
-RefPtr<ProcInfoPromise> GetProcInfo(
-    base::ProcessId pid, int32_t childId, const ProcType& type,
-    ipc::GeckoChildProcessHost* childProcess = nullptr);
+#ifdef XP_MACOSX
+RefPtr<ProcInfoPromise> GetProcInfo(base::ProcessId pid, int32_t childId,
+                                    const ProcType& type,
+                                    mach_port_t aChildTask = MACH_PORT_NULL);
+#else
+RefPtr<ProcInfoPromise> GetProcInfo(base::ProcessId pid, int32_t childId,
+                                    const ProcType& type);
+#endif
 
 }  // namespace mozilla
 #endif  // ProcInfo_h
--- a/widget/android/ProcInfo.cpp
+++ b/widget/android/ProcInfo.cpp
@@ -5,15 +5,14 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/ProcInfo.h"
 #include "mozilla/ipc/GeckoChildProcessHost.h"
 
 namespace mozilla {
 
 RefPtr<ProcInfoPromise> GetProcInfo(base::ProcessId pid, int32_t childId,
-                                    const ProcType& type,
-                                    ipc::GeckoChildProcessHost* childProcess) {
+                                    const ProcType& type) {
   // Not implemented on Android.
   return nullptr;
 }
 
 }  // namespace mozilla
--- a/widget/cocoa/ProcInfo.mm
+++ b/widget/cocoa/ProcInfo.mm
@@ -15,34 +15,29 @@
 
 #include <libproc.h>
 #include <sys/sysctl.h>
 #include <mach/mach.h>
 
 namespace mozilla {
 
 RefPtr<ProcInfoPromise> GetProcInfo(base::ProcessId pid, int32_t childId, const ProcType& type,
-                                    ipc::GeckoChildProcessHost* childProcess) {
+                                    mach_port_t aChildTask) {
   auto holder = MakeUnique<MozPromiseHolder<ProcInfoPromise>>();
   RefPtr<ProcInfoPromise> promise = holder->Ensure(__func__);
 
   nsresult rv = NS_OK;
   nsCOMPtr<nsIEventTarget> target = do_GetService(NS_STREAMTRANSPORTSERVICE_CONTRACTID, &rv);
   if (NS_FAILED(rv)) {
     NS_WARNING("Failed to get stream transport service");
     holder->Reject(rv, __func__);
     return promise;
   }
 
-  mach_port_t task = MACH_PORT_NULL;
-  if (childProcess && childProcess->GetChildTask() != MACH_PORT_NULL) {
-    task = childProcess->GetChildTask();
-  }
-
-  auto ResolveGetProcinfo = [holder = std::move(holder), pid, type, childId, task]() {
+  auto ResolveGetProcinfo = [holder = std::move(holder), pid, type, childId, aChildTask]() {
     ProcInfo info;
     info.pid = pid;
     info.childId = childId;
     info.type = type;
     struct proc_bsdinfo proc;
     if ((unsigned long)proc_pidinfo(pid, PROC_PIDTBSDINFO, 0, &proc, PROC_PIDTBSDINFO_SIZE) <
         PROC_PIDTBSDINFO_SIZE) {
       holder->Reject(NS_ERROR_FAILURE, __func__);
@@ -61,20 +56,20 @@ RefPtr<ProcInfoPromise> GetProcInfo(base
     info.virtualMemorySize = pti.pti_virtual_size;
     info.residentSetSize = pti.pti_resident_size;
     info.cpuUser = pti.pti_total_user;
     info.cpuKernel = pti.pti_total_system;
 
     // Now getting threads info
     mach_port_t selectedTask;
     // If we did not get a task from a child process, we use mach_task_self()
-    if (task == MACH_PORT_NULL) {
+    if (aChildTask == MACH_PORT_NULL) {
       selectedTask = mach_task_self();
     } else {
-      selectedTask = task;
+      selectedTask = aChildTask;
     }
     // task_threads() gives us a snapshot of the process threads
     // but those threads can go away. All the code below makes
     // the assumption that thread_info() calls may fail, and
     // these errors will be ignored.
     thread_act_port_array_t threadList;
     mach_msg_type_number_t threadCount;
     kern_return_t kret = task_threads(selectedTask, &threadList, &threadCount);
--- a/widget/gtk/ProcInfo.cpp
+++ b/widget/gtk/ProcInfo.cpp
@@ -203,18 +203,17 @@ class ThreadInfoReader final : public St
     return NS_OK;
   }
 
  private:
   base::ProcessId mTid;
 };
 
 RefPtr<ProcInfoPromise> GetProcInfo(base::ProcessId pid, int32_t childId,
-                                    const ProcType& type,
-                                    ipc::GeckoChildProcessHost* childProcess) {
+                                    const ProcType& type) {
   auto holder = MakeUnique<MozPromiseHolder<ProcInfoPromise>>();
   RefPtr<ProcInfoPromise> promise = holder->Ensure(__func__);
   nsresult rv = NS_OK;
   nsCOMPtr<nsIEventTarget> target =
       do_GetService(NS_STREAMTRANSPORTSERVICE_CONTRACTID, &rv);
   if (NS_FAILED(rv)) {
     NS_WARNING("Failed to get stream transport service");
     holder->Reject(rv, __func__);
--- a/widget/windows/ProcInfo.cpp
+++ b/widget/windows/ProcInfo.cpp
@@ -68,18 +68,17 @@ void AppendThreads(ProcInfo* info) {
       thread.cpuKernel = ToNanoSeconds(kernelTime);
       thread.cpuUser = ToNanoSeconds(userTime);
       info->threads.AppendElement(thread);
     }
   } while (Thread32Next(hThreadSnap.get(), &te32));
 }
 
 RefPtr<ProcInfoPromise> GetProcInfo(base::ProcessId pid, int32_t childId,
-                                    const ProcType& type,
-                                    ipc::GeckoChildProcessHost* childProcess) {
+                                    const ProcType& type) {
   auto holder = MakeUnique<MozPromiseHolder<ProcInfoPromise>>();
   RefPtr<ProcInfoPromise> promise = holder->Ensure(__func__);
 
   nsresult rv = NS_OK;
   nsCOMPtr<nsIEventTarget> target =
       do_GetService(NS_STREAMTRANSPORTSERVICE_CONTRACTID, &rv);
   if (NS_FAILED(rv)) {
     NS_WARNING("Failed to get stream transport service");
--- a/xpcom/build/GeckoProcessTypes.h
+++ b/xpcom/build/GeckoProcessTypes.h
@@ -15,17 +15,18 @@
 // use this value directly, but rather use XRE_GetChildProcBinPathType to
 // resolve this).
 //
 // The values generated for the GeckoProcessType enum are dependent on
 // the ordering of the GECKO_PROCESS_TYPE invocations in this file, and
 // said values are exposed to things like telemetry as well, so please
 // do not reorder lines in this file.
 //
-// Please add new process types at the end of this list.
+// Please add new process types at the end of this list
+// and update widget/ProcInfo.h
 GECKO_PROCESS_TYPE(Default, "default", Parent, Self)
 GECKO_PROCESS_TYPE(Plugin, "plugin", Plugin, PluginContainer)
 GECKO_PROCESS_TYPE(Content, "tab", Content, Self)
 GECKO_PROCESS_TYPE(IPDLUnitTest, "ipdlunittest", IPDLUnitTest, PluginContainer)
 // Gecko Media Plugin process.
 GECKO_PROCESS_TYPE(GMPlugin, "gmplugin", GMPlugin, PluginContainer)
 // GPU and compositor process.
 GECKO_PROCESS_TYPE(GPU, "gpu", GPU, Self)