Bug 873355 Private downloads should ignore the Download Manager r=IanN
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Thu, 20 Jun 2013 21:35:46 +0100
changeset 15769 6c6d2a00b2401582f6dc012d1edf344d1e2b50f0
parent 15768 7d9d4b2d5284649878b56423c27b4fe80afa78e3
child 15770 9b76619bdfe4706731fd5bb716fd724ae5e8e93b
push id942
push userbugzilla@standard8.plus.com
push dateMon, 05 Aug 2013 19:15:38 +0000
treeherdercomm-beta@0e1a1c4a9f0c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN
bugs873355
Bug 873355 Private downloads should ignore the Download Manager r=IanN
suite/common/downloads/progressDialog.js
--- a/suite/common/downloads/progressDialog.js
+++ b/suite/common/downloads/progressDialog.js
@@ -24,22 +24,20 @@ var gStartTime = 0;
 var gEndTime = Date.now(); // gets corrected below for calls from dlmgr
 var gDlActive = false;
 var gRetrying = false;
 
 function progressStartup() {
   gDownload = window.arguments[0];
 
   var recentDMWindow = Services.wm.getMostRecentWindow("Download:Manager");
-  if (recentDMWindow && recentDMWindow.gDownloadTreeView.rowCount > 0) {
+  if (recentDMWindow &&
+      gDownload.guid in recentDMWindow.gDownloadTreeView._dlMap)
     // we have been opened by a download manager, get the end time from there
-    let dmtree = recentDMWindow.gDownloadTreeView;
-    let dldata = dmtree.getRowData(dmtree._getIdxForGUID(gDownload.guid));
-    gEndTime = dldata.endTime;
-  }
+    gEndTime = recentDMWindow.gDownloadTreeView._dlMap[gDownload.guid].endTime;
 
   // cache elements to save .getElementById() calls
   gDownloadBundle = document.getElementById("dmBundle");
   gTkDlBundle = document.getElementById("tkdlBundle");
   gDlStatus = document.getElementById("dlStatus");
   gDlSize = document.getElementById("dlSize");
   gTimeElapsed = document.getElementById("timeElapsed");
   gProgressMeter = document.getElementById("progressMeter");