client code for Bug 1315506 - Remove app.update.url.override preference. r=mhowell
authorRobert Strong <robert.bugzilla@gmail.com>
Fri, 11 Nov 2016 12:58:47 -0800
changeset 322298 355cce73963e81b06fc2e51b4981bc072709c6a1
parent 322297 993e106e331fc0a212e2c98837c21d35d6cb6614
child 322299 2047f4b419bf3b059e6d26b2ac2f5357b551f0ad
push id30945
push usercbook@mozilla.com
push dateMon, 14 Nov 2016 09:22:29 +0000
treeherdermozilla-central@1196bf3032e1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhowell
bugs1315506
milestone52.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
client code for Bug 1315506 - Remove app.update.url.override preference. r=mhowell
browser/app/profile/firefox.js
toolkit/components/telemetry/Histograms.json
toolkit/components/telemetry/histogram-whitelists.json
toolkit/mozapps/update/UpdateTelemetry.jsm
toolkit/mozapps/update/nsUpdateService.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -133,19 +133,16 @@ pref("app.update.badge", false);
 // when it finishes downloading them.
 pref("app.update.staging.enabled", true);
 
 // Update service URL:
 pref("app.update.url", "https://aus5.mozilla.org/update/6/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%SYSTEM_CAPABILITIES%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");
 // app.update.url.manual is in branding section
 // app.update.url.details is in branding section
 
-// User-settable override to app.update.url for testing purposes.
-//pref("app.update.url.override", "");
-
 // app.update.interval is in branding section
 // app.update.promptWaitTime is in branding section
 
 // Show the Update Checking/Ready UI when the user was idle for x seconds
 pref("app.update.idletime", 60);
 
 // Whether or not to attempt using the service for updates.
 #ifdef MOZ_MAINTENANCE_SERVICE
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -4660,30 +4660,16 @@
   },
   "UPDATE_CANNOT_STAGE_NOTIFY": {
     "alert_emails": ["application-update-telemetry-alerts@mozilla.com"],
     "expires_in_version": "never",
     "kind": "count",
     "releaseChannelCollection": "opt-out",
     "description": "Update: count of systems that cannot stage updates (timer initiated)"
   },
-  "UPDATE_HAS_PREF_URL_OVERRIDE_EXTERNAL": {
-    "alert_emails": ["application-update-telemetry-alerts@mozilla.com"],
-    "expires_in_version": "never",
-    "kind": "count",
-    "releaseChannelCollection": "opt-out",
-    "description": "Update: count of systems that have an app.update.url.override preference (externally initiated)"
-  },
-  "UPDATE_HAS_PREF_URL_OVERRIDE_NOTIFY": {
-    "alert_emails": ["application-update-telemetry-alerts@mozilla.com"],
-    "expires_in_version": "never",
-    "kind": "count",
-    "releaseChannelCollection": "opt-out",
-    "description": "Update: count of systems that have an app.update.url.override preference (timer initiated)"
-  },
   "UPDATE_PREF_UPDATE_CANCELATIONS_EXTERNAL": {
     "alert_emails": ["application-update-telemetry-alerts@mozilla.com"],
     "expires_in_version": "never",
     "kind": "enumerated",
     "n_values": 100,
     "releaseChannelCollection": "opt-out",
     "description": "Update: number of sequential update elevation request cancelations greater than 0 (externally initiated)"
   },
--- a/toolkit/components/telemetry/histogram-whitelists.json
+++ b/toolkit/components/telemetry/histogram-whitelists.json
@@ -1658,18 +1658,16 @@
     "UPDATE_CHECK_CODE_EXTERNAL",
     "UPDATE_CHECK_CODE_NOTIFY",
     "UPDATE_CHECK_EXTENDED_ERROR_EXTERNAL",
     "UPDATE_CHECK_EXTENDED_ERROR_NOTIFY",
     "UPDATE_CHECK_NO_UPDATE_EXTERNAL",
     "UPDATE_CHECK_NO_UPDATE_NOTIFY",
     "UPDATE_DOWNLOAD_CODE_COMPLETE",
     "UPDATE_DOWNLOAD_CODE_PARTIAL",
-    "UPDATE_HAS_PREF_URL_OVERRIDE_EXTERNAL",
-    "UPDATE_HAS_PREF_URL_OVERRIDE_NOTIFY",
     "UPDATE_INVALID_LASTUPDATETIME_EXTERNAL",
     "UPDATE_INVALID_LASTUPDATETIME_NOTIFY",
     "UPDATE_LAST_NOTIFY_INTERVAL_DAYS_EXTERNAL",
     "UPDATE_LAST_NOTIFY_INTERVAL_DAYS_NOTIFY",
     "UPDATE_NOT_PREF_UPDATE_AUTO_EXTERNAL",
     "UPDATE_NOT_PREF_UPDATE_AUTO_NOTIFY",
     "UPDATE_NOT_PREF_UPDATE_ENABLED_EXTERNAL",
     "UPDATE_NOT_PREF_UPDATE_ENABLED_NOTIFY",
--- a/toolkit/mozapps/update/UpdateTelemetry.jsm
+++ b/toolkit/mozapps/update/UpdateTelemetry.jsm
@@ -83,20 +83,16 @@ this.AUSTLMY = {
   // Unable to apply updates (manual install to update notification)
   CHK_UNABLE_TO_APPLY: 29,
   // Unable to check for updates due to no OS version (no notification)
   CHK_NO_OS_VERSION: 30,
   // Unable to check for updates due to no OS ABI (no notification)
   CHK_NO_OS_ABI: 31,
   // Invalid url for app.update.url default preference (no notification)
   CHK_INVALID_DEFAULT_URL: 32,
-  // Invalid url for app.update.url user preference (no notification)
-  CHK_INVALID_USER_OVERRIDE_URL: 33,
-  // Invalid url for app.update.url.override user preference (no notification)
-  CHK_INVALID_DEFAULT_OVERRIDE_URL: 34,
   // Update elevation failures or cancelations threshold reached for this
   // version, OSX only (no notification)
   CHK_ELEVATION_DISABLED_FOR_VERSION: 35,
   // User opted out of elevated updates for the available update version, OSX
   // only (no notification)
   CHK_ELEVATION_OPTOUT_FOR_VERSION: 36,
 
   /**
--- a/toolkit/mozapps/update/nsUpdateService.js
+++ b/toolkit/mozapps/update/nsUpdateService.js
@@ -39,17 +39,16 @@ const PREF_APP_UPDATE_SERVICE_ENABLED   
 const PREF_APP_UPDATE_SERVICE_ERRORS       = "app.update.service.errors";
 const PREF_APP_UPDATE_SERVICE_MAXERRORS    = "app.update.service.maxErrors";
 const PREF_APP_UPDATE_SILENT               = "app.update.silent";
 const PREF_APP_UPDATE_SOCKET_MAXERRORS     = "app.update.socket.maxErrors";
 const PREF_APP_UPDATE_SOCKET_RETRYTIMEOUT  = "app.update.socket.retryTimeout";
 const PREF_APP_UPDATE_STAGING_ENABLED      = "app.update.staging.enabled";
 const PREF_APP_UPDATE_URL                  = "app.update.url";
 const PREF_APP_UPDATE_URL_DETAILS          = "app.update.url.details";
-const PREF_APP_UPDATE_URL_OVERRIDE         = "app.update.url.override";
 
 const PREFBRANCH_APP_UPDATE_NEVER = "app.update.never.";
 
 const URI_BRAND_PROPERTIES      = "chrome://branding/locale/brand.properties";
 const URI_UPDATE_HISTORY_DIALOG = "chrome://mozapps/content/update/history.xul";
 const URI_UPDATE_NS             = "http://www.mozilla.org/2005/app-update";
 const URI_UPDATE_PROMPT_DIALOG  = "chrome://mozapps/content/update/updates.xul";
 const URI_UPDATES_PROPERTIES    = "chrome://mozapps/locale/update/updates.properties";
@@ -2303,24 +2302,16 @@ UpdateService.prototype = {
         // UPDATE_SERVICE_INSTALLED_EXTERNAL
         // UPDATE_SERVICE_INSTALLED_NOTIFY
         // UPDATE_SERVICE_MANUALLY_UNINSTALLED_EXTERNAL
         // UPDATE_SERVICE_MANUALLY_UNINSTALLED_NOTIFY
         AUSTLMY.pingServiceInstallStatus(this._pingSuffix, isServiceInstalled());
       }
     }
 
-    let prefType = Services.prefs.getPrefType(PREF_APP_UPDATE_URL_OVERRIDE);
-    let overridePrefHasValue = prefType != Ci.nsIPrefBranch.PREF_INVALID;
-    // Histogram IDs:
-    // UPDATE_HAS_PREF_URL_OVERRIDE_EXTERNAL
-    // UPDATE_HAS_PREF_URL_OVERRIDE_NOTIFY
-    AUSTLMY.pingGeneric("UPDATE_HAS_PREF_URL_OVERRIDE_" + this._pingSuffix,
-                        overridePrefHasValue, false);
-
     // If a download is in progress or the patch has been staged do nothing.
     if (this.isDownloading) {
       AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_IS_DOWNLOADING);
       return;
     }
 
     if (this._downloader && this._downloader.patchIsStaged) {
       let readState = readStatusFile(getUpdatesDir());
@@ -2341,28 +2332,18 @@ UpdateService.prototype = {
     }
     // The following checks are done here so they can be differentiated from
     // foreground checks.
     if (!UpdateUtils.OSVersion) {
       AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_NO_OS_VERSION);
     } else if (!UpdateUtils.ABI) {
       AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_NO_OS_ABI);
     } else if (!validUpdateURL) {
-      if (overridePrefHasValue) {
-        if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_URL_OVERRIDE)) {
-          AUSTLMY.pingCheckCode(this._pingSuffix,
-                                AUSTLMY.CHK_INVALID_USER_OVERRIDE_URL);
-        } else {
-          AUSTLMY.pingCheckCode(this._pingSuffix,
-                                AUSTLMY.CHK_INVALID_DEFAULT_OVERRIDE_URL);
-        }
-      } else {
-        AUSTLMY.pingCheckCode(this._pingSuffix,
-                              AUSTLMY.CHK_INVALID_DEFAULT_URL);
-      }
+      AUSTLMY.pingCheckCode(this._pingSuffix,
+                            AUSTLMY.CHK_INVALID_DEFAULT_URL);
     } else if (!getPref("getBoolPref", PREF_APP_UPDATE_ENABLED, true)) {
       AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_PREF_DISABLED);
     } else if (!hasUpdateMutex()) {
       AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_NO_MUTEX);
     } else if (!gCanCheckForUpdates) {
       AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_UNABLE_TO_CHECK);
     } else if (!this.backgroundChecker._enabled) {
       AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_DISABLED_FOR_SESSION);
@@ -3231,26 +3212,21 @@ Checker.prototype = {
 
   /**
    * The URL of the update service XML file to connect to that contains details
    * about available updates.
    */
   getUpdateURL: function UC_getUpdateURL(force) {
     this._forced = force;
 
-    // Use the override URL if specified.
-    let url = getPref("getCharPref", PREF_APP_UPDATE_URL_OVERRIDE, null);
-
-    // Otherwise, construct the update URL from component parts.
-    if (!url) {
-      try {
-        url = Services.prefs.getDefaultBranch(null).
-              getCharPref(PREF_APP_UPDATE_URL);
-      } catch (e) {
-      }
+    let url;
+    try {
+      url = Services.prefs.getDefaultBranch(null).
+            getCharPref(PREF_APP_UPDATE_URL);
+    } catch (e) {
     }
 
     if (!url || url == "") {
       LOG("Checker:getUpdateURL - update URL not defined");
       return null;
     }
 
     url = UpdateUtils.formatUpdateURL(url);