Bug 1524688: Part 42 - Convert nsAsyncShutdown to static registration. r=mconley
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 30 Jan 2019 11:00:27 -0800
changeset 459014 fe9b6695212e
parent 459013 995ea188bc31
child 459015 09f626870ad0
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 42 - Convert nsAsyncShutdown to static registration. r=mconley Differential Revision: https://phabricator.services.mozilla.com/D18452
browser/base/content/test/performance/browser_startup_content.js
browser/installer/package-manifest.in
mobile/android/installer/package-manifest.in
toolkit/components/asyncshutdown/components.conf
toolkit/components/asyncshutdown/moz.build
toolkit/components/asyncshutdown/nsAsyncShutdown.js
toolkit/components/asyncshutdown/nsAsyncShutdown.jsm
toolkit/components/asyncshutdown/nsAsyncShutdown.manifest
--- a/browser/base/content/test/performance/browser_startup_content.js
+++ b/browser/base/content/test/performance/browser_startup_content.js
@@ -94,20 +94,18 @@ const whitelist = {
     "data:,new function() {\n      ChromeUtils.import(\"resource://formautofill/FormAutofillContent.jsm\");\n    }",
   ]),
 };
 
 // Items on this list are allowed to be loaded but not
 // required, as opposed to items in the main whitelist,
 // which are all required.
 const intermittently_loaded_whitelist = {
-  components: new Set([
-    "nsAsyncShutdown.js",
-  ]),
   modules: new Set([
+    "resource://gre/modules/nsAsyncShutdown.jsm",
     "resource://gre/modules/sessionstore/Utils.jsm",
   ]),
   frameScripts: new Set([]),
   processScripts: new Set([]),
 };
 
 const blacklist = {
   services: new Set([
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -241,19 +241,16 @@
 #ifdef ENABLE_MARIONETTE
 @RESPATH@/chrome/marionette@JAREXT@
 @RESPATH@/chrome/marionette.manifest
 @RESPATH@/components/marionette.manifest
 @RESPATH@/components/marionette.js
 @RESPATH@/defaults/pref/marionette.js
 #endif
 
-@RESPATH@/components/nsAsyncShutdown.manifest
-@RESPATH@/components/nsAsyncShutdown.js
-
 @RESPATH@/components/BuiltinProviders.manifest
 @RESPATH@/components/PresentationControlService.js
 
 #if defined(ENABLE_TESTS) && defined(MOZ_DEBUG)
 @RESPATH@/components/TestInterfaceJS.js
 @RESPATH@/components/TestInterfaceJS.manifest
 @RESPATH@/components/TestInterfaceJSMaplike.js
 #endif
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -153,19 +153,16 @@
 @BINPATH@/components/htmlMenuBuilder.manifest
 
 #if defined(ENABLE_TESTS) && defined(MOZ_DEBUG)
 @BINPATH@/components/TestInterfaceJS.js
 @BINPATH@/components/TestInterfaceJS.manifest
 @BINPATH@/components/TestInterfaceJSMaplike.js
 #endif
 
-@BINPATH@/components/nsAsyncShutdown.manifest
-@BINPATH@/components/nsAsyncShutdown.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
new file mode 100644
--- /dev/null
+++ b/toolkit/components/asyncshutdown/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': '{35c496de-a115-475d-93b5-ffa3f3ae6fe3}',
+        'contract_ids': ['@mozilla.org/async-shutdown-service;1'],
+        'jsm': 'resource://gre/modules/nsAsyncShutdown.jsm',
+        'constructor': 'nsAsyncShutdownService',
+    },
+]
--- a/toolkit/components/asyncshutdown/moz.build
+++ b/toolkit/components/asyncshutdown/moz.build
@@ -9,17 +9,17 @@ XPCSHELL_TESTS_MANIFESTS += ['tests/xpcs
 XPIDL_MODULE = 'toolkit_asyncshutdown'
 
 XPIDL_SOURCES += [
     'nsIAsyncShutdown.idl',
 ]
 
 EXTRA_JS_MODULES += [
     'AsyncShutdown.jsm',
+    'nsAsyncShutdown.jsm',
 ]
 
-EXTRA_COMPONENTS += [
-    'nsAsyncShutdown.js',
-    'nsAsyncShutdown.manifest',
+XPCOM_MANIFESTS += [
+    'components.conf',
 ]
 
 with Files('**'):
     BUG_COMPONENT = ('Toolkit', 'Async Tooling')
rename from toolkit/components/asyncshutdown/nsAsyncShutdown.js
rename to toolkit/components/asyncshutdown/nsAsyncShutdown.jsm
--- a/toolkit/components/asyncshutdown/nsAsyncShutdown.js
+++ b/toolkit/components/asyncshutdown/nsAsyncShutdown.jsm
@@ -3,17 +3,16 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * An implementation of nsIAsyncShutdown* based on AsyncShutdown.jsm
  */
 
 "use strict";
 
-var XPCOMUtils = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm", {}).XPCOMUtils;
 ChromeUtils.defineModuleGetter(this, "AsyncShutdown",
   "resource://gre/modules/AsyncShutdown.jsm");
 
 
 /**
  * Conversion between nsIPropertyBag and JS object
  */
 var PropertyBagConverter = {
@@ -169,19 +168,17 @@ nsAsyncShutdownClient.prototype = {
     let moduleBlocker = this._getPromisified(xpcomBlocker);
     if (!moduleBlocker) {
       return false;
     }
     this._deletePromisified(xpcomBlocker);
     return this._moduleClient.removeBlocker(moduleBlocker);
   },
 
-  /* ........ QueryInterface .............. */
   QueryInterface: ChromeUtils.generateQI([Ci.nsIAsyncShutdownBarrier]),
-  classID: Components.ID("{314e9e96-cc37-4d5c-843b-54709ce11426}"),
 };
 
 /**
  * Construct an instance of nsIAsyncShutdownBarrier from an instance
  * of AsyncShutdown.Barrier.
  *
  * @param {object} moduleBarrier an instance if
  * `AsyncShutdown.Barrier`. This instance will serve as back-end for
@@ -201,19 +198,17 @@ nsAsyncShutdownBarrier.prototype = {
   },
   wait(onReady) {
     this._moduleBarrier.wait().then(() => {
       onReady.done();
     });
     // By specification, _moduleBarrier.wait() cannot reject.
   },
 
-  /* ........ QueryInterface .............. */
   QueryInterface: ChromeUtils.generateQI([Ci.nsIAsyncShutdownBarrier]),
-  classID: Components.ID("{29a0e8b5-9111-4c09-a0eb-76cd02bf20fa}"),
 };
 
 function nsAsyncShutdownService() {
   // Cache for the getters
 
   for (let _k of
    [// Parent process
     "profileBeforeChange",
@@ -248,19 +243,12 @@ function nsAsyncShutdownService() {
     _propertyBagConverter: PropertyBagConverter,
   };
 }
 nsAsyncShutdownService.prototype = {
   makeBarrier(name) {
     return new nsAsyncShutdownBarrier(new AsyncShutdown.Barrier(name));
   },
 
-  /* ........ QueryInterface .............. */
   QueryInterface: ChromeUtils.generateQI([Ci.nsIAsyncShutdownService]),
-  classID: Components.ID("{35c496de-a115-475d-93b5-ffa3f3ae6fe3}"),
 };
 
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([
-    nsAsyncShutdownService,
-    nsAsyncShutdownBarrier,
-    nsAsyncShutdownClient,
-]);
+var EXPORTED_SYMBOLS = ["nsAsyncShutdownService"];
deleted file mode 100644
--- a/toolkit/components/asyncshutdown/nsAsyncShutdown.manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-component {35c496de-a115-475d-93b5-ffa3f3ae6fe3} nsAsyncShutdown.js
-contract @mozilla.org/async-shutdown-service;1 {35c496de-a115-475d-93b5-ffa3f3ae6fe3}