Backed out changeset 63909748b3ce (bug 1354532)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Wed, 06 Sep 2017 16:47:12 +0200
changeset 428672 48fa888e2007823bd91b8aca788cdb14844cd082
parent 428671 238f1dbcb6003dd97f0b10096f8f66591320c2f6
child 428673 7b74ef52385d68a1af6cf54463bc049ed4ba8308
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1354532
milestone57.0a1
backs out63909748b3ce21c442c37c3889ffeae0abd43ba5
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 63909748b3ce (bug 1354532)
browser/components/downloads/DownloadsCommon.jsm
--- a/browser/components/downloads/DownloadsCommon.jsm
+++ b/browser/components/downloads/DownloadsCommon.jsm
@@ -73,18 +73,16 @@ const kDownloadsStringsRequiringFormatti
 };
 
 const kDownloadsStringsRequiringPluralForm = {
   otherDownloads3: true
 };
 
 const kPartialDownloadSuffix = ".part";
 
-const kMaxHistoryResultsForLimitedView = 42;
-
 const kPrefBranch = Services.prefs.getBranch("browser.download.");
 
 var PrefObserver = {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
                                          Ci.nsISupportsWeakReference]),
   getPref(name) {
     try {
       switch (typeof this.prefs[name]) {
@@ -190,32 +188,23 @@ this.DownloadsCommon = {
    * Get access to one of the DownloadsData, PrivateDownloadsData, or
    * HistoryDownloadsData objects, depending on the privacy status of the
    * specified window and on whether history downloads should be included.
    *
    * @param window
    *        The browser window which owns the download button.
    * @param [optional] history
    *        True to include history downloads when the window is public.
-   * @param [optional] privateAll
-   *        Whether to force the public downloads data to be returned together
-   *        with the private downloads data for a private window.
-   * @param [optional] limited
-   *        True to limit the amount of downloads returned to
-   *        `kMaxHistoryResultsForLimitedView`.
    */
-  getData(window, history = false, privateAll = false, limited = false) {
-    let isPrivate = PrivateBrowsingUtils.isContentWindowPrivate(window);
-    if (isPrivate && !privateAll) {
+  getData(window, history = false) {
+    if (PrivateBrowsingUtils.isContentWindowPrivate(window)) {
       return PrivateDownloadsData;
     }
     if (history) {
-      if (isPrivate && privateAll)
-        return LimitedPrivateHistoryDownloadData;
-      return limited ? LimitedHistoryDownloadsData : HistoryDownloadsData;
+      return HistoryDownloadsData;
     }
     return DownloadsData;
   },
 
   /**
    * Initializes the Downloads back-end and starts receiving events for both the
    * private and non-private downloads data objects.
    */
@@ -642,40 +631,31 @@ XPCOMUtils.defineLazyGetter(DownloadsCom
  *
  * Note that using this object does not automatically initialize the list of
  * downloads. This is useful to display a neutral progress indicator in
  * the main browser window until the autostart timeout elapses.
  *
  * This powers the DownloadsData, PrivateDownloadsData, and HistoryDownloadsData
  * singleton objects.
  */
-function DownloadsDataCtor({ isPrivate, isHistory, maxHistoryResults } = {}) {
+function DownloadsDataCtor({ isPrivate, isHistory } = {}) {
   this._isPrivate = !!isPrivate;
 
   // Contains all the available Download objects and their integer state.
   this.oldDownloadStates = new Map();
 
   // For the history downloads list we don't need to register this as a view,
   // but we have to ensure that the DownloadsData object is initialized before
   // we register more views. This ensures that the view methods of DownloadsData
   // are invoked before those of views registered on HistoryDownloadsData,
   // allowing the endTime property to be set correctly.
   if (isHistory) {
-    if (isPrivate) {
-      PrivateDownloadsData.initializeDataLink();
-    }
     DownloadsData.initializeDataLink();
-    this._promiseList = DownloadsData._promiseList.then(() => {
-      // For history downloads in Private Browsing mode, we'll fetch the combined
-      // list of public and private downloads.
-      return DownloadHistory.getList({
-        type: isPrivate ? Downloads.ALL : Downloads.PUBLIC,
-        maxHistoryResults: maxHistoryResults
-      });
-    });
+    this._promiseList = DownloadsData._promiseList
+                                     .then(() => DownloadHistory.getList());
     return;
   }
 
   // This defines "initializeDataLink" and "_promiseList" synchronously, then
   // continues execution only when "initializeDataLink" is called, allowing the
   // underlying data to be loaded only when actually needed.
   this._promiseList = (async () => {
     await new Promise(resolve => this.initializeDataLink = resolve);
@@ -850,25 +830,16 @@ DownloadsDataCtor.prototype = {
     browserWin.DownloadsPanel.showPanel();
   }
 };
 
 XPCOMUtils.defineLazyGetter(this, "HistoryDownloadsData", function() {
   return new DownloadsDataCtor({ isHistory: true });
 });
 
-XPCOMUtils.defineLazyGetter(this, "LimitedHistoryDownloadsData", function() {
-  return new DownloadsDataCtor({ isHistory: true, maxHistoryResults: kMaxHistoryResultsForLimitedView });
-});
-
-XPCOMUtils.defineLazyGetter(this, "LimitedPrivateHistoryDownloadData", function() {
-  return new DownloadsDataCtor({ isPrivate: true, isHistory: true,
-    maxHistoryResults: kMaxHistoryResultsForLimitedView });
-});
-
 XPCOMUtils.defineLazyGetter(this, "PrivateDownloadsData", function() {
   return new DownloadsDataCtor({ isPrivate: true });
 });
 
 XPCOMUtils.defineLazyGetter(this, "DownloadsData", function() {
   return new DownloadsDataCtor();
 });