Bug 804430 - Added list of whitelisted locked prefs to about:support. r=Unfocused
☠☠ backed out by 17402b39be24 ☠ ☠
authorBernardo P. Rittmeyer <bernardo@rittme.com>
Thu, 05 Jun 2014 02:47:00 +1200
changeset 206633 84a0967ba12de8ede5bea38638bf8f00c1a4ecf0
parent 206632 71494b7a518aeb59662dfb29a9594f106df03c54
child 206634 17402b39be2440bd46c75fbb65c56a7ff4a2a5f3
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersUnfocused
bugs804430
milestone32.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 804430 - Added list of whitelisted locked prefs to about:support. r=Unfocused
toolkit/content/aboutSupport.js
toolkit/content/aboutSupport.xhtml
toolkit/locales/en-US/chrome/global/aboutSupport.dtd
toolkit/modules/Troubleshoot.jsm
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -143,16 +143,27 @@ let snapshotFormatters = {
           // copy and paste them into some text editors.  Long values generally
           // aren't useful anyway, so truncate them to a reasonable length.
           $.new("td", String(value).substr(0, 120), "pref-value"),
         ]);
       }
     ));
   },
 
+  lockedPreferences: function lockedPreferences(data) {
+    $.append($("locked-prefs-tbody"), sortedArrayFromObject(data).map(
+      function ([name, value]) {
+        return $.new("tr", [
+          $.new("td", name, "pref-name"),
+          $.new("td", String(value).substr(0, 120), "pref-value"),
+        ]);
+      }
+    ));
+  },
+
   graphics: function graphics(data) {
     // graphics-info-properties tbody
     if ("info" in data) {
       let trs = sortedArrayFromObject(data.info).map(function ([prop, val]) {
         return $.new("tr", [
           $.new("th", prop, "column"),
           $.new("td", String(val)),
         ]);
--- a/toolkit/content/aboutSupport.xhtml
+++ b/toolkit/content/aboutSupport.xhtml
@@ -259,16 +259,37 @@
       </table>
 
       <section id="prefs-user-js-section" class="hidden no-copy">
         <h3>&aboutSupport.userJSTitle;</h3>
         <p>&aboutSupport.userJSDescription;</p>
       </section>
 
       <!-- - - - - - - - - - - - - - - - - - - - - -->
+
+      <h2 class="major-section">
+        &aboutSupport.lockedKeyPrefsTitle;
+      </h2>
+
+      <table class="prefs-table">
+        <thead class="no-copy">
+          <th class="name">
+            &aboutSupport.lockedPrefsName;
+          </th>
+
+          <th class="value">
+            &aboutSupport.lockedPrefsValue;
+          </th>
+        </thead>
+
+        <tbody id="locked-prefs-tbody">
+        </tbody>
+      </table>
+
+      <!-- - - - - - - - - - - - - - - - - - - - - -->
       <h2 class="major-section">
         &aboutSupport.jsTitle;
       </h2>
 
       <table>
         <tbody>
           <tr>
             <th class="column">
--- a/toolkit/locales/en-US/chrome/global/aboutSupport.dtd
+++ b/toolkit/locales/en-US/chrome/global/aboutSupport.dtd
@@ -66,16 +66,20 @@ variant of aboutSupport.showDir.label. -
 <!ENTITY aboutSupport.modifiedKeyPrefsTitle "Important Modified Preferences">
 <!ENTITY aboutSupport.modifiedPrefsName "Name">
 <!ENTITY aboutSupport.modifiedPrefsValue "Value">
 
 <!-- LOCALIZATION NOTE (aboutSupport.userJSTitle, aboutSupport.userJSDescription): user.js is the name of the preference override file being checked. -->
 <!ENTITY aboutSupport.userJSTitle "user.js Preferences">
 <!ENTITY aboutSupport.userJSDescription "Your profile folder contains a <a id='prefs-user-js-link'>user.js file</a>, which includes preferences that were not created by &brandShortName;.">
 
+<!ENTITY aboutSupport.lockedKeyPrefsTitle "Important Locked Preferences">
+<!ENTITY aboutSupport.lockedPrefsName "Name">
+<!ENTITY aboutSupport.lockedPrefsValue "Value">
+
 <!ENTITY aboutSupport.graphicsTitle "Graphics">
 
 <!ENTITY aboutSupport.jsTitle "JavaScript">
 <!ENTITY aboutSupport.jsIncrementalGC "Incremental GC">
 
 <!ENTITY aboutSupport.a11yTitle "Accessibility">
 <!ENTITY aboutSupport.a11yActivated "Activated">
 <!ENTITY aboutSupport.a11yForceDisabled "Prevent Accessibility">
--- a/toolkit/modules/Troubleshoot.jsm
+++ b/toolkit/modules/Troubleshoot.jsm
@@ -209,16 +209,37 @@ let dataProviders = {
         if (Services.prefs.prefHasUserValue(name) &&
             !PREFS_BLACKLIST.some(function (re) re.test(name)))
           prefs[name] = getPref(name);
       });
       return prefs;
     }, {}));
   },
 
+  lockedPreferences: function lockedPreferences(done) {
+    function getPref(name) {
+      let table = {};
+      table[Ci.nsIPrefBranch.PREF_STRING] = "getCharPref";
+      table[Ci.nsIPrefBranch.PREF_INT] = "getIntPref";
+      table[Ci.nsIPrefBranch.PREF_BOOL] = "getBoolPref";
+      let type = Services.prefs.getPrefType(name);
+      if (!(type in table))
+        throw new Error("Unknown preference type " + type + " for " + name);
+      return Services.prefs[table[type]](name);
+    }
+    done(PREFS_WHITELIST.reduce(function (prefs, branch) {
+      Services.prefs.getChildList(branch).forEach(function (name) {
+        if (Services.prefs.prefIsLocked(name) &&
+            !PREFS_BLACKLIST.some(function (re) re.test(name)))
+          prefs[name] = getPref(name);
+      });
+      return prefs;
+    }, {}));
+  },
+
   graphics: function graphics(done) {
     function statusMsgForFeature(feature) {
       // We return an array because in the tryNewerDriver case we need to
       // include the suggested version, which the consumer likely needs to plug
       // into a format string from a localization file.  Rather than returning
       // a string in some cases and an array in others, return an array always.
       let msg = [""];
       try {