Bug 1546854 - always set the value of _downloaderName in downloadUpdate. r=bytesized
authorRobert Strong <robert.bugzilla@gmail.com>
Thu, 25 Apr 2019 16:01:14 +0000
changeset 471350 dd16591fad14b9aeef4fc124813cae502f3f5ee5
parent 471349 189987dd45443dd548c187513e795a216271db8f
child 471351 45e3c6135d0759e37a270e4ff0d8cf1d0ec03f21
push id112913
push useropoprus@mozilla.com
push dateThu, 25 Apr 2019 22:21:16 +0000
treeherdermozilla-inbound@5279ac14ae48 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbytesized
bugs1546854
milestone68.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 1546854 - always set the value of _downloaderName in downloadUpdate. r=bytesized Differential Revision: https://phabricator.services.mozilla.com/D28767
toolkit/mozapps/update/UpdateService.jsm
--- a/toolkit/mozapps/update/UpdateService.jsm
+++ b/toolkit/mozapps/update/UpdateService.jsm
@@ -3695,17 +3695,17 @@ Downloader.prototype = {
    * The start time of the first download attempt in milliseconds for telemetry.
    */
   _startDownloadMs: null,
 
   /**
    * The name of the downloader being used to download the update. This is used
    * when setting property names on the update patch for telemetry.
    */
-  _downloaderName: "bits",
+  _downloaderName: null,
 
   /**
    * Cancels the active download.
    *
    * For a BITS download, this will cancel and remove the download job. For
    * an nsIIncrementalDownload, this will stop the download, but leaves the
    * data around to allow the transfer to be resumed later.
    */
@@ -3943,19 +3943,18 @@ Downloader.prototype = {
     this._patch.QueryInterface(Ci.nsIWritablePropertyBag);
     this.isCompleteUpdate = this._patch.type == "complete";
 
     let canUseBits = this._canUseBits(this._patch);
     // Allow the advertised update to disable BITS.
     if (this._update.getProperty("disableBITS") != null) {
       canUseBits = false;
     }
-    if (!canUseBits) {
-      this._downloaderName = "internal";
-    }
+
+    this._downloaderName = canUseBits ? "bits" : "internal";
     if (!this._patch.getProperty(this._downloaderName + "DownloadStart")) {
       this._patch.setProperty(this._downloaderName + "DownloadStart", Math.floor(Date.now() / 1000));
     }
 
     if (!canUseBits) {
       let patchFile = getUpdatesDir().clone();
       patchFile.append(FILE_UPDATE_MAR);