Bug 1038245 - Add multiprocess field to about:support (r=felipe)
authorBill McCloskey <wmccloskey@mozilla.com>
Wed, 16 Jul 2014 23:06:06 -0700
changeset 216476 6094dd25da95dd73232dddf1472bcb717e80f7f6
parent 216475 37184d8682dbf89d1a4b15e2f64aa5748847a6d7
child 216477 c259eb48968020f6ae04ffed8832054c3f4ecba8
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe
bugs1038245
milestone33.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 1038245 - Add multiprocess field to about:support (r=felipe)
toolkit/content/aboutSupport.js
toolkit/content/aboutSupport.xhtml
toolkit/locales/en-US/chrome/global/aboutSupport.dtd
toolkit/modules/Troubleshoot.jsm
toolkit/modules/tests/browser/browser_Troubleshoot.js
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -34,16 +34,17 @@ let snapshotFormatters = {
   application: function application(data) {
     $("application-box").textContent = data.name;
     $("useragent-box").textContent = data.userAgent;
     $("supportLink").href = data.supportURL;
     let version = data.version;
     if (data.vendor)
       version += " (" + data.vendor + ")";
     $("version-box").textContent = version;
+    $("multiprocess-box").textContent = data.numRemoteWindows + "/" + data.numTotalWindows;
   },
 
 #ifdef MOZ_CRASHREPORTER
   crashes: function crashes(data) {
     let strings = stringBundle();
     let daysRange = Troubleshoot.kMaxCrashAge / (24 * 60 * 60 * 1000);
     $("crashes-title").textContent =
       PluralForm.get(daysRange, strings.GetStringFromName("crashesTitle"))
--- a/toolkit/content/aboutSupport.xhtml
+++ b/toolkit/content/aboutSupport.xhtml
@@ -158,16 +158,25 @@
               &aboutSupport.appBasicsMemoryUse;
             </th>
 
             <td>
               <a href="about:memory">about:memory</a>
             </td>
           </tr>
 
+          <tr>
+            <th class="column">
+              &aboutSupport.appBasicsMultiProcessSupport;
+            </th>
+
+            <td id="multiprocess-box">
+            </td>
+          </tr>
+
         </tbody>
       </table>
 
       <!-- - - - - - - - - - - - - - - - - - - - - -->
 #ifdef MOZ_CRASHREPORTER
 
       <h2 class="major-section" id="crashes-title">
         &aboutSupport.crashes.title;
--- a/toolkit/locales/en-US/chrome/global/aboutSupport.dtd
+++ b/toolkit/locales/en-US/chrome/global/aboutSupport.dtd
@@ -49,16 +49,18 @@ This is the Windows- and Mac-specific va
 Windows/Mac use the term "Folder" instead of "Directory" -->
 <!ENTITY aboutSupport.appBasicsProfileDirWinMac "Profile Folder">
 
 <!ENTITY aboutSupport.appBasicsEnabledPlugins "Enabled Plugins">
 <!ENTITY aboutSupport.appBasicsBuildConfig "Build Configuration">
 <!ENTITY aboutSupport.appBasicsUserAgent "User Agent">
 <!ENTITY aboutSupport.appBasicsMemoryUse "Memory Use">
 
+<!ENTITY aboutSupport.appBasicsMultiProcessSupport "Multiprocess Windows">
+
 <!ENTITY aboutSupport.showDir.label "Open Directory">
 <!-- LOCALIZATION NOTE (aboutSupport.showMac.label): This is the Mac-specific
 variant of aboutSupport.showDir.label.  This allows us to use the preferred
 "Finder" terminology on Mac. -->
 <!ENTITY aboutSupport.showMac.label "Show in Finder">
 <!-- LOCALIZATION NOTE (aboutSupport.showWin.label): This is the Windows-specific
 variant of aboutSupport.showDir.label. -->
 <!ENTITY aboutSupport.showWin.label "Show Folder">
--- a/toolkit/modules/Troubleshoot.jsm
+++ b/toolkit/modules/Troubleshoot.jsm
@@ -140,16 +140,32 @@ let dataProviders = {
     }
     catch (e) {}
     let urlFormatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].
                        getService(Ci.nsIURLFormatter);
     try {
       data.supportURL = urlFormatter.formatURLPref("app.support.baseURL");
     }
     catch (e) {}
+
+    data.numTotalWindows = 0;
+    data.numRemoteWindows = 0;
+    let winEnumer = Services.ww.getWindowEnumerator("navigator:browser");
+    while (winEnumer.hasMoreElements()) {
+      data.numTotalWindows++;
+      let remote = winEnumer.getNext().
+                   QueryInterface(Ci.nsIInterfaceRequestor).
+                   getInterface(Ci.nsIWebNavigation).
+                   QueryInterface(Ci.nsILoadContext).
+                   useRemoteTabs;
+      if (remote) {
+        data.numRemoteWindows++;
+      }
+    }
+
     done(data);
   },
 
 #ifdef MOZ_CRASHREPORTER
   crashes: function crashes(done) {
     let reports = CrashReports.getReports();
     let now = new Date();
     let reportsNew = reports.filter(report => (now - report.date < Troubleshoot.kMaxCrashAge));
--- a/toolkit/modules/tests/browser/browser_Troubleshoot.js
+++ b/toolkit/modules/tests/browser/browser_Troubleshoot.js
@@ -93,16 +93,22 @@ const SNAPSHOT_SCHEMA = {
           type: "string",
         },
         vendor: {
           type: "string",
         },
         supportURL: {
           type: "string",
         },
+        numTotalWindows: {
+          type: "number",
+        },
+        numRemoteWindows: {
+          type: "number",
+        },
       },
     },
     crashes: {
       required: false,
       type: "object",
       properties: {
         pending: {
           required: true,