Bug 1524688: Part 15 - Convert Weave to static registration. r=markh
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Tue, 29 Jan 2019 20:44:18 -0800
changeset 458988 38e1e42a0fb0
parent 458987 35a5f031dd1e
child 458989 28670fdc418d
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 15 - Convert Weave to static registration. r=markh
browser/installer/package-manifest.in
services/sync/SyncComponents.manifest
services/sync/Weave.js
services/sync/Weave.jsm
services/sync/components.conf
services/sync/moz.build
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -233,17 +233,16 @@
 @RESPATH@/components/nsWebHandlerApp.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/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
 @RESPATH@/components/RemoteSettingsComponents.js
 @RESPATH@/components/cryptoComponents.manifest
--- a/services/sync/SyncComponents.manifest
+++ b/services/sync/SyncComponents.manifest
@@ -1,9 +1,3 @@
-# Weave.js
-component {74b89fb0-f200-4ae8-a3ec-dd164117f6de} Weave.js
-contract @mozilla.org/weave/service;1 {74b89fb0-f200-4ae8-a3ec-dd164117f6de}
-component {d28f8a0b-95da-48f4-b712-caf37097be41} Weave.js
-contract @mozilla.org/network/protocol/about;1?what=sync-log {d28f8a0b-95da-48f4-b712-caf37097be41}
-
 # Register resource aliases
 # (Note, for tests these are also set up in addResourceAlias)
 resource services-sync resource://gre/modules/services-sync/
rename from services/sync/Weave.js
rename to services/sync/Weave.jsm
--- a/services/sync/Weave.js
+++ b/services/sync/Weave.jsm
@@ -1,19 +1,16 @@
 /* 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");
 ChromeUtils.defineModuleGetter(this, "FileUtils",
                                "resource://gre/modules/FileUtils.jsm");
-XPCOMUtils.defineLazyGetter(this, "Utils", () => {
-  return ChromeUtils.import("resource://services-sync/util.js", {}).Utils;
-});
 
 XPCOMUtils.defineLazyPreferenceGetter(this, "syncUsername", "services.sync.username");
 
 /**
  * Sync's XPCOM service.
  *
  * It is named "Weave" for historical reasons.
  *
@@ -152,10 +149,9 @@ AboutWeaveLog.prototype = {
     let principal = Services.scriptSecurityManager.createCodebasePrincipal(uri,
       aLoadInfo.originAttributes);
 
     channel.owner = principal;
     return channel;
   },
 };
 
-const components = [WeaveService, AboutWeaveLog];
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
+var EXPORTED_SYMBOLS = ["WeaveService", "AboutWeaveLog"];
new file mode 100644
--- /dev/null
+++ b/services/sync/components.conf
@@ -0,0 +1,20 @@
+# -*- 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': '{74b89fb0-f200-4ae8-a3ec-dd164117f6de}',
+        'contract_ids': ['@mozilla.org/weave/service;1'],
+        'jsm': 'resource://services-sync/Weave.jsm',
+        'constructor': 'WeaveService',
+    },
+    {
+        'cid': '{d28f8a0b-95da-48f4-b712-caf37097be41}',
+        'contract_ids': ['@mozilla.org/network/protocol/about;1?what=sync-log'],
+        'jsm': 'resource://services-sync/Weave.jsm',
+        'constructor': 'AboutWeaveLog',
+    },
+]
--- a/services/sync/moz.build
+++ b/services/sync/moz.build
@@ -8,17 +8,16 @@ with Files('**'):
     BUG_COMPONENT = ('Firefox', 'Sync')
 
 DIRS += ['locales']
 
 XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
 
 EXTRA_COMPONENTS += [
     'SyncComponents.manifest',
-    'Weave.js',
 ]
 
 EXTRA_JS_MODULES['services-sync'] += [
     'modules/addonsreconciler.js',
     'modules/addonutils.js',
     'modules/bookmark_repair.js',
     'modules/bookmark_validator.js',
     'modules/browserid_identity.js',
@@ -34,16 +33,17 @@ EXTRA_JS_MODULES['services-sync'] += [
     'modules/resource.js',
     'modules/service.js',
     'modules/status.js',
     'modules/SyncDisconnect.jsm',
     'modules/SyncedTabs.jsm',
     'modules/telemetry.js',
     'modules/UIState.jsm',
     'modules/util.js',
+    'Weave.jsm',
 ]
 
 EXTRA_JS_MODULES['services-sync'].engines += [
     'modules/engines/addons.js',
     'modules/engines/bookmarks.js',
     'modules/engines/clients.js',
     'modules/engines/extension-storage.js',
     'modules/engines/forms.js',
@@ -53,16 +53,20 @@ EXTRA_JS_MODULES['services-sync'].engine
     'modules/engines/tabs.js',
 ]
 
 EXTRA_JS_MODULES['services-sync'].stages += [
     'modules/stages/declined.js',
     'modules/stages/enginesync.js',
 ]
 
+XPCOM_MANIFESTS += [
+    'components.conf',
+]
+
 TESTING_JS_MODULES.services.sync += [
     'modules-testing/fakeservices.js',
     'modules-testing/fxa_utils.js',
     'modules-testing/rotaryengine.js',
     'modules-testing/utils.js',
 ]
 
 JS_PREFERENCE_PP_FILES += [