Bug 1524688: Part 35 - Convert DownloadLegacy to static registration. r=mconley
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 30 Jan 2019 10:38:55 -0800
changeset 459007 517838ee0c3c
parent 459006 f509a5759fdf
child 459008 a1dd5cec066e
push id111909
push usermaglione.k@gmail.com
push dateThu, 14 Feb 2019 02:30:40 +0000
treeherdermozilla-inbound@81dc12cc9257 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1524688
milestone67.0a1
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
Bug 1524688: Part 35 - Convert DownloadLegacy to static registration. r=mconley Differential Revision: https://phabricator.services.mozilla.com/D18445
browser/installer/package-manifest.in
mobile/android/installer/package-manifest.in
toolkit/components/downloads/DownloadLegacy.js
toolkit/components/downloads/DownloadLegacy.jsm
toolkit/components/downloads/Downloads.manifest
toolkit/components/downloads/components.conf
toolkit/components/downloads/moz.build
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -186,18 +186,16 @@
 @RESPATH@/browser/components/aboutdevtools.manifest
 @RESPATH@/browser/components/aboutdevtoolstoolbox-registration.js
 @RESPATH@/browser/components/aboutdevtoolstoolbox.manifest
 @RESPATH@/browser/components/aboutNewTabService.js
 @RESPATH@/browser/components/NewTabComponents.manifest
 @RESPATH@/browser/components/EnterprisePolicies.js
 @RESPATH@/browser/components/EnterprisePoliciesContent.js
 @RESPATH@/browser/components/EnterprisePolicies.manifest
-@RESPATH@/components/Downloads.manifest
-@RESPATH@/components/DownloadLegacy.js
 @RESPATH@/components/crashmonitor.manifest
 @RESPATH@/components/nsCrashMonitor.js
 @RESPATH@/components/toolkitsearch.manifest
 #ifdef NIGHTLY_BUILD
 @RESPATH@/browser/components/payments.manifest
 @RESPATH@/browser/components/paymentUIService.js
 #endif
 @RESPATH@/components/WebVTT.manifest
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -164,19 +164,16 @@
 @BINPATH@/components/TestInterfaceJS.js
 @BINPATH@/components/TestInterfaceJS.manifest
 @BINPATH@/components/TestInterfaceJSMaplike.js
 #endif
 
 @BINPATH@/components/nsAsyncShutdown.manifest
 @BINPATH@/components/nsAsyncShutdown.js
 
-@BINPATH@/components/Downloads.manifest
-@BINPATH@/components/DownloadLegacy.js
-
 #ifndef MOZ_GECKOVIEW_JAR
 @BINPATH@/components/BuiltinProviders.manifest
 @BINPATH@/components/PresentationControlService.js
 @BINPATH@/components/PresentationNetworkHelper.js
 @BINPATH@/components/PresentationNetworkHelper.manifest
 @BINPATH@/components/AndroidCastDeviceProvider.manifest
 @BINPATH@/components/AndroidCastDeviceProvider.js
 #endif
rename from toolkit/components/downloads/DownloadLegacy.js
rename to toolkit/components/downloads/DownloadLegacy.jsm
--- a/toolkit/components/downloads/DownloadLegacy.js
+++ b/toolkit/components/downloads/DownloadLegacy.jsm
@@ -9,18 +9,16 @@
  * New code is expected to use the "Downloads.jsm" module directly, without
  * going through the interfaces implemented in this XPCOM component.  These
  * interfaces are only maintained for backwards compatibility with components
  * that still work synchronously on the main thread.
  */
 
 "use strict";
 
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-
 ChromeUtils.defineModuleGetter(this, "Downloads",
                                "resource://gre/modules/Downloads.jsm");
 
 /**
  * nsITransfer implementation that provides a bridge to a Download object.
  *
  * Legacy downloads work differently than the JavaScript implementation.  In the
  * latter, the caller only provides the properties for the Download object and
@@ -313,9 +311,9 @@ DownloadLegacyTransfer.prototype = {
   _sha256Hash: null,
 
   /**
    * Save the signature info in a serialized protobuf of the downloaded file.
    */
   _signatureInfo: null,
 };
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadLegacyTransfer]);
+var EXPORTED_SYMBOLS = ["DownloadLegacyTransfer"];
deleted file mode 100644
--- a/toolkit/components/downloads/Downloads.manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-component {1b4c85df-cbdd-4bb6-b04e-613caece083c} DownloadLegacy.js
-contract @mozilla.org/transfer;1 {1b4c85df-cbdd-4bb6-b04e-613caece083c}
new file mode 100644
--- /dev/null
+++ b/toolkit/components/downloads/components.conf
@@ -0,0 +1,14 @@
+# -*- 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/.
+
+Classes = [
+    {
+        'cid': '{1b4c85df-cbdd-4bb6-b04e-613caece083c}',
+        'contract_ids': ['@mozilla.org/transfer;1'],
+        'jsm': 'resource://gre/modules/DownloadLegacy.jsm',
+        'constructor': 'DownloadLegacyTransfer',
+    },
+]
--- a/toolkit/components/downloads/moz.build
+++ b/toolkit/components/downloads/moz.build
@@ -19,31 +19,31 @@ XPIDL_SOURCES += [
 XPIDL_MODULE = 'downloads'
 
 CXXFLAGS += CONFIG['TK_CFLAGS']
 
 SOURCES += [
     'DownloadPlatform.cpp',
 ]
 
-EXTRA_COMPONENTS += [
-    'DownloadLegacy.js',
-    'Downloads.manifest',
-]
-
 EXTRA_JS_MODULES += [
     'DownloadCore.jsm',
     'DownloadIntegration.jsm',
+    'DownloadLegacy.jsm',
     'DownloadList.jsm',
     'DownloadPaths.jsm',
     'Downloads.jsm',
     'DownloadStore.jsm',
     'DownloadUIHelper.jsm',
 ]
 
+XPCOM_MANIFESTS += [
+    'components.conf',
+]
+
 if CONFIG['MOZ_PLACES']:
     EXTRA_JS_MODULES += [
         'DownloadHistory.jsm',
     ]
 
 FINAL_LIBRARY = 'xul'
 
 with Files('**'):