Bug 1577819, part 3 - Initialize process type in RequestProcInfo. r=Ehsan
authorAndrew McCreight <continuation@gmail.com>
Fri, 30 Aug 2019 21:52:40 +0000
changeset 551471 a9ac86bbe8d0bdec01fecf09827514a780142e57
parent 551470 dd470e3dff60dc0e8e7f874cd95d3580503bb4e0
child 551472 98059acdf5be3f6b91a14e5700403432dd998ab8
push id11865
push userbtara@mozilla.com
push dateMon, 02 Sep 2019 08:54:37 +0000
treeherdermozilla-beta@37f59c4671b3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersEhsan
bugs1577819
milestone70.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 1577819, part 3 - Initialize process type in RequestProcInfo. r=Ehsan Right now, the type ends up being uninitialized if the type doesn't match, in the GeckoProcessType_Content case. Differential Revision: https://phabricator.services.mozilla.com/D44213
dom/base/ChromeUtils.cpp
--- a/dom/base/ChromeUtils.cpp
+++ b/dom/base/ChromeUtils.cpp
@@ -739,17 +739,17 @@ already_AddRefed<Promise> ChromeUtils::R
                     mozilla::ipc::GeckoChildProcessHost* aGeckoProcess) {
                   if (!aGeckoProcess->GetChildProcessHandle()) {
                     return;
                   }
 
                   base::ProcessId childPid =
                       base::GetProcId(aGeckoProcess->GetChildProcessHandle());
                   int32_t childId = 0;
-                  mozilla::ProcType type;
+                  mozilla::ProcType type = mozilla::ProcType::Unknown;
                   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) {
@@ -800,17 +800,18 @@ already_AddRefed<Promise> ChromeUtils::R
                       break;
                     case GeckoProcessType::GeckoProcessType_Socket:
                       type = mozilla::ProcType::Socket;
                       break;
                     case GeckoProcessType::GeckoProcessType_RemoteSandboxBroker:
                       type = mozilla::ProcType::RemoteSandboxBroker;
                       break;
                     default:
-                      type = mozilla::ProcType::Unknown;
+                      // Leave the default Unknown value in |type|.
+                      break;
                   }
 
                   promises.AppendElement(
 #ifdef XP_MACOSX
                       mozilla::GetProcInfo(childPid, childId, type,
                                            aGeckoProcess->GetChildTask())
 #else
                       mozilla::GetProcInfo(childPid, childId, type)