Bug 1364050 - Part 5 - Update obsolete references in code comments. r=mak draft
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Fri, 05 May 2017 13:11:49 +0100
changeset 577769 930f15df03bb9fd48b4c6eb8af98d3569e04700c
parent 577768 d89edbe06490f6e8fcdd9383335256c5cc235b84
child 628583 62e78a0b7b41ed9e36dc9980370397d367c0d103
push id58781
push userpaolo.mozmail@amadzone.org
push dateMon, 15 May 2017 10:24:13 +0000
reviewersmak
bugs1364050
milestone55.0a1
Bug 1364050 - Part 5 - Update obsolete references in code comments. r=mak MozReview-Commit-ID: 9EUn7vcSfe3
browser/base/content/urlbarBindings.xml
browser/components/downloads/DownloadsCommon.jsm
browser/components/preferences/in-content-old/main.js
browser/components/preferences/in-content/applications.js
toolkit/components/places/SQLFunctions.cpp
uriloader/exthandler/nsExternalHelperAppService.cpp
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -2072,17 +2072,17 @@ file, You can obtain one at http://mozil
           }
 
           let delta = now - this.notification.lastUpdate;
           if ((delta < 400) && (aProgress < aMaxProgress))
             return;
 
           delta /= 1000;
 
-          // This code is taken from nsDownloadManager.cpp
+          // This algorithm is the same used by the downloads code.
           let speed = (aProgress - this.notification.lastProgress) / delta;
           if (this.notification.speed)
             speed = speed * 0.9 + this.notification.speed * 0.1;
 
           this.notification.lastUpdate = now;
           this.notification.lastProgress = aProgress;
           this.notification.speed = speed;
 
--- a/browser/components/downloads/DownloadsCommon.jsm
+++ b/browser/components/downloads/DownloadsCommon.jsm
@@ -629,27 +629,21 @@ XPCOMUtils.defineLazyGetter(DownloadsCom
   let sysInfo = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2);
   return parseFloat(sysInfo.getProperty("version")) >= 6;
 });
 
 // DownloadsData
 
 /**
  * Retrieves the list of past and completed downloads from the underlying
- * Download Manager data, and provides asynchronous notifications allowing to
+ * Downloads API data, and provides asynchronous notifications allowing to
  * build a consistent view of the available data.
  *
- * This object responds to real-time changes in the underlying Download Manager
- * data.  For example, the deletion of one or more downloads is notified through
- * the nsIObserver interface, while any state or progress change is notified
- * through the nsIDownloadProgressListener interface.
- *
- * Note that using this object does not automatically start the Download Manager
- * service.  Consumers will see an empty list of downloads until the service is
- * actually started.  This is useful to display a neutral progress indicator in
+ * 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.
  *
  * Note that DownloadsData and PrivateDownloadsData are two equivalent singleton
  * objects, one accessing non-private downloads, and the other accessing private
  * ones.
  */
 function DownloadsDataCtor(aPrivate) {
   this._isPrivate = aPrivate;
--- a/browser/components/preferences/in-content-old/main.js
+++ b/browser/components/preferences/in-content-old/main.js
@@ -502,25 +502,16 @@ var gMainPane = {
 
     // Display a 'pretty' label or the path in the UI.
     if (folderListPref.value == 2) {
       // Custom path selected and is configured
       downloadFolder.label = this._getDisplayNameOfFile(currentDirPref.value);
       iconUrlSpec = fph.getURLSpecFromFile(currentDirPref.value);
     } else if (folderListPref.value == 1) {
       // 'Downloads'
-      // In 1.5, this pointed to a folder we created called 'My Downloads'
-      // and was available as an option in the 1.5 drop down. On XP this
-      // was in My Documents, on OSX it was in User Docs. In 2.0, we did
-      // away with the drop down option, although the special label was
-      // still supported for the folder if it existed. Because it was
-      // not exposed it was rarely used.
-      // With 3.0, a new desktop folder - 'Downloads' was introduced for
-      // platforms and versions that don't support a default system downloads
-      // folder. See nsDownloadManager for details.
       downloadFolder.label = bundlePreferences.getString("downloadsFolderName");
       iconUrlSpec = fph.getURLSpecFromFile(await this._indexToFolder(1));
     } else {
       // 'Desktop'
       downloadFolder.label = bundlePreferences.getString("desktopFolderName");
       iconUrlSpec = fph.getURLSpecFromFile(await this._getDownloadsFolder("Desktop"));
     }
     downloadFolder.image = "moz-icon://" + iconUrlSpec + "?size=16";
--- a/browser/components/preferences/in-content/applications.js
+++ b/browser/components/preferences/in-content/applications.js
@@ -2014,25 +2014,16 @@ var gApplicationsPane = {
 
     // Display a 'pretty' label or the path in the UI.
     if (folderListPref.value == 2) {
       // Custom path selected and is configured
       downloadFolder.label = this._getDisplayNameOfFile(currentDirPref.value);
       iconUrlSpec = fph.getURLSpecFromFile(currentDirPref.value);
     } else if (folderListPref.value == 1) {
       // 'Downloads'
-      // In 1.5, this pointed to a folder we created called 'My Downloads'
-      // and was available as an option in the 1.5 drop down. On XP this
-      // was in My Documents, on OSX it was in User Docs. In 2.0, we did
-      // away with the drop down option, although the special label was
-      // still supported for the folder if it existed. Because it was
-      // not exposed it was rarely used.
-      // With 3.0, a new desktop folder - 'Downloads' was introduced for
-      // platforms and versions that don't support a default system downloads
-      // folder. See nsDownloadManager for details.
       downloadFolder.label = bundlePreferences.getString("downloadsFolderName");
       iconUrlSpec = fph.getURLSpecFromFile(await this._indexToFolder(1));
     } else {
       // 'Desktop'
       downloadFolder.label = bundlePreferences.getString("desktopFolderName");
       iconUrlSpec = fph.getURLSpecFromFile(await this._getDownloadsFolder("Desktop"));
     }
     downloadFolder.image = "moz-icon://" + iconUrlSpec + "?size=16";
--- a/toolkit/components/places/SQLFunctions.cpp
+++ b/toolkit/components/places/SQLFunctions.cpp
@@ -20,18 +20,16 @@
 #include "mozilla/HashFunctions.h"
 
 // Maximum number of chars to search through.
 // MatchAutoCompleteFunction won't look for matches over this threshold.
 #define MAX_CHARS_TO_SEARCH_THROUGH 255
 
 using namespace mozilla::storage;
 
-// Keep the GUID-related parts of this file in sync with toolkit/downloads/SQLFunctions.cpp!
-
 ////////////////////////////////////////////////////////////////////////////////
 //// Anonymous Helpers
 
 namespace {
 
   typedef nsACString::const_char_iterator const_char_iterator;
 
   /**
--- a/uriloader/exthandler/nsExternalHelperAppService.cpp
+++ b/uriloader/exthandler/nsExternalHelperAppService.cpp
@@ -268,17 +268,17 @@ static bool GetFilenameAndExtensionFromC
 
   return handleExternally;
 }
 
 /**
  * Obtains the directory to use.  This tends to vary per platform, and
  * needs to be consistent throughout our codepaths. For platforms where
  * helper apps use the downloads directory, this should be kept in
- * sync with nsDownloadManager.cpp
+ * sync with DownloadIntegration.jsm.
  *
  * Optionally skip availability of the directory and storage.
  */
 static nsresult GetDownloadDirectory(nsIFile **_directory,
                                      bool aSkipChecks = false)
 {
   nsCOMPtr<nsIFile> dir;
 #ifdef XP_MACOSX
@@ -2422,17 +2422,17 @@ NS_IMETHODIMP nsExternalAppHandler::Laun
     return rv;
   }
 
   // Now that the user has elected to launch the downloaded file with a helper
   // app, we're justified in removing the 'salted' name.  We'll rename to what
   // was specified in mSuggestedFileName after the download is done prior to
   // launching the helper app.  So that any existing file of that name won't be
   // overwritten we call CreateUnique().  Also note that we use the same
-  // directory as originally downloaded so nsDownload can rename in place
+  // directory as originally downloaded so the download can be renamed in place
   // later.
   nsCOMPtr<nsIFile> fileToUse;
   (void) GetDownloadDirectory(getter_AddRefs(fileToUse));
 
   if (mSuggestedFileName.IsEmpty()) {
     // Keep using the leafname of the temp file, since we're just starting a helper
     mSuggestedFileName = mTempLeafName;
   }