Bug 1383088 - PREF_SSL_IMPACT array declaration made into inline. r=johannh
authorprasanthp96 <prasanthmani2010@gmail.com>
Thu, 27 Jul 2017 23:05:26 +0530
changeset 376072 d824da178034c8bce09ac5b9236d0c90101a457a
parent 376071 f63a7cba6c08cc4fe68678ed264818f2130ea39d
child 376073 04bd1ff1c8dd5d8390f524d2f42f56a7f4e46ec9
push id32372
push userarchaeopteryx@coole-files.de
push dateTue, 22 Aug 2017 09:49:24 +0000
treeherdermozilla-central@eb72c8c07751 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh
bugs1383088
milestone57.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 1383088 - PREF_SSL_IMPACT array declaration made into inline. r=johannh MozReview-Commit-ID: JnyZYPzI9hw
browser/base/content/browser.js
browser/base/content/content.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -2897,20 +2897,16 @@ function PageProxyClickHandler(aEvent) {
 // Values for telemtery bins: see TLS_ERROR_REPORT_UI in Histograms.json
 const TLS_ERROR_REPORT_TELEMETRY_AUTO_CHECKED   = 2;
 const TLS_ERROR_REPORT_TELEMETRY_AUTO_UNCHECKED = 3;
 const TLS_ERROR_REPORT_TELEMETRY_MANUAL_SEND    = 4;
 const TLS_ERROR_REPORT_TELEMETRY_AUTO_SEND      = 5;
 
 const PREF_SSL_IMPACT_ROOTS = ["security.tls.version.", "security.ssl3."];
 
-const PREF_SSL_IMPACT = PREF_SSL_IMPACT_ROOTS.reduce((prefs, root) => {
-  return prefs.concat(Services.prefs.getChildList(root));
-}, []);
-
 /**
  * Handle command events bubbling up from error page content
  * or from about:newtab or from remote error pages that invoke
  * us via async messaging.
  */
 var BrowserOnClick = {
   init() {
     let mm = window.messageManager;
@@ -2977,17 +2973,20 @@ var BrowserOnClick = {
         }
       break;
       case "Browser:SendSSLErrorReport":
         this.onSSLErrorReport(msg.target,
                               msg.data.uri,
                               msg.data.securityInfo);
       break;
       case "Browser:ResetSSLPreferences":
-        for (let prefName of PREF_SSL_IMPACT) {
+        let prefSSLImpact = PREF_SSL_IMPACT_ROOTS.reduce((prefs, root) => {
+                return prefs.concat(Services.prefs.getChildList(root));
+        }, []);
+        for (let prefName of prefSSLImpact) {
           Services.prefs.clearUserPref(prefName);
         }
         msg.target.reload();
       break;
       case "Browser:SetSSLErrorReportAuto":
         Services.prefs.setBoolPref("security.ssl.errorReporting.automatic", msg.json.automatic);
         let bin = TLS_ERROR_REPORT_TELEMETRY_AUTO_UNCHECKED;
         if (msg.json.automatic) {
--- a/browser/base/content/content.js
+++ b/browser/base/content/content.js
@@ -231,19 +231,16 @@ const SEC_ERROR_OCSP_FUTURE_RESPONSE    
 const SEC_ERROR_OCSP_OLD_RESPONSE                  = SEC_ERROR_BASE + 132;
 const MOZILLA_PKIX_ERROR_NOT_YET_VALID_CERTIFICATE = MOZILLA_PKIX_ERROR_BASE + 5;
 const MOZILLA_PKIX_ERROR_NOT_YET_VALID_ISSUER_CERTIFICATE = MOZILLA_PKIX_ERROR_BASE + 6;
 
 const PREF_BLOCKLIST_CLOCK_SKEW_SECONDS = "services.blocklist.clock_skew_seconds";
 
 const PREF_SSL_IMPACT_ROOTS = ["security.tls.version.", "security.ssl3."];
 
-const PREF_SSL_IMPACT = PREF_SSL_IMPACT_ROOTS.reduce((prefs, root) => {
-  return prefs.concat(Services.prefs.getChildList(root));
-}, []);
 
 /**
  * Retrieve the array of CSS selectors corresponding to the provided node. The first item
  * of the array is the selector of the node in its owner document. Additional items are
  * used if the node is inside a frame, each representing the CSS selector for finding the
  * frame element in its parent document.
  *
  * This format is expected by DevTools in order to handle the Inspect Node context menu
@@ -497,17 +494,20 @@ var AboutNetAndCertErrorListener = {
       break;
     case "AboutNetErrorResetPreferences":
       this.onResetPreferences(aEvent);
       break;
     }
   },
 
   changedCertPrefs() {
-    for (let prefName of PREF_SSL_IMPACT) {
+    let prefSSLImpact = PREF_SSL_IMPACT_ROOTS.reduce((prefs, root) => {
+       return prefs.concat(Services.prefs.getChildList(root));
+    }, []);
+    for (let prefName of prefSSLImpact) {
       if (Services.prefs.prefHasUserValue(prefName)) {
         return true;
       }
     }
 
     return false;
   },