Bug 830205 - Stop the Download button from showing progress remaining after downloads completed if browser.download.panel.removeFinishedDownloads=true. r=paolo, a=akeybl
authorMike Conley <mconley@mozilla.com>
Tue, 15 Jan 2013 15:29:23 -0500
changeset 127202 18d4e50896ca15a3c1389440c775e1a9fb283241
parent 127201 5cc57edb1323963d1fb90ee6832073bff9db2841
child 127203 d6a4739c5facdef14316d753346c889fee02c785
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspaolo, akeybl
bugs830205
milestone20.0a2
Bug 830205 - Stop the Download button from showing progress remaining after downloads completed if browser.download.panel.removeFinishedDownloads=true. r=paolo, a=akeybl
browser/components/downloads/src/DownloadsCommon.jsm
--- a/browser/components/downloads/src/DownloadsCommon.jsm
+++ b/browser/components/downloads/src/DownloadsCommon.jsm
@@ -731,21 +731,21 @@ DownloadsDataCtor.prototype = {
    * Removes the data item with the specified identifier.
    *
    * This method can be called at most once per download identifier.
    */
   _removeDataItem: function DD_removeDataItem(aDownloadId)
   {
     if (aDownloadId in this.dataItems) {
       let dataItem = this.dataItems[aDownloadId];
+      this.dataItems[aDownloadId] = null;
       this._views.forEach(
         function (view) view.onDataItemRemoved(dataItem)
       );
     }
-    this.dataItems[aDownloadId] = null;
   },
 
   //////////////////////////////////////////////////////////////////////////////
   //// Persistent data loading
 
   /**
    * Represents an executing statement, allowing its cancellation.
    */