rem:   updateTime(dl); 
context: function downloadCompleted(aDownload){  // Wrap this in try...catch since this can be called while shutting down...  // it doesn't really matter if it fails then since well.. we're shutting down  // and there's no UI to update!  try {    let dl = getDownload(aDownload.id);    // Update attributes now that we've finished    dl.setAttribute("startTime", Math.round(aDownload.startTime / 1000));    dl.setAttribute("endTime", Date.now());    dl.setAttribute("currBytes", aDownload.amountTransferred);    dl.setAttribute("maxBytes", aDownload.size);    // Show the finish time because we're done    updateTime(dl);    // If we aren't displaying search results, move the download to after the    // active ones    if (gSearchTerms.length == 0) {      // Iterate down until we find a non-active download      let next = dl.nextSibling;      while (next && next.inProgress)        next = next.nextSibling;      // Move the item and color everything after where it moved from      let fixup = dl.nextSibling;      gDownloadsView.insertBefore(dl, next);      stripeifyList(fixup);    } else {      removeFromView(dl);    }    // getTypeFromFile fails if it can't find a type for this file.    try {      // Refresh the icon, so that executable icons are shown.      var mimeService = Cc["@mozilla.org/mime;1"].                        getService(Ci.nsIMIMEService);      var contentType = mimeService.getTypeFromFile(aDownload.targetFile);      var listItem = getDownload(aDownload.id)      var oldImage = listItem.getAttribute("image");      // Tacking on contentType bypasses cache      listItem.setAttribute("image", oldImage + "&contentType=" + contentType);    } catch (e) { }    if (gDownloadManager.activeDownloadCount == 0)      document.title = document.documentElement.getAttribute("statictitle");  }  catch (e) { }}
meta: 10520	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/10520/5d64aec59dc64c862983e7e15320576ca0bb5a84/downloads.js/clean/toolkit/mozapps/downloads/content/downloads.js