Bug 834400 - Use bind() in download callbacks. r=mfinkle a=bajaj
authorBrian Nicholson <bnicholson@mozilla.com>
Thu, 24 Jan 2013 13:52:05 -0800
changeset 123792 8560b368e2a8817b8266527cebfd63708fb04deb
parent 123791 026c4f71b37eb2531359e624b81f49de50308596
child 123793 aeb0bb88687f7afddb2a5a763108205276a8d6f4
push id3254
push userbnicholson@mozilla.com
push dateMon, 28 Jan 2013 03:28:31 +0000
treeherdermozilla-aurora@8560b368e2a8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle, bajaj
bugs834400
milestone20.0a2
Bug 834400 - Use bind() in download callbacks. r=mfinkle a=bajaj
mobile/android/chrome/content/aboutDownloads.js
--- a/mobile/android/chrome/content/aboutDownloads.js
+++ b/mobile/android/chrome/content/aboutDownloads.js
@@ -417,17 +417,17 @@ let Downloads = {
   openDownload: function dl_openDownload(aItem) {
     this._getDownloadForElement(aItem, function(aDownload) {
       try {
         let f = aDownload.targetFile;
         if (f) f.launch();
       } catch (ex) {
         this.logError("openDownload() " + ex, aDownload);
       }
-    });
+    }.bind(this));
   },
 
   removeDownload: function dl_removeDownload(aItem) {
     this._getDownloadForElement(aItem, function(aDownload) {
       let f = null;
       try {
         f = aDownload.targetFile;
       } catch (ex) {
@@ -436,17 +436,17 @@ let Downloads = {
         f = { leafName: "" };
       }
       aDownload.remove();
       try {
         if (f) f.remove();
       } catch (ex) {
         this.logError("removeDownload() " + ex, aDownload);
       }
-    });
+    }.bind(this));
     aItem.parentNode.removeChild(aItem);
   },
 
   deleteAll: function dl_deleteAll() {
     let title = gStrings.GetStringFromName("downloadAction.deleteAll");
     let messageForm = gStrings.GetStringFromName("downloadMessage.deleteAll");
     let elements = document.body.querySelectorAll("li[state='" + this._dlmgr.DOWNLOAD_FINISHED + "']," +
                                                "li[state='" + this._dlmgr.DOWNLOAD_CANCELED + "']," +