Bug 1087255 - Convert Download JS clients of RemovePage(s) to History.remove;r=paolo
authorDavid Rajchenbach-Teller <dteller@mozilla.com>
Fri, 31 Oct 2014 12:39:28 +0100
changeset 500823 4975b3ae236b2f5842d2b24b17e6911f025123c2
parent 500822 1a3e39513a18f97f4362d3c4bc5abbe07f16bb87
child 500824 7ceee02e947617160e58b44122ea016cea95ac0c
push id49816
push userbmo:tchiovoloni@mozilla.com
push dateFri, 17 Mar 2017 20:44:02 +0000
reviewerspaolo
bugs1087255
milestone55.0a1
Bug 1087255 - Convert Download JS clients of RemovePage(s) to History.remove;r=paolo MozReview-Commit-ID: KpXAh74W12E
browser/components/downloads/content/allDownloadsViewOverlay.js
browser/components/downloads/content/downloads.js
--- a/browser/components/downloads/content/allDownloadsViewOverlay.js
+++ b/browser/components/downloads/content/allDownloadsViewOverlay.js
@@ -355,18 +355,17 @@ HistoryDownloadElementShell.prototype = 
     openURL(this.download.source.referrer);
   },
 
   cmd_delete() {
     if (this._sessionDownload) {
       DownloadsCommon.removeAndFinalizeDownload(this.download);
     }
     if (this._historyDownload) {
-      let uri = NetUtil.newURI(this.download.source.url);
-      PlacesUtils.bhistory.removePage(uri);
+      PlacesUtils.history.remove(this.download.source.url);
     }
   },
 
   downloadsCmd_unblock() {
     this.confirmUnblock(window, "unblock");
   },
 
   downloadsCmd_chooseUnblock() {
--- a/browser/components/downloads/content/downloads.js
+++ b/browser/components/downloads/content/downloads.js
@@ -1199,18 +1199,17 @@ DownloadsViewItem.prototype = {
     }
   },
 
   //////////////////////////////////////////////////////////////////////////////
   //// Item commands
 
   cmd_delete() {
     DownloadsCommon.removeAndFinalizeDownload(this.download);
-    PlacesUtils.bhistory.removePage(
-                           NetUtil.newURI(this.download.source.url));
+    PlacesUtils.history.remove(this.download.source.url).catch(Cu.reportError);
   },
 
   downloadsCmd_unblock() {
     DownloadsPanel.hidePanel();
     this.confirmUnblock(window, "unblock");
   },
 
   downloadsCmd_chooseUnblock() {