Bug 1381175 - Display count of web content processes in about:support. r=mrbkap a=jcristau
authorFelipe Gomes <felipc@gmail.com>
Fri, 14 Jul 2017 20:33:07 -0300
changeset 414390 289f6e190f41c65a1099f71f37f0e657b2c7f16e
parent 414389 5d2df466e65ab1423579ad581e0473dcf533c135
child 414391 293c0a44fda7e1b2f895d18a6411275172269d50
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap, jcristau
bugs1381175
milestone55.0
Bug 1381175 - Display count of web content processes in about:support. r=mrbkap a=jcristau MozReview-Commit-ID: BISSHI9XLVD
toolkit/content/aboutSupport.js
toolkit/content/aboutSupport.xhtml
toolkit/modules/Troubleshoot.jsm
toolkit/modules/tests/browser/browser_Troubleshoot.js
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -67,16 +67,24 @@ var snapshotFormatters = {
       case 10:
         statusText = (Services.appinfo.OS == "Darwin" ? "OS X 10.6 - 10.8" : "Windows XP");
         break;
     }
 
     $("multiprocess-box").textContent = strings.formatStringFromName("multiProcessWindows",
       [data.numRemoteWindows, data.numTotalWindows, statusText], 3);
 
+    if (data.remoteAutoStart) {
+      $("contentprocesses-box").textContent = data.currentContentProcesses +
+                                              "/" +
+                                              data.maxContentProcesses;
+    } else {
+      $("contentprocesses-row").hidden = true;
+    }
+
     let keyGoogleFound = data.keyGoogleFound ? "found" : "missing";
     $("key-google-box").textContent = strings.GetStringFromName(keyGoogleFound);
 
     let keyMozillaFound = data.keyMozillaFound ? "found" : "missing";
     $("key-mozilla-box").textContent = strings.GetStringFromName(keyMozillaFound);
 
     $("safemode-box").textContent = data.safeMode;
   },
--- a/toolkit/content/aboutSupport.xhtml
+++ b/toolkit/content/aboutSupport.xhtml
@@ -223,16 +223,25 @@
             <th class="column">
               &aboutSupport.appBasicsMultiProcessSupport;
             </th>
 
             <td id="multiprocess-box">
             </td>
           </tr>
 
+          <tr id="contentprocesses-row">
+            <th class="column">
+              Web Content Processes
+            </th>
+
+            <td id="contentprocesses-box">
+            </td>
+          </tr>
+
           <tr>
             <th class="column">
               &aboutSupport.appBasicsKeyGoogle;
             </th>
 
             <td id="key-google-box">
             </td>
           </tr>
--- a/toolkit/modules/Troubleshoot.jsm
+++ b/toolkit/modules/Troubleshoot.jsm
@@ -207,16 +207,23 @@ var dataProviders = {
                    useRemoteTabs;
       if (remote) {
         data.numRemoteWindows++;
       }
     }
 
     data.remoteAutoStart = Services.appinfo.browserTabsRemoteAutostart;
 
+    // Services.ppmm.childCount is a count of how many processes currently
+    // exist that might respond to messages sent through the ppmm, including
+    // the parent process. So we subtract the parent process with the "- 1",
+    // and that’s how many content processes we’re waiting for.
+    data.currentContentProcesses = Services.ppmm.childCount - 1;
+    data.maxContentProcesses = Services.appinfo.maxWebProcessCount;
+
     try {
       let e10sStatus = Cc["@mozilla.org/supports-PRUint64;1"]
                          .createInstance(Ci.nsISupportsPRUint64);
       let appinfo = Services.appinfo.QueryInterface(Ci.nsIObserver);
       appinfo.observe(e10sStatus, "getE10SBlocked", "");
       data.autoStartStatus = e10sStatus.data;
     } catch (e) {
       data.autoStartStatus = -1;
--- a/toolkit/modules/tests/browser/browser_Troubleshoot.js
+++ b/toolkit/modules/tests/browser/browser_Troubleshoot.js
@@ -133,16 +133,22 @@ const SNAPSHOT_SCHEMA = {
           type: "number",
         },
         numTotalWindows: {
           type: "number",
         },
         numRemoteWindows: {
           type: "number",
         },
+        currentContentProcesses: {
+          type: "number",
+        },
+        maxContentProcesses: {
+          type: "number",
+        },
         keyGoogleFound: {
           type: "boolean",
         },
         keyMozillaFound: {
           type: "boolean",
         },
         safeMode: {
           type: "boolean",