Bug 1524688: Part 44 - Convert FxAccountsPush to static registration. r=markh
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 30 Jan 2019 11:06:04 -0800
changeset 459016 e657e77d4271
parent 459015 09f626870ad0
child 459017 fe106b369a72
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)
reviewersmarkh
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 44 - Convert FxAccountsPush to static registration. r=markh Differential Revision: https://phabricator.services.mozilla.com/D18454
browser/installer/package-manifest.in
mobile/android/installer/package-manifest.in
services/fxaccounts/FxAccountsComponents.manifest
services/fxaccounts/FxAccountsPush.js
services/fxaccounts/FxAccountsPush.jsm
services/fxaccounts/components.conf
services/fxaccounts/moz.build
services/fxaccounts/tests/xpcshell/test_push_service.js
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -211,18 +211,16 @@
 @RESPATH@/components/contentAreaDropListener.js
 @RESPATH@/components/HandlerService.manifest
 @RESPATH@/components/HandlerService.js
 #ifdef XP_MACOSX
 @RESPATH@/browser/components/MacTouchBar.manifest
 @RESPATH@/browser/components/MacTouchBar.js
 #endif
 @RESPATH@/components/SyncComponents.manifest
-@RESPATH@/components/FxAccountsComponents.manifest
-@RESPATH@/components/FxAccountsPush.js
 @RESPATH@/components/servicesComponents.manifest
 @RESPATH@/components/servicesSettings.manifest
 @RESPATH@/components/cryptoComponents.manifest
 @RESPATH@/components/recording-cmdline.js
 @RESPATH@/components/recording-cmdline.manifest
 @RESPATH@/components/htmlMenuBuilder.js
 @RESPATH@/components/htmlMenuBuilder.manifest
 
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -271,17 +271,16 @@
 @BINPATH@/components/BlocklistPrompt.js
 @BINPATH@/components/BrowserCLH.js
 @BINPATH@/components/ColorPicker.js
 @BINPATH@/components/ContentDispatchChooser.js
 @BINPATH@/components/ContentPermissionPrompt.js
 @BINPATH@/components/ImageBlockingPolicy.js
 @BINPATH@/components/DirectoryProvider.js
 @BINPATH@/components/FilePicker.js
-@BINPATH@/components/FxAccountsPush.js
 @BINPATH@/components/HelperAppDialog.js
 @BINPATH@/components/LoginManagerPrompter.js
 @BINPATH@/components/MobileComponents.manifest
 @BINPATH@/components/NSSDialogService.js
 @BINPATH@/components/PersistentNotificationHandler.js
 @BINPATH@/components/PresentationDevicePrompt.js
 @BINPATH@/components/PresentationRequestUIGlue.js
 @BINPATH@/components/PromptService.js
deleted file mode 100644
--- a/services/fxaccounts/FxAccountsComponents.manifest
+++ /dev/null
@@ -1,4 +0,0 @@
-# FxAccountsPush.js
-component {1b7db999-2ecd-4abf-bb95-a726896798ca} FxAccountsPush.js process=main
-contract @mozilla.org/fxaccounts/push;1 {1b7db999-2ecd-4abf-bb95-a726896798ca} process=main
-category push chrome://fxa-device-update @mozilla.org/fxaccounts/push;1
rename from services/fxaccounts/FxAccountsPush.js
rename to services/fxaccounts/FxAccountsPush.jsm
--- a/services/fxaccounts/FxAccountsPush.js
+++ b/services/fxaccounts/FxAccountsPush.jsm
@@ -1,18 +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/. */
 
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 const {FXA_PUSH_SCOPE_ACCOUNT_UPDATE, ONLOGOUT_NOTIFICATION, ON_ACCOUNT_DESTROYED_NOTIFICATION, ON_ACCOUNT_STATE_CHANGE_NOTIFICATION, ON_COLLECTION_CHANGED_NOTIFICATION, ON_COMMAND_RECEIVED_NOTIFICATION, ON_DEVICE_CONNECTED_NOTIFICATION, ON_DEVICE_DISCONNECTED_NOTIFICATION, ON_PASSWORD_CHANGED_NOTIFICATION, ON_PASSWORD_RESET_NOTIFICATION, ON_PROFILE_CHANGE_NOTIFICATION, ON_PROFILE_UPDATED_NOTIFICATION, ON_VERIFY_LOGIN_NOTIFICATION, log} = ChromeUtils.import("resource://gre/modules/FxAccountsCommon.js");
 
-XPCOMUtils.defineLazyGlobalGetters(this, ["URL"]);
-
 /**
  * FxAccountsPushService manages Push notifications for Firefox Accounts in the browser
  *
  * @param [options]
  *        Object, custom options that used for testing
  * @constructor
  */
 function FxAccountsPushService(options = {}) {
@@ -263,11 +260,9 @@ FxAccountsPushService.prototype = {
             return resolve(null);
           }
           return resolve(subscription);
         });
     });
   },
 };
 
-// Service registration below registers with FxAccountsComponents.manifest
-const components = [FxAccountsPushService];
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
+var EXPORTED_SYMBOLS = ["FxAccountsPushService"];
new file mode 100644
--- /dev/null
+++ b/services/fxaccounts/components.conf
@@ -0,0 +1,16 @@
+# -*- 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': '{1b7db999-2ecd-4abf-bb95-a726896798ca}',
+        'contract_ids': ['@mozilla.org/fxaccounts/push;1'],
+        'jsm': 'resource://gre/modules/FxAccountsPush.jsm',
+        'constructor': 'FxAccountsPushService',
+        'processes': ProcessSelector.MAIN_PROCESS_ONLY,
+        'categories': {'push': 'chrome://fxa-device-update'},
+    },
+]
--- a/services/fxaccounts/moz.build
+++ b/services/fxaccounts/moz.build
@@ -10,26 +10,26 @@ with Files('**'):
 DIRS += ['interfaces']
 
 MOCHITEST_CHROME_MANIFESTS += ['tests/mochitest/chrome.ini']
 
 BROWSER_CHROME_MANIFESTS += ['tests/browser/browser.ini']
 
 XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell/xpcshell.ini']
 
-EXTRA_COMPONENTS += [
-  'FxAccountsComponents.manifest',
-  'FxAccountsPush.js',
-]
-
 EXTRA_JS_MODULES += [
   'Credentials.jsm',
   'FxAccounts.jsm',
   'FxAccountsClient.jsm',
   'FxAccountsCommands.js',
   'FxAccountsCommon.js',
   'FxAccountsConfig.jsm',
   'FxAccountsOAuthGrantClient.jsm',
   'FxAccountsProfile.jsm',
   'FxAccountsProfileClient.jsm',
+  'FxAccountsPush.jsm',
   'FxAccountsStorage.jsm',
   'FxAccountsWebChannel.jsm',
 ]
+
+XPCOM_MANIFESTS += [
+    'components.conf',
+]
--- a/services/fxaccounts/tests/xpcshell/test_push_service.js
+++ b/services/fxaccounts/tests/xpcshell/test_push_service.js
@@ -6,17 +6,17 @@
 // Tests for the FxA push service.
 
 /* eslint-disable no-shadow */
 /* eslint-disable mozilla/use-chromeutils-generateqi */
 
 const {FXA_PUSH_SCOPE_ACCOUNT_UPDATE, ONLOGOUT_NOTIFICATION, ON_ACCOUNT_DESTROYED_NOTIFICATION, ON_DEVICE_CONNECTED_NOTIFICATION, ON_DEVICE_DISCONNECTED_NOTIFICATION, ON_PASSWORD_CHANGED_NOTIFICATION, ON_PASSWORD_RESET_NOTIFICATION, ON_PROFILE_CHANGE_NOTIFICATION, ON_PROFILE_UPDATED_NOTIFICATION, ON_VERIFY_LOGIN_NOTIFICATION, log} = ChromeUtils.import("resource://gre/modules/FxAccountsCommon.js");
 
 let importScope = {};
-Services.scriptloader.loadSubScript("resource://gre/components/FxAccountsPush.js", importScope);
+Services.scriptloader.loadSubScript("resource://gre/modules/FxAccountsPush.jsm", importScope);
 const FxAccountsPushService = importScope.FxAccountsPushService;
 
 XPCOMUtils.defineLazyServiceGetter(this, "pushService",
   "@mozilla.org/push/Service;1", "nsIPushService");
 
 initTestLogging("Trace");
 log.level = Log.Level.Trace;