Bug 1524688: Part 12 - Convert prompter to static registration. r=mconley
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Tue, 29 Jan 2019 20:10:40 -0800
changeset 458985 6dcacead1746
parent 458984 9895239d8ac6
child 458986 b586d55d76d5
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 12 - Convert prompter to static registration. r=mconley
browser/installer/package-manifest.in
dom/browser-element/BrowserElementPromptService.jsm
toolkit/components/prompts/src/Prompter.jsm
toolkit/components/prompts/src/components.conf
toolkit/components/prompts/src/moz.build
toolkit/components/prompts/src/nsPrompter.js
toolkit/components/prompts/src/nsPrompter.manifest
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -238,18 +238,16 @@
 @RESPATH@/components/FormHistoryStartup.js
 @RESPATH@/components/nsInputListAutoComplete.js
 @RESPATH@/components/contentAreaDropListener.manifest
 @RESPATH@/components/contentAreaDropListener.js
 #ifdef XP_MACOSX
 @RESPATH@/browser/components/MacTouchBar.manifest
 @RESPATH@/browser/components/MacTouchBar.js
 #endif
-@RESPATH@/components/nsPrompter.manifest
-@RESPATH@/components/nsPrompter.js
 @RESPATH@/components/SyncComponents.manifest
 @RESPATH@/components/Weave.js
 @RESPATH@/components/FxAccountsComponents.manifest
 @RESPATH@/components/FxAccountsPush.js
 @RESPATH@/components/CaptivePortalDetectComponents.manifest
 @RESPATH@/components/captivedetect.js
 @RESPATH@/components/servicesComponents.manifest
 @RESPATH@/components/servicesSettings.manifest
--- a/dom/browser-element/BrowserElementPromptService.jsm
+++ b/dom/browser-element/BrowserElementPromptService.jsm
@@ -591,18 +591,16 @@ var BrowserElementPromptService = {
     var newCID = BrowserElementPromptFactory.prototype.classID;
     var oldFactory = Cm.getClassObject(Cc[contractID], Ci.nsIFactory);
 
     if (oldCID == newCID) {
       debug("WARNING: Wrapped prompt factory is already installed!");
       return;
     }
 
-    Cm.unregisterFactory(oldCID, oldFactory);
-
     var oldInstance = oldFactory.createInstance(null, Ci.nsIPromptFactory);
     var newInstance = new BrowserElementPromptFactory(oldInstance);
 
     var newFactory = {
       createInstance: function(outer, iid) {
         if (outer != null) {
           throw Cr.NS_ERROR_NO_AGGREGATION;
         }
rename from toolkit/components/prompts/src/nsPrompter.js
rename to toolkit/components/prompts/src/Prompter.jsm
--- a/toolkit/components/prompts/src/nsPrompter.js
+++ b/toolkit/components/prompts/src/Prompter.jsm
@@ -935,10 +935,9 @@ AuthPromptAdapter.prototype = {
 
 // Wrapper using the old embedding contractID, since it's already common in
 // the addon ecosystem.
 function EmbedPrompter() {
 }
 EmbedPrompter.prototype = new Prompter();
 EmbedPrompter.prototype.classID          = Components.ID("{7ad1b327-6dfa-46ec-9234-f2a620ea7e00}");
 
-var component = [Prompter, EmbedPrompter, AuthPromptAdapterFactory];
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component);
+var EXPORTED_SYMBOLS = ["Prompter", "EmbedPrompter", "AuthPromptAdapterFactory"];
new file mode 100644
--- /dev/null
+++ b/toolkit/components/prompts/src/components.conf
@@ -0,0 +1,26 @@
+# -*- 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': '{1c978d25-b37f-43a8-a2d6-0c7a239ead87}',
+        'contract_ids': ['@mozilla.org/prompter;1'],
+        'jsm': 'resource://gre/modules/Prompter.jsm',
+        'constructor': 'Prompter',
+    },
+    {
+        'cid': '{6e134924-6c3a-4d86-81ac-69432dd971dc}',
+        'contract_ids': ['@mozilla.org/network/authprompt-adapter-factory;1'],
+        'jsm': 'resource://gre/modules/Prompter.jsm',
+        'constructor': 'AuthPromptAdapterFactory',
+    },
+    {
+        'cid': '{7ad1b327-6dfa-46ec-9234-f2a620ea7e00}',
+        'contract_ids': ['@mozilla.org/embedcomp/prompt-service;1'],
+        'jsm': 'resource://gre/modules/Prompter.jsm',
+        'constructor': 'EmbedPrompter',
+    },
+]
--- a/toolkit/components/prompts/src/moz.build
+++ b/toolkit/components/prompts/src/moz.build
@@ -1,16 +1,15 @@
 # -*- 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/.
 
-EXTRA_COMPONENTS += [
-    'nsPrompter.js',
-    'nsPrompter.manifest',
-]
-
 EXTRA_JS_MODULES += [
     'CommonDialog.jsm',
+    'Prompter.jsm',
     'SharedPromptUtils.jsm',
 ]
 
+XPCOM_MANIFESTS += [
+    'components.conf',
+]
deleted file mode 100644
--- a/toolkit/components/prompts/src/nsPrompter.manifest
+++ /dev/null
@@ -1,6 +0,0 @@
-component {1c978d25-b37f-43a8-a2d6-0c7a239ead87} nsPrompter.js
-contract @mozilla.org/prompter;1 {1c978d25-b37f-43a8-a2d6-0c7a239ead87}
-component {6e134924-6c3a-4d86-81ac-69432dd971dc} nsPrompter.js
-contract @mozilla.org/network/authprompt-adapter-factory;1 {6e134924-6c3a-4d86-81ac-69432dd971dc}
-component {7ad1b327-6dfa-46ec-9234-f2a620ea7e00} nsPrompter.js
-contract @mozilla.org/embedcomp/prompt-service;1 {7ad1b327-6dfa-46ec-9234-f2a620ea7e00}