Bug 851471 - Decommission nsIDownloadManager. r=mak draft
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Tue, 06 Mar 2018 13:16:07 +0000
changeset 763673 0b48ae94d9786c2bea1a3f1af6b5ffe4412f1f13
parent 763635 a007dd56b9947a93c276e82275d7065db1949c9e
child 763674 9a973c9aa3fd14ab5c9fc522a1ca4e91719537c3
child 763758 8385100c51147d3816f2826bb0a2545d53cc1a69
push id101519
push userpaolo.mozmail@amadzone.org
push dateTue, 06 Mar 2018 13:22:09 +0000
reviewersmak
bugs851471
milestone60.0a1
Bug 851471 - Decommission nsIDownloadManager. r=mak MozReview-Commit-ID: HfqdrdJcLrh
browser/base/content/test/static/browser_all_files_referenced.js
browser/installer/package-manifest.in
mobile/android/installer/package-manifest.in
toolkit/components/build/moz.build
toolkit/components/build/nsToolkitCompsCID.h
toolkit/components/build/nsToolkitCompsModule.cpp
toolkit/components/downloads/moz.build
toolkit/components/downloads/nsDownloadManager.cpp
toolkit/components/downloads/nsDownloadManager.h
toolkit/components/downloads/nsIDownload.idl
toolkit/components/downloads/nsIDownloadManager.idl
toolkit/components/downloads/nsIDownloadManagerUI.idl
toolkit/components/downloads/nsIDownloadProgressListener.idl
toolkit/components/moz.build
toolkit/modules/Services.jsm
toolkit/modules/tests/xpcshell/test_Services.js
toolkit/themes/linux/mozapps/downloads/downloadIcon.png
toolkit/themes/linux/mozapps/jar.mn
toolkit/themes/osx/mozapps/downloads/downloadIcon.png
toolkit/themes/osx/mozapps/jar.mn
toolkit/themes/windows/mozapps/downloads/downloadIcon.png
toolkit/themes/windows/mozapps/jar.mn
--- a/browser/base/content/test/static/browser_all_files_referenced.js
+++ b/browser/base/content/test/static/browser_all_files_referenced.js
@@ -68,19 +68,16 @@ var whitelist = [
 
   // toolkit/content/aboutRights-unbranded.xhtml doesn't use aboutRights.css
   {file: "chrome://global/skin/aboutRights.css", skipUnofficial: true},
 
   // devtools/client/inspector/bin/dev-server.js
   {file: "chrome://devtools/content/inspector/markup/markup.xhtml",
    isFromDevTools: true},
 
-  // Kept for add-on compatibility, should be removed in bug 851471.
-  {file: "chrome://mozapps/skin/downloads/downloadIcon.png"},
-
   // SpiderMonkey parser API, currently unused in browser/ and toolkit/
   {file: "resource://gre/modules/reflect.jsm"},
 
   // extensions/pref/autoconfig/src/nsReadConfig.cpp
   {file: "resource://gre/defaults/autoconfig/prefcalls.js"},
 
   // modules/libpref/Preferences.cpp
   {file: "resource://gre/greprefs.js"},
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -217,17 +217,16 @@
 @RESPATH@/components/dom_sidebar.xpt
 @RESPATH@/components/dom_storage.xpt
 #ifdef MOZ_WEBSPEECH
 @RESPATH@/components/dom_webspeechrecognition.xpt
 #endif
 @RESPATH@/components/dom_workers.xpt
 @RESPATH@/components/dom_xul.xpt
 @RESPATH@/components/dom_presentation.xpt
-@RESPATH@/components/downloads.xpt
 @RESPATH@/components/editor.xpt
 @RESPATH@/components/enterprisepolicies.xpt
 @RESPATH@/components/extensions.xpt
 @RESPATH@/components/exthandler.xpt
 @RESPATH@/components/fastfind.xpt
 @RESPATH@/components/feeds.xpt
 @RESPATH@/components/gfx.xpt
 @RESPATH@/components/html5.xpt
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -142,17 +142,16 @@
 @BINPATH@/components/dom_storage.xpt
 @BINPATH@/components/dom_system.xpt
 #ifdef MOZ_WEBSPEECH
 @BINPATH@/components/dom_webspeechrecognition.xpt
 #endif
 @BINPATH@/components/dom_xhr.xpt
 @BINPATH@/components/dom_xul.xpt
 @BINPATH@/components/dom_presentation.xpt
-@BINPATH@/components/downloads.xpt
 @BINPATH@/components/editor.xpt
 @BINPATH@/components/extensions.xpt
 @BINPATH@/components/exthandler.xpt
 @BINPATH@/components/fastfind.xpt
 @BINPATH@/components/feeds.xpt
 @BINPATH@/components/gfx.xpt
 @BINPATH@/components/html5.xpt
 @BINPATH@/components/htmlparser.xpt
--- a/toolkit/components/build/moz.build
+++ b/toolkit/components/build/moz.build
@@ -15,17 +15,16 @@ SOURCES += [
     'nsToolkitCompsModule.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '../../xre',
     '../alerts',
-    '../downloads',
     '../feeds',
     '../find',
     '../jsdownloads/src',
     '../perfmonitoring',
     '../protobuf',
     '../reputationservice',
     '../startup',
     '../statusfilter',
--- a/toolkit/components/build/nsToolkitCompsCID.h
+++ b/toolkit/components/build/nsToolkitCompsCID.h
@@ -16,19 +16,16 @@
   "@mozilla.org/autocomplete/controller;1"
 
 #define NS_AUTOCOMPLETESIMPLERESULT_CONTRACTID \
   "@mozilla.org/autocomplete/simple-result;1"
 
 #define NS_AUTOCOMPLETEMDBRESULT_CONTRACTID \
   "@mozilla.org/autocomplete/mdb-result;1"
 
-#define NS_DOWNLOADMANAGER_CONTRACTID \
-  "@mozilla.org/download-manager;1"
-
 #define NS_DOWNLOADPLATFORM_CONTRACTID \
   "@mozilla.org/toolkit/download-platform;1"
 
 #define NS_FORMHISTORY_CONTRACTID \
   "@mozilla.org/satchel/form-history;1"
 
 #define NS_FORMFILLCONTROLLER_CONTRACTID \
   "@mozilla.org/satchel/form-fill-controller;1"
@@ -112,19 +109,16 @@
 // {2ee3039b-2de4-43d9-93b0-649beacff39a}
 #define NS_AUTOCOMPLETESIMPLERESULT_CID \
 { 0x2ee3039b, 0x2de4, 0x43d9, { 0x93, 0xb0, 0x64, 0x9b, 0xea, 0xcf, 0xf3, 0x9a } }
 
 // {7A6F70B6-2BBD-44b5-9304-501352D44AB5}
 #define NS_AUTOCOMPLETEMDBRESULT_CID \
 { 0x7a6f70b6, 0x2bbd, 0x44b5, { 0x93, 0x4, 0x50, 0x13, 0x52, 0xd4, 0x4a, 0xb5 } }
 
-#define NS_DOWNLOADMANAGER_CID \
-    { 0xedb0490e, 0x1dd1, 0x11b2, { 0x83, 0xb8, 0xdb, 0xf8, 0xd8, 0x59, 0x06, 0xa6 } }
-
 #define NS_DOWNLOADPLATFORM_CID \
     { 0x649a14c9, 0xfe5c, 0x48ec, { 0x9c, 0x85, 0x00, 0xca, 0xd9, 0xcc, 0xf3, 0x2e } }
 
 // {895DB6C7-DBDF-40ea-9F64-B175033243DC}
 #define NS_FORMFILLCONTROLLER_CID \
 { 0x895db6c7, 0xdbdf, 0x40ea, { 0x9f, 0x64, 0xb1, 0x75, 0x3, 0x32, 0x43, 0xdc } }
 
 // {59648a91-5a60-4122-8ff2-54b839c84aed}
--- a/toolkit/components/build/nsToolkitCompsModule.cpp
+++ b/toolkit/components/build/nsToolkitCompsModule.cpp
@@ -14,17 +14,16 @@
 
 #if !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
 #include "nsParentalControlsService.h"
 #endif
 
 #include "mozilla/AlertNotification.h"
 #include "nsAlertsService.h"
 
-#include "nsDownloadManager.h"
 #include "DownloadPlatform.h"
 #include "rdf.h"
 
 #include "nsTypeAheadFind.h"
 
 #include "ApplicationReputation.h"
 #include "LoginReputation.h"
 #include "nsUrlClassifierDBService.h"
@@ -79,18 +78,16 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsFindSer
 
 #if !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsParentalControlsService)
 #endif
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(AlertNotification)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAlertsService)
 
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsDownloadManager,
-                                         nsDownloadManager::GetSingleton)
 NS_GENERIC_FACTORY_CONSTRUCTOR(DownloadPlatform)
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsTypeAheadFind)
 
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(ApplicationReputationService,
                                          ApplicationReputationService::GetSingleton)
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(LoginReputationService,
                                          LoginReputationService::GetSingleton)
@@ -139,17 +136,16 @@ NS_DEFINE_NAMED_CID(NS_TOOLKIT_PERFORMAN
 NS_DEFINE_NAMED_CID(NS_TOOLKIT_TERMINATOR_CID);
 #endif
 NS_DEFINE_NAMED_CID(NS_USERINFO_CID);
 NS_DEFINE_NAMED_CID(ALERT_NOTIFICATION_CID);
 NS_DEFINE_NAMED_CID(NS_ALERTSSERVICE_CID);
 #if !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
 NS_DEFINE_NAMED_CID(NS_PARENTALCONTROLSSERVICE_CID);
 #endif
-NS_DEFINE_NAMED_CID(NS_DOWNLOADMANAGER_CID);
 NS_DEFINE_NAMED_CID(NS_DOWNLOADPLATFORM_CID);
 NS_DEFINE_NAMED_CID(NS_FIND_SERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_TYPEAHEADFIND_CID);
 NS_DEFINE_NAMED_CID(NS_APPLICATION_REPUTATION_SERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_LOGIN_REPUTATION_SERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_URLCLASSIFIERPREFIXSET_CID);
 NS_DEFINE_NAMED_CID(NS_URLCLASSIFIERDBSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_URLCLASSIFIERSTREAMUPDATER_CID);
@@ -175,17 +171,16 @@ static const Module::CIDEntry kToolkitCI
   { &kNS_TOOLKIT_PERFORMANCESTATSSERVICE_CID, false, nullptr, nsPerformanceStatsServiceConstructor },
 #endif // defined (MOZ_HAS_PERFSTATS)
   { &kNS_USERINFO_CID, false, nullptr, nsUserInfoConstructor },
   { &kALERT_NOTIFICATION_CID, false, nullptr, AlertNotificationConstructor },
   { &kNS_ALERTSSERVICE_CID, false, nullptr, nsAlertsServiceConstructor },
 #if !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
   { &kNS_PARENTALCONTROLSSERVICE_CID, false, nullptr, nsParentalControlsServiceConstructor },
 #endif
-  { &kNS_DOWNLOADMANAGER_CID, false, nullptr, nsDownloadManagerConstructor },
   { &kNS_DOWNLOADPLATFORM_CID, false, nullptr, DownloadPlatformConstructor },
   { &kNS_FIND_SERVICE_CID, false, nullptr, nsFindServiceConstructor },
   { &kNS_TYPEAHEADFIND_CID, false, nullptr, nsTypeAheadFindConstructor },
   { &kNS_APPLICATION_REPUTATION_SERVICE_CID, false, nullptr, ApplicationReputationServiceConstructor },
   { &kNS_LOGIN_REPUTATION_SERVICE_CID, false, nullptr, LoginReputationServiceConstructor },
   { &kNS_URLCLASSIFIERPREFIXSET_CID, false, nullptr, nsUrlClassifierPrefixSetConstructor },
   { &kNS_URLCLASSIFIERDBSERVICE_CID, false, nullptr, nsUrlClassifierDBServiceConstructor },
   { &kNS_URLCLASSIFIERSTREAMUPDATER_CID, false, nullptr, nsUrlClassifierStreamUpdaterConstructor },
@@ -213,17 +208,16 @@ static const Module::ContractIDEntry kTo
   { NS_TOOLKIT_PERFORMANCESTATSSERVICE_CONTRACTID, &kNS_TOOLKIT_PERFORMANCESTATSSERVICE_CID },
 #endif // defined (MOZ_HAS_PERFSTATS)
   { NS_USERINFO_CONTRACTID, &kNS_USERINFO_CID },
   { ALERT_NOTIFICATION_CONTRACTID, &kALERT_NOTIFICATION_CID },
   { NS_ALERTSERVICE_CONTRACTID, &kNS_ALERTSSERVICE_CID },
 #if !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
   { NS_PARENTALCONTROLSSERVICE_CONTRACTID, &kNS_PARENTALCONTROLSSERVICE_CID },
 #endif
-  { NS_DOWNLOADMANAGER_CONTRACTID, &kNS_DOWNLOADMANAGER_CID },
   { NS_DOWNLOADPLATFORM_CONTRACTID, &kNS_DOWNLOADPLATFORM_CID },
   { NS_FIND_SERVICE_CONTRACTID, &kNS_FIND_SERVICE_CID },
   { NS_TYPEAHEADFIND_CONTRACTID, &kNS_TYPEAHEADFIND_CID },
   { NS_APPLICATION_REPUTATION_SERVICE_CONTRACTID, &kNS_APPLICATION_REPUTATION_SERVICE_CID },
   { NS_LOGIN_REPUTATION_SERVICE_CONTRACTID, &kNS_LOGIN_REPUTATION_SERVICE_CID },
   { NS_URLCLASSIFIERPREFIXSET_CONTRACTID, &kNS_URLCLASSIFIERPREFIXSET_CID },
   { NS_URLCLASSIFIERDBSERVICE_CONTRACTID, &kNS_URLCLASSIFIERDBSERVICE_CID },
   { NS_URICLASSIFIERSERVICE_CONTRACTID, &kNS_URLCLASSIFIERDBSERVICE_CID },
deleted file mode 100644
--- a/toolkit/components/downloads/moz.build
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-with Files('*'):
-    BUG_COMPONENT = ('Toolkit', 'Download Manager')
-
-XPIDL_SOURCES += [
-    'nsIDownload.idl',
-    'nsIDownloadManager.idl',
-    'nsIDownloadManagerUI.idl',
-    'nsIDownloadProgressListener.idl',
-]
-
-XPIDL_MODULE = 'downloads'
-
-UNIFIED_SOURCES += [
-    'nsDownloadManager.cpp'
-]
-
-FINAL_LIBRARY = 'xul'
-
-CXXFLAGS += CONFIG['TK_CFLAGS']
deleted file mode 100644
--- a/toolkit/components/downloads/nsDownloadManager.cpp
+++ /dev/null
@@ -1,406 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsIPrefService.h"
-#include "nsIPropertyBag2.h"
-#include "nsCExternalHandlerService.h"
-#include "nsDirectoryServiceDefs.h"
-#include "nsDownloadManager.h"
-
-#include "mozilla/Services.h"
-
-using namespace mozilla;
-
-#define DOWNLOAD_MANAGER_BUNDLE "chrome://mozapps/locale/downloads/downloads.properties"
-
-#define NS_SYSTEMINFO_CONTRACTID "@mozilla.org/system-info;1"
-
-////////////////////////////////////////////////////////////////////////////////
-//// nsDownloadManager
-
-NS_IMPL_ISUPPORTS(
-  nsDownloadManager
-, nsIDownloadManager
-)
-
-nsDownloadManager *nsDownloadManager::gDownloadManagerService = nullptr;
-
-already_AddRefed<nsDownloadManager>
-nsDownloadManager::GetSingleton()
-{
-  if (gDownloadManagerService) {
-    return do_AddRef(gDownloadManagerService);
-  }
-
-  auto serv = MakeRefPtr<nsDownloadManager>();
-  // Note: This is cleared in the nsDownloadManager constructor.
-  gDownloadManagerService = serv.get();
-  if (NS_SUCCEEDED(serv->Init())) {
-    return serv.forget();
-  }
-  return nullptr;
-}
-
-nsDownloadManager::~nsDownloadManager()
-{
-  MOZ_ASSERT(gDownloadManagerService == this);
-  gDownloadManagerService = nullptr;
-}
-
-nsresult
-nsDownloadManager::Init()
-{
-  nsresult rv;
-
-  nsCOMPtr<nsIStringBundleService> bundleService =
-    mozilla::services::GetStringBundleService();
-  if (!bundleService)
-    return NS_ERROR_FAILURE;
-
-  rv = bundleService->CreateBundle(DOWNLOAD_MANAGER_BUNDLE,
-                                   getter_AddRefs(mBundle));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return NS_OK;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-//// nsIDownloadManager
-
-NS_IMETHODIMP
-nsDownloadManager::GetActivePrivateDownloadCount(int32_t* aResult)
-{
-  return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP
-nsDownloadManager::GetActiveDownloadCount(int32_t *aResult)
-{
-  return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP
-nsDownloadManager::GetActiveDownloads(nsISimpleEnumerator **aResult)
-{
-  return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP
-nsDownloadManager::GetActivePrivateDownloads(nsISimpleEnumerator **aResult)
-{
-  return NS_ERROR_UNEXPECTED;
-}
-
-/**
- * For platforms where helper apps use the downloads directory (i.e. mobile),
- * this should be kept in sync with nsExternalHelperAppService.cpp
- */
-NS_IMETHODIMP
-nsDownloadManager::GetDefaultDownloadsDirectory(nsIFile **aResult)
-{
-  nsCOMPtr<nsIFile> downloadDir;
-
-  nsresult rv;
-  nsCOMPtr<nsIProperties> dirService =
-     do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // OSX 10.4:
-  // Desktop
-  // OSX 10.5:
-  // User download directory
-  // Vista:
-  // Downloads
-  // XP/2K:
-  // My Documents/Downloads
-  // Linux:
-  // XDG user dir spec, with a fallback to Home/Downloads
-
-  nsAutoString folderName;
-  mBundle->GetStringFromName("downloadsFolder", folderName);
-
-#if defined (XP_MACOSX)
-  rv = dirService->Get(NS_OSX_DEFAULT_DOWNLOAD_DIR,
-                       NS_GET_IID(nsIFile),
-                       getter_AddRefs(downloadDir));
-  NS_ENSURE_SUCCESS(rv, rv);
-#elif defined(XP_WIN)
-  rv = dirService->Get(NS_WIN_DEFAULT_DOWNLOAD_DIR,
-                       NS_GET_IID(nsIFile),
-                       getter_AddRefs(downloadDir));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // Check the os version
-  nsCOMPtr<nsIPropertyBag2> infoService =
-     do_GetService(NS_SYSTEMINFO_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  int32_t version;
-  NS_NAMED_LITERAL_STRING(osVersion, "version");
-  rv = infoService->GetPropertyAsInt32(osVersion, &version);
-  NS_ENSURE_SUCCESS(rv, rv);
-  if (version < 6) { // XP/2K
-    // First get "My Documents"
-    rv = dirService->Get(NS_WIN_PERSONAL_DIR,
-                         NS_GET_IID(nsIFile),
-                         getter_AddRefs(downloadDir));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    rv = downloadDir->Append(folderName);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    // This could be the first time we are creating the downloads folder in My
-    // Documents, so make sure it exists.
-    bool exists;
-    rv = downloadDir->Exists(&exists);
-    NS_ENSURE_SUCCESS(rv, rv);
-    if (!exists) {
-      rv = downloadDir->Create(nsIFile::DIRECTORY_TYPE, 0755);
-      NS_ENSURE_SUCCESS(rv, rv);
-    }
-  }
-#elif defined(XP_UNIX)
-#if defined(MOZ_WIDGET_ANDROID)
-    // Android doesn't have a $HOME directory, and by default we only have
-    // write access to /data/data/org.mozilla.{$APP} and /sdcard
-    char* downloadDirPath = getenv("DOWNLOADS_DIRECTORY");
-    if (downloadDirPath) {
-      rv = NS_NewNativeLocalFile(nsDependentCString(downloadDirPath),
-                                 true, getter_AddRefs(downloadDir));
-      NS_ENSURE_SUCCESS(rv, rv);
-    }
-    else {
-      rv = NS_ERROR_FAILURE;
-    }
-#else
-  rv = dirService->Get(NS_UNIX_DEFAULT_DOWNLOAD_DIR,
-                       NS_GET_IID(nsIFile),
-                       getter_AddRefs(downloadDir));
-  // fallback to Home/Downloads
-  if (NS_FAILED(rv)) {
-    rv = dirService->Get(NS_UNIX_HOME_DIR,
-                         NS_GET_IID(nsIFile),
-                         getter_AddRefs(downloadDir));
-    NS_ENSURE_SUCCESS(rv, rv);
-    rv = downloadDir->Append(folderName);
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-#endif
-#else
-  rv = dirService->Get(NS_OS_HOME_DIR,
-                       NS_GET_IID(nsIFile),
-                       getter_AddRefs(downloadDir));
-  NS_ENSURE_SUCCESS(rv, rv);
-  rv = downloadDir->Append(folderName);
-  NS_ENSURE_SUCCESS(rv, rv);
-#endif
-
-  downloadDir.forget(aResult);
-
-  return NS_OK;
-}
-
-#define NS_BRANCH_DOWNLOAD     "browser.download."
-#define NS_PREF_FOLDERLIST     "folderList"
-#define NS_PREF_DIR            "dir"
-
-NS_IMETHODIMP
-nsDownloadManager::GetUserDownloadsDirectory(nsIFile **aResult)
-{
-  nsresult rv;
-  nsCOMPtr<nsIProperties> dirService =
-     do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsIPrefService> prefService =
-     do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsIPrefBranch> prefBranch;
-  rv = prefService->GetBranch(NS_BRANCH_DOWNLOAD,
-                              getter_AddRefs(prefBranch));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  int32_t val;
-  rv = prefBranch->GetIntPref(NS_PREF_FOLDERLIST,
-                              &val);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  switch(val) {
-    case 0: // Desktop
-      {
-        nsCOMPtr<nsIFile> downloadDir;
-        rv = dirService->Get(NS_OS_DESKTOP_DIR,
-                             NS_GET_IID(nsIFile),
-                             getter_AddRefs(downloadDir));
-        NS_ENSURE_SUCCESS(rv, rv);
-        downloadDir.forget(aResult);
-        return NS_OK;
-      }
-      break;
-    case 1: // Downloads
-      return GetDefaultDownloadsDirectory(aResult);
-    case 2: // Custom
-      {
-        nsCOMPtr<nsIFile> customDirectory;
-        prefBranch->GetComplexValue(NS_PREF_DIR,
-                                    NS_GET_IID(nsIFile),
-                                    getter_AddRefs(customDirectory));
-        if (customDirectory) {
-          bool exists = false;
-          (void)customDirectory->Exists(&exists);
-
-          if (!exists) {
-            rv = customDirectory->Create(nsIFile::DIRECTORY_TYPE, 0755);
-            if (NS_SUCCEEDED(rv)) {
-              customDirectory.forget(aResult);
-              return NS_OK;
-            }
-
-            // Create failed, so it still doesn't exist.  Fall out and get the
-            // default downloads directory.
-          }
-
-          bool writable = false;
-          bool directory = false;
-          (void)customDirectory->IsWritable(&writable);
-          (void)customDirectory->IsDirectory(&directory);
-
-          if (exists && writable && directory) {
-            customDirectory.forget(aResult);
-            return NS_OK;
-          }
-        }
-        rv = GetDefaultDownloadsDirectory(aResult);
-        if (NS_SUCCEEDED(rv)) {
-          (void)prefBranch->SetComplexValue(NS_PREF_DIR,
-                                            NS_GET_IID(nsIFile),
-                                            *aResult);
-        }
-        return rv;
-      }
-      break;
-  }
-  return NS_ERROR_INVALID_ARG;
-}
-
-NS_IMETHODIMP
-nsDownloadManager::AddDownload(int16_t aDownloadType,
-                               nsIURI *aSource,
-                               nsIURI *aTarget,
-                               const nsAString& aDisplayName,
-                               nsIMIMEInfo *aMIMEInfo,
-                               PRTime aStartTime,
-                               nsIFile *aTempFile,
-                               nsICancelable *aCancelable,
-                               bool aIsPrivate,
-                               nsIDownload **aDownload)
-{
-  return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP
-nsDownloadManager::GetDownload(uint32_t aID, nsIDownload **aDownloadItem)
-{
-  return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP
-nsDownloadManager::GetDownloadByGUID(const nsACString& aGUID,
-                                     nsIDownloadManagerResult* aCallback)
-{
-  return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP
-nsDownloadManager::CancelDownload(uint32_t aID)
-{
-  return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP
-nsDownloadManager::RetryDownload(uint32_t aID)
-{
-  return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP
-nsDownloadManager::RemoveDownload(uint32_t aID)
-{
-  return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP
-nsDownloadManager::RemoveDownloadsByTimeframe(int64_t aStartTime,
-                                              int64_t aEndTime)
-{
-  return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP
-nsDownloadManager::CleanUp()
-{
-  return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP
-nsDownloadManager::CleanUpPrivate()
-{
-  return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP
-nsDownloadManager::GetCanCleanUp(bool *aResult)
-{
-  return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP
-nsDownloadManager::GetCanCleanUpPrivate(bool *aResult)
-{
-  return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP
-nsDownloadManager::PauseDownload(uint32_t aID)
-{
-  return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP
-nsDownloadManager::ResumeDownload(uint32_t aID)
-{
-  return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP
-nsDownloadManager::GetDBConnection(mozIStorageConnection **aDBConn)
-{
-  return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP
-nsDownloadManager::GetPrivateDBConnection(mozIStorageConnection **aDBConn)
-{
-  return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP
-nsDownloadManager::AddListener(nsIDownloadProgressListener *aListener)
-{
-  return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP
-nsDownloadManager::AddPrivacyAwareListener(nsIDownloadProgressListener *aListener)
-{
-  return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP
-nsDownloadManager::RemoveListener(nsIDownloadProgressListener *aListener)
-{
-  return NS_ERROR_UNEXPECTED;
-}
deleted file mode 100644
--- a/toolkit/components/downloads/nsDownloadManager.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef downloadmanager___h___
-#define downloadmanager___h___
-
-#include "nsIDownloadManager.h"
-#include "nsIDownloadProgressListener.h"
-#include "nsIFile.h"
-#include "nsIStringBundle.h"
-#include "nsISupportsPrimitives.h"
-#include "nsString.h"
-
-class nsDownloadManager final : public nsIDownloadManager
-{
-public:
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOWNLOADMANAGER
-
-  nsresult Init();
-
-  static already_AddRefed<nsDownloadManager> GetSingleton();
-
-  nsDownloadManager()
-  {
-  }
-
-protected:
-  virtual ~nsDownloadManager();
-
-private:
-  nsCOMPtr<nsIStringBundle> mBundle;
-
-  static nsDownloadManager *gDownloadManagerService;
-};
-
-#endif
deleted file mode 100644
--- a/toolkit/components/downloads/nsIDownload.idl
+++ /dev/null
@@ -1,175 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsITransfer.idl"
-
-interface nsIURI;
-interface nsIFile;
-interface nsIObserver;
-interface nsICancelable;
-interface nsIWebProgressListener;
-interface nsIMIMEInfo;
-
-/**
- * Represents a download object.
- *
- * @note This object is no longer updated once it enters a completed state.
- *       Completed states are the following:  
- *       nsIDownloadManager::DOWNLOAD_FINISHED  
- *       nsIDownloadManager::DOWNLOAD_FAILED  
- *       nsIDownloadManager::DOWNLOAD_CANCELED 
- *       nsIDownloadManager::DOWNLOAD_BLOCKED_PARENTAL 
- *       nsIDownloadManager::DOWNLOAD_DIRTY 
- *       nsIDownloadManager::DOWNLOAD_BLOCKED_POLICY 
- */
-[scriptable, uuid(2258f465-656e-4566-87cb-f791dbaf0322)]
-interface nsIDownload : nsITransfer {
-    
-    /**
-     * The target of a download is always a file on the local file system.
-     */
-    readonly attribute nsIFile targetFile;
-
-    /**
-     * The percentage of transfer completed.
-     * If the file size is unknown it'll be -1 here.
-     */
-    readonly attribute long percentComplete;
-
-    /**
-     * The amount of bytes downloaded so far.
-     */
-    readonly attribute long long amountTransferred;
-
-    /**
-     * The size of file in bytes.
-     * Unknown size is represented by -1.
-     */
-    readonly attribute long long size;
-    
-    /**
-     * The source of the transfer.
-     */
-    readonly attribute nsIURI source;
-    
-    /**
-     * The target of the transfer.
-     */
-    readonly attribute nsIURI target;
- 
-    /**
-     * Object that can be used to cancel the download.
-     * Will be null after the download is finished.
-     */
-    readonly attribute nsICancelable cancelable;
-
-    /**
-     * The user-readable description of the transfer.
-     */
-    readonly attribute AString displayName;
-
-    /**
-     * The time a transfer was started.
-     */
-    readonly attribute long long startTime;
-
-    /**
-     * The speed of the transfer in bytes/sec.
-     */
-    readonly attribute double speed;
-
-    /**
-     * Optional. If set, it will contain the target's relevant MIME information.
-     * This includes its MIME Type, helper app, and whether that helper should be
-     * executed.
-     */
-    readonly attribute nsIMIMEInfo MIMEInfo;
-
-    /**
-     * The id of the download that is stored in the database - not globally unique.
-     * For example, a private download and a public one might have identical ids.
-     * Can only be safely used for direct database manipulation in the database that
-     * contains this download. Use the guid property instead for safe, database-agnostic
-     * searching and manipulation.
-     *
-     * @deprecated
-     */
-    readonly attribute unsigned long id;
-
-    /**
-     * The guid of the download that is stored in the database.
-     * Has the form of twelve alphanumeric characters.
-     */
-    readonly attribute ACString guid;
-
-    /**
-     * The state of the download.
-     * @see nsIDownloadManager and nsIXPInstallManagerUI
-     */
-    readonly attribute short state;
-
-    /**
-     * The referrer uri of the download.  This is only valid for HTTP downloads,
-     * and can be null.
-     */
-    readonly attribute nsIURI referrer;
-
-    /**
-     * Indicates if the download can be resumed after being paused or not.  This
-     * is only the case if the download is over HTTP/1.1 or FTP and if the
-     * server supports it.
-     */
-    readonly attribute boolean resumable;
-
-    /**
-     * Indicates if the download was initiated from a context marked as private,
-     * controlling whether it should be stored in a permanent manner or not.
-     */
-    readonly attribute boolean isPrivate;
-
-    /**
-     * Cancel this download if it's currently in progress.
-     */
-    void cancel();
-
-    /**
-     * Pause this download if it is in progress.
-     *
-     * @throws NS_ERROR_UNEXPECTED if it cannot be paused.
-     */
-    void pause();
-
-    /**
-     * Resume this download if it is paused.
-     *
-     * @throws NS_ERROR_UNEXPECTED if it cannot be resumed or is not paused.
-     */
-    void resume();
-
-    /**
-     * Instruct the download manager to remove this download. Whereas
-     * cancel simply cancels the transfer, but retains information about it,
-     * remove removes all knowledge of it.
-     *
-     * @see nsIDownloadManager.removeDownload for more detail
-     * @throws NS_ERROR_FAILURE if the download is active.
-     */
-    void remove();
-
-    /**
-     * Instruct the download manager to retry this failed download
-     * @throws NS_ERROR_NOT_AVAILABLE if the download is not known.
-     * @throws NS_ERROR_FAILURE if the download is not in the following states:
-     *         nsIDownloadManager::DOWNLOAD_CANCELED
-     *         nsIDownloadManager::DOWNLOAD_FAILED
-     */
-    void retry();
-};
-
-%{C++
-// {b02be33b-d47c-4bd3-afd9-402a942426b0}
-#define NS_DOWNLOAD_CID \
-  { 0xb02be33b, 0xd47c, 0x4bd3, { 0xaf, 0xd9, 0x40, 0x2a, 0x94, 0x24, 0x26, 0xb0 } }
-%}
deleted file mode 100644
--- a/toolkit/components/downloads/nsIDownloadManager.idl
+++ /dev/null
@@ -1,358 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Keeps track of ongoing downloads, in the form of nsIDownload's. 
-
-#include "nsISupports.idl"
-
-interface nsIURI;
-interface nsIFile;
-interface nsIDownload;
-interface nsICancelable;
-interface nsIMIMEInfo;
-interface nsIDownloadProgressListener;
-interface nsISimpleEnumerator;
-interface mozIStorageConnection;
-
-[scriptable, function, uuid(0c07ffeb-791b-49f3-ae38-2c331fd55a52)]
-interface nsIDownloadManagerResult : nsISupports {
-  /**
-   * Process an asynchronous result from getDownloadByGUID.
-   *
-   * @param aStatus The result code of the operation:
-   *        * NS_OK: an item was found. No other success values are returned.
-   *        * NS_ERROR_NOT_AVAILABLE: no such item was found.
-   *        * Other error values are possible, but less well-defined.
-   */
-  void handleResult(in nsresult aStatus, in nsIDownload aDownload);
-};
-
-[scriptable, uuid(b29aac15-7ec4-4ab3-a53b-08f78aed3b34)]
-interface nsIDownloadManager : nsISupports {
-  /**
-   * Download type for generic file download.
-   */
-  const short DOWNLOAD_TYPE_DOWNLOAD = 0;
-
-  /**
-   * Download state for uninitialized download object.
-   */
-  const short DOWNLOAD_NOTSTARTED = -1;
-
-  /**
-   * Download is currently transferring data.
-   */
-  const short DOWNLOAD_DOWNLOADING = 0;
-
-  /**
-   * Download completed including any processing of the target
-   * file.  (completed)
-   */
-  const short DOWNLOAD_FINISHED = 1;
-
-  /**
-   * Transfer failed due to error. (completed)
-   */
-  const short DOWNLOAD_FAILED = 2;
-
-  /**
-   * Download was canceled by the user. (completed)
-   */
-  const short DOWNLOAD_CANCELED = 3;
-
-  /**
-   * Transfer was paused by the user.
-   */
-  const short DOWNLOAD_PAUSED = 4;
-
-  /**
-   * Download is active but data has not yet been received.
-   */
-  const short DOWNLOAD_QUEUED = 5;
-
-  /**
-   * Transfer request was blocked by parental controls proxies. (completed)
-   */
-  const short DOWNLOAD_BLOCKED_PARENTAL = 6;
-
-  /**
-   * Transferred download is being scanned by virus scanners.
-   */
-  const short DOWNLOAD_SCANNING = 7;
-
-  /**
-   * A virus was detected in the download. The target will most likely
-   * no longer exist. (completed)
-   */
-  const short DOWNLOAD_DIRTY = 8;
-
-  /**
-   * Win specific: Request was blocked by zone policy settings.
-   * (see bug #416683) (completed)
-   */
-  const short DOWNLOAD_BLOCKED_POLICY = 9;
-
-
-  /**
-   * Creates an nsIDownload and adds it to be managed by the download manager.
-   *
-   * @param aSource The source URI of the transfer. Must not be null.
-   *
-   * @param aTarget The target URI of the transfer. Must not be null.
-   *
-   * @param aDisplayName The user-readable description of the transfer.
-   *                     Can be empty.
-   *
-   * @param aMIMEInfo The MIME info associated with the target,
-   *                  including MIME type and helper app when appropriate.
-   *                  This parameter is optional.
-   *
-   * @param startTime Time when the download started
-   *
-   * @param aTempFile The location of a temporary file; i.e. a file in which
-   *                  the received data will be stored, but which is not
-   *                  equal to the target file. (will be moved to the real
-   *                  target by the DownloadManager, when the download is
-   *                  finished). This will be null for all callers except for
-   *                  nsExternalHelperAppHandler. Addons should generally pass
-   *                  null for aTempFile. This will be moved to the real target
-   *                  by the download manager when the download is finished,
-   *                  and the action indicated by aMIMEInfo will be executed.
-   *
-   * @param aCancelable An object that can be used to abort the download.
-   *                    Must not be null.
-   *
-   * @param aIsPrivate Used to determine the privacy status of the new download.
-   *                   If true, the download is stored in a manner that leaves
-   *                   no permanent trace outside of the current private session.
-   *
-   * @return The newly created download item with the passed-in properties.
-   *
-   * @note This does not actually start a download.  If you want to add and
-   *       start a download, you need to create an nsIWebBrowserPersist, pass it
-   *       as the aCancelable object, call this method, set the progressListener
-   *       as the returned download object, then call saveURI.
-   */
-  nsIDownload addDownload(in short aDownloadType, 
-                          in nsIURI aSource,
-                          in nsIURI aTarget,
-                          in AString aDisplayName,
-                          in nsIMIMEInfo aMIMEInfo,
-                          in PRTime aStartTime,
-                          in nsIFile aTempFile,
-                          in nsICancelable aCancelable,
-                          in boolean aIsPrivate);
-
-  /**
-   * Retrieves a download managed by the download manager.  This can be one that
-   * is in progress, or one that has completed in the past and is stored in the
-   * database.
-   *
-   * @param aID The unique ID of the download.
-   * @return The download with the specified ID.
-   * @throws NS_ERROR_NOT_AVAILABLE if the download is not in the database.
-   */
-  nsIDownload getDownload(in unsigned long aID);
-
-  /**
-   * Retrieves a download managed by the download manager.  This can be one that
-   * is in progress, or one that has completed in the past and is stored in the
-   * database.  The result of this method is returned via an asynchronous callback,
-   * the parameter of which will be an nsIDownload object, or null if none exists
-   * with the provided GUID.
-   *
-   * @param aGUID The unique GUID of the download.
-   * @param aCallback The callback to invoke with the result of the search.
-   */
-  void getDownloadByGUID(in ACString aGUID, in nsIDownloadManagerResult aCallback);
-
-  /**
-   * Cancels the download with the specified ID if it's currently in-progress.
-   * This calls cancel(NS_BINDING_ABORTED) on the nsICancelable provided by the
-   * download.
-   *
-   * @param aID The unique ID of the download.
-   * @throws NS_ERROR_FAILURE if the download is not in-progress.
-   */
-  void cancelDownload(in unsigned long aID);
-
-  /**
-   * Removes the download with the specified id if it's not currently
-   * in-progress.  Whereas cancelDownload simply cancels the transfer, but
-   * retains information about it, removeDownload removes all knowledge of it.
-   *
-   * Also notifies observers of the "download-manager-remove-download-guid"
-   * topic with the download guid as the subject to allow any DM consumers to
-   * react to the removal.
-   *
-   * Also may notify observers of the "download-manager-remove-download" topic
-   * with the download id as the subject, if the download removed is public
-   * or if global private browsing mode is in use. This notification is deprecated;
-   * the guid notification should be relied upon instead.
-   *
-   * @param aID The unique ID of the download.
-   * @throws NS_ERROR_FAILURE if the download is active.
-   */
-  void removeDownload(in unsigned long aID);
-
-  /**
-   * Removes all inactive downloads that were started inclusively within the
-   * specified time frame.
-   *
-   * @param aBeginTime
-   *        The start time to remove downloads by in microseconds.
-   * @param aEndTime
-   *        The end time to remove downloads by in microseconds.
-   */
-  void removeDownloadsByTimeframe(in long long aBeginTime,
-                                  in long long aEndTime);
-
-  /**
-   * Pause the specified download.
-   *
-   * @param aID The unique ID of the download.
-   * @throws NS_ERROR_FAILURE if the download is not in-progress.
-   */
-  void pauseDownload(in unsigned long aID);
-
-  /**
-   * Resume the specified download.
-   *
-   * @param aID The unique ID of the download.
-   * @throws NS_ERROR_FAILURE if the download is not in-progress.
-   */
-  void resumeDownload(in unsigned long aID);
-
-  /**
-   * Retries a failed download.
-   *
-   * @param aID The unique ID of the download.
-   * @throws NS_ERROR_NOT_AVAILALE if the download id is not known.
-   * @throws NS_ERROR_FAILURE if the download is not in the following states:
-   *           nsIDownloadManager::DOWNLOAD_CANCELED
-   *           nsIDownloadManager::DOWNLOAD_FAILED
-   */
-  void retryDownload(in unsigned long aID);
-
-  /**
-   * The database connection to the downloads database.
-   */
-  readonly attribute mozIStorageConnection DBConnection;
-  readonly attribute mozIStorageConnection privateDBConnection;
-
-  /** 
-   * Whether or not there are downloads that can be cleaned up (removed)
-   * i.e. downloads that have completed, have failed or have been canceled.
-   * In global private browsing mode, this reports the status of the relevant
-   * private or public downloads. In per-window mode, it only reports for
-   * public ones.
-   */
-  readonly attribute boolean canCleanUp;
-
-  /** 
-   * Whether or not there are private downloads that can be cleaned up (removed)
-   * i.e. downloads that have completed, have failed or have been canceled.
-   */
-readonly attribute boolean canCleanUpPrivate;
-
-  /** 
-   * Removes completed, failed, and canceled downloads from the list.
-   * In global private browsing mode, this operates on the relevant
-   * private or public downloads. In per-window mode, it only operates
-   * on public ones.
-   *
-   * Also notifies observers of the "download-manager-remove-download-gui"
-   * and "download-manager-remove-download" topics with a null subject to
-   * allow any DM consumers to react to the removals.
-   */
-  void cleanUp();
-
-  /** 
-   * Removes completed, failed, and canceled downloads from the list
-   * of private downloads.
-   *
-   * Also notifies observers of the "download-manager-remove-download-gui"
-   * and "download-manager-remove-download" topics with a null subject to
-   * allow any DM consumers to react to the removals.
-   */
-void cleanUpPrivate();
-
-  /** 
-   * The number of files currently being downloaded.
-   *
-   * In global private browsing mode, this reports the status of the relevant
-   * private or public downloads. In per-window mode, it only reports public
-   * ones.
-   */
-  readonly attribute long activeDownloadCount;
-
-  /** 
-   * The number of private files currently being downloaded.
-   */
-  readonly attribute long activePrivateDownloadCount;
-
-  /**
-   * An enumeration of active nsIDownloads
-   *
-   * In global private browsing mode, this reports the status of the relevant
-   * private or public downloads. In per-window mode, it only reports public
-   * ones.
-   */
-  readonly attribute nsISimpleEnumerator activeDownloads;
-
-  /**
-   * An enumeration of active private nsIDownloads
-   */
-  readonly attribute nsISimpleEnumerator activePrivateDownloads;
-
-  /**
-   * Adds a listener to the download manager. It is expected that this
-   * listener will only access downloads via their deprecated integer id attribute,
-   * and when global private browsing compatibility mode is disabled, this listener
-   * will receive no notifications for downloads marked private.
-   */
-  void addListener(in nsIDownloadProgressListener aListener);
-
-  /**
-   * Adds a listener to the download manager. This listener must be able to
-   * understand and use the guid attribute of downloads for all interactions
-   * with the download manager.
-   */
-  void addPrivacyAwareListener(in nsIDownloadProgressListener aListener);
-
-  /**
-   * Removes a listener from the download manager.
-   */
-  void removeListener(in nsIDownloadProgressListener aListener);
-
-  /**
-   * Returns the platform default downloads directory.
-   */
-  readonly attribute nsIFile defaultDownloadsDirectory;
-
-  /**
-   * Returns the user configured downloads directory. 
-   * The path is dependent on two user configurable prefs
-   * set in preferences:
-   *
-   * browser.download.folderList
-   *   Indicates the location users wish to save downloaded 
-   *   files too.  
-   *   Values: 
-   *     0 - The desktop is the default download location. 
-   *     1 - The system's downloads folder is the default download location. 
-   *     2 - The default download location is elsewhere as specified in  
-   *         browser.download.dir. If invalid, userDownloadsDirectory
-   *         will fallback on defaultDownloadsDirectory.
-   *
-   * browser.download.dir - 
-   *   A local path the user may have selected at some point 
-   *   where downloaded files are saved. The use of which is
-   *   enabled when folderList equals 2. 
-   */
-  readonly attribute nsIFile userDownloadsDirectory;
-};
-
-
deleted file mode 100644
--- a/toolkit/components/downloads/nsIDownloadManagerUI.idl
+++ /dev/null
@@ -1,55 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-interface nsIInterfaceRequestor;
-interface nsIDownload;
-
-[scriptable, uuid(0c76d4cf-0b06-4c1a-9bea-520c7bbdba99)]
-interface nsIDownloadManagerUI : nsISupports {
-  /**
-   * The reason that should be passed when the user requests to show the
-   * download manager's UI.
-   */
-  const short REASON_USER_INTERACTED = 0;
-
-  /**
-   * The reason that should be passed to the show method when we are displaying
-   * the UI because a new download is being added to it.
-   */
-  const short REASON_NEW_DOWNLOAD = 1;
-
- /**
-  * Shows the Download Manager's UI to the user.
-  *
-  * @param [optional] aWindowContext
-  *        The parent window context to show the UI.
-  * @param [optional] aDownload
-  *        The download to be preselected upon opening.
-  * @param [optional] aReason
-  *        The reason to show the download manager's UI.  This defaults to
-  *        REASON_USER_INTERACTED, and should be one of the previously listed
-  *        constants.
-  * @param [optional] aUsePrivateUI
-  *        Pass true as this argument to hint to the implementation that it
-  *        should only display private downloads in the UI, if possible.
-  */
-  void show([optional] in nsIInterfaceRequestor aWindowContext,
-            [optional] in nsIDownload aDownload,
-            [optional] in short aReason,
-            [optional] in boolean aUsePrivateUI);
-
- /**
-  * Indicates if the UI is visible or not.
-  */
-  readonly attribute boolean visible;
-
- /**
-  * Brings attention to the UI if it is already visible
-  *
-  * @throws NS_ERROR_UNEXPECTED if the UI is not visible.
-  */
-  void getAttention();
-};
-
deleted file mode 100644
--- a/toolkit/components/downloads/nsIDownloadProgressListener.idl
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* A minimally extended progress listener used by download manager
- * to update its default UI.  This is implemented in nsDownloadProgressListener.js.
- * See nsIWebProgressListener for documentation, and use its constants.  This isn't
- * too pretty, but the alternative is having this extend nsIWebProgressListener and
- * adding an |item| attribute, which would mean a separate nsIDownloadProgressListener
- * for every nsIDownloadItem, which is a waste...
- */
-
-#include "nsISupports.idl"
-
-interface nsIWebProgress;
-interface nsIRequest;
-interface nsIURI;
-interface nsIDownload;
-interface nsIDOMDocument;
-
-[scriptable, uuid(7acb07ea-cac2-4c15-a3ad-23aaa789ed51)]
-interface nsIDownloadProgressListener : nsISupports {
-
- /**
-  * document
-  * The document of the download manager frontend.
-  */
-  
-  attribute nsIDOMDocument document;
-
- /**
-  * Dispatched whenever the state of the download changes.
-  *
-  * @param aState The previous download sate.
-  * @param aDownload The download object.
-  * @see nsIDownloadManager for download states.
-  */
-  void onDownloadStateChange(in short aState, in nsIDownload aDownload);
-
-  void onStateChange(in nsIWebProgress aWebProgress,
-                     in nsIRequest aRequest,
-                     in unsigned long aStateFlags,
-                     in nsresult aStatus,
-                     in nsIDownload aDownload);
-
-  void onProgressChange(in nsIWebProgress aWebProgress,
-                        in nsIRequest aRequest,
-                        in long long aCurSelfProgress,
-                        in long long aMaxSelfProgress,
-                        in long long aCurTotalProgress,
-                        in long long aMaxTotalProgress,
-                        in nsIDownload aDownload);
-
-  void onSecurityChange(in nsIWebProgress aWebProgress,
-                        in nsIRequest aRequest,
-                        in unsigned long aState,
-                        in nsIDownload aDownload);
-
-};
--- a/toolkit/components/moz.build
+++ b/toolkit/components/moz.build
@@ -24,17 +24,16 @@ DIRS += [
     'browser',
     'cloudstorage',
     'commandlines',
     'contentprefs',
     'contextualidentity',
     'crashes',
     'crashmonitor',
     'diskspacewatcher',
-    'downloads',
     'enterprisepolicies',
     'extensions',
     'filewatcher',
     'finalizationwitness',
     'find',
     'jsdownloads',
     'jsoncpp/src/lib_json',
     'lz4',
--- a/toolkit/modules/Services.jsm
+++ b/toolkit/modules/Services.jsm
@@ -71,17 +71,16 @@ XPCOMUtils.defineLazyGetter(Services, "i
 
 var initTable = {
   appShell: ["@mozilla.org/appshell/appShellService;1", "nsIAppShellService"],
   cache: ["@mozilla.org/network/cache-service;1", "nsICacheService"],
   cache2: ["@mozilla.org/netwerk/cache-storage-service;1", "nsICacheStorageService"],
   cpmm: ["@mozilla.org/childprocessmessagemanager;1", "nsIMessageSender"],
   console: ["@mozilla.org/consoleservice;1", "nsIConsoleService"],
   cookies: ["@mozilla.org/cookiemanager;1", "nsICookieManager"],
-  downloads: ["@mozilla.org/download-manager;1", "nsIDownloadManager"],
   droppedLinkHandler: ["@mozilla.org/content/dropped-link-handler;1", "nsIDroppedLinkHandler"],
   els: ["@mozilla.org/eventlistenerservice;1", "nsIEventListenerService"],
   eTLD: ["@mozilla.org/network/effective-tld-service;1", "nsIEffectiveTLDService"],
   intl: ["@mozilla.org/mozintl;1", "mozIMozIntl"],
   locale: ["@mozilla.org/intl/localeservice;1", "mozILocaleService"],
   logins: ["@mozilla.org/login-manager;1", "nsILoginManager"],
   obs: ["@mozilla.org/observer-service;1", "nsIObserverService"],
   perms: ["@mozilla.org/permissionmanager;1", "nsIPermissionManager"],
--- a/toolkit/modules/tests/xpcshell/test_Services.js
+++ b/toolkit/modules/tests/xpcshell/test_Services.js
@@ -28,17 +28,16 @@ function run_test() {
   checkService("cache2", Ci.nsICacheStorageService);
   checkService("clipboard", Ci.nsIClipboard);
   checkService("console", Ci.nsIConsoleService);
   checkService("cookies", Ci.nsICookieManager);
   checkService("dirsvc", Ci.nsIDirectoryService);
   checkService("dirsvc", Ci.nsIProperties);
   checkService("DOMRequest", Ci.nsIDOMRequestService);
   checkService("domStorageManager", Ci.nsIDOMStorageManager);
-  checkService("downloads", Ci.nsIDownloadManager);
   checkService("droppedLinkHandler", Ci.nsIDroppedLinkHandler);
   checkService("eTLD", Ci.nsIEffectiveTLDService);
   checkService("focus", Ci.nsIFocusManager);
   checkService("io", Ci.nsIIOService);
   checkService("intl", Ci.mozIMozIntl);
   checkService("locale", Ci.mozILocaleService);
   checkService("logins", Ci.nsILoginManager);
   checkService("obs", Ci.nsIObserverService);
deleted file mode 100644
index 82ec7afe137ad82e6330df40291afb2ae665d2c8..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
--- a/toolkit/themes/linux/mozapps/jar.mn
+++ b/toolkit/themes/linux/mozapps/jar.mn
@@ -1,15 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 toolkit.jar:
 #include ../../shared/mozapps.inc.mn
-  skin/classic/mozapps/downloads/downloadIcon.png          (downloads/downloadIcon.png)
 * skin/classic/mozapps/extensions/extensions.css           (extensions/extensions.css)
 * skin/classic/mozapps/extensions/newaddon.css             (extensions/newaddon.css)
   skin/classic/mozapps/extensions/heart.png                (extensions/heart.png)
   skin/classic/mozapps/profile/profileicon.png             (profile/profileicon.png)
   skin/classic/mozapps/update/updates.css                  (update/updates.css)
 
 #if MOZ_BUILD_APP == browser
 [browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}] chrome.jar:
deleted file mode 100644
index 1d5cedd0ae72b39c1b7f5458272e406439676b8e..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
--- a/toolkit/themes/osx/mozapps/jar.mn
+++ b/toolkit/themes/osx/mozapps/jar.mn
@@ -1,16 +1,15 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 toolkit.jar:
 #include ../../shared/mozapps.inc.mn
   skin/classic/mozapps/downloads/buttons.png                      (downloads/buttons.png)
-  skin/classic/mozapps/downloads/downloadIcon.png                 (downloads/downloadIcon.png)
   skin/classic/mozapps/downloads/unknownContentType.css           (downloads/unknownContentType.css)
   skin/classic/mozapps/extensions/discover-logo.png               (extensions/discover-logo.png)
   skin/classic/mozapps/extensions/rating-won.png                  (extensions/rating-won.png)
   skin/classic/mozapps/extensions/rating-not-won.png              (extensions/rating-not-won.png)
   skin/classic/mozapps/extensions/cancel.png                      (extensions/cancel.png)
   skin/classic/mozapps/extensions/toolbarbutton-dropmarker.png    (extensions/toolbarbutton-dropmarker.png)
   skin/classic/mozapps/extensions/heart.png                       (extensions/heart.png)
   skin/classic/mozapps/extensions/about.css                       (extensions/about.css)
deleted file mode 100644
index 870ea9eb62914636706aed221d4b630870edbe52..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
--- a/toolkit/themes/windows/mozapps/jar.mn
+++ b/toolkit/themes/windows/mozapps/jar.mn
@@ -1,15 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 toolkit.jar:
 #include ../../shared/mozapps.inc.mn
-  skin/classic/mozapps/downloads/downloadIcon.png            (downloads/downloadIcon.png)
 * skin/classic/mozapps/extensions/extensions.css             (extensions/extensions.css)
   skin/classic/mozapps/extensions/heart.png                  (extensions/heart.png)
 * skin/classic/mozapps/extensions/newaddon.css               (extensions/newaddon.css)
   skin/classic/mozapps/profile/profileicon.png               (profile/profileicon.png)
   skin/classic/mozapps/update/updates.css                    (update/updates.css)
 
 #if MOZ_BUILD_APP == browser
 [browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}] chrome.jar: