Bug 1572621 - Merge services-sync.js into all.js. r=markh
authorNicholas Nethercote <nnethercote@mozilla.com>
Fri, 09 Aug 2019 09:18:41 +0000
changeset 487231 6709b85b9571b152ae46056ee414dcad7a158b75
parent 487230 4c8140acc8ea31f6e0d6dea7b699615015e717cf
child 487232 c03bd9e9ad3e4dfc4b7e93e32c17a784cdf94fd2
push id113866
push usercsabou@mozilla.com
push dateFri, 09 Aug 2019 22:18:05 +0000
treeherdermozilla-inbound@b45f9acbdfe4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarkh
bugs1572621
milestone70.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 1572621 - Merge services-sync.js into all.js. r=markh Differential Revision: https://phabricator.services.mozilla.com/D41323
.eslintignore
.prettierignore
browser/installer/package-manifest.in
modules/libpref/init/all.js
modules/libpref/moz.build
services/sync/modules/engines/addons.js
services/sync/moz.build
services/sync/services-sync.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -270,17 +270,16 @@ security/nss/**
 services/common/kinto-http-client.js
 services/common/kinto-offline-client.js
 
 # Webpack-bundled library
 services/fxaccounts/FxAccountsPairingChannel.js
 
 # Uses `#filter substitution`
 services/sync/modules/constants.js
-services/sync/services-sync.js
 
 # Servo is imported.
 servo/**
 
 # Remote protocol exclusions
 testing/marionette/atom.js
 testing/marionette/legacyaction.js
 testing/marionette/client
--- a/.prettierignore
+++ b/.prettierignore
@@ -24,17 +24,16 @@ mobile/android/app/geckoview-prefs.js
 mobile/android/app/mobile.js
 mobile/android/installer/mobile-l10n.js
 modules/libpref/init/all.js
 modules/libpref/test/unit/data/testParser.js
 modules/libpref/test/unit/data/testPrefLocked.js
 modules/libpref/test/unit/data/testPrefSticky.js
 modules/libpref/test/unit/extdata/testExt.js
 remote/pref/remote.js
-services/sync/services-sync.js
 services/sync/tests/unit/prefs_test_prefs_store.js
 testing/marionette/prefs/marionette.js
 toolkit/components/telemetry/datareporting-prefs.js
 toolkit/components/telemetry/healthreport-prefs.js
 
 # Ignore testing pref files which aren't parsed normally.
 testing/profiles/**/user.js
 
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -299,19 +299,16 @@
 @RESPATH@/browser/defaults/settings/main
 @RESPATH@/browser/defaults/settings/security-state
 
 ; Warning: changing the path to channel-prefs.js can cause bugs (Bug 756325)
 ; Technically this is an app pref file, but we are keeping it in the original
 ; gre location for now.
 @RESPATH@/defaults/pref/channel-prefs.js
 
-; Services (gre) prefs
-@RESPATH@/defaults/pref/services-sync.js
-
 ; [Layout Engine Resources]
 ; Style Sheets, Graphics and other Resources used by the layout engine.
 @RESPATH@/res/EditorOverride.css
 @RESPATH@/res/contenteditable.css
 @RESPATH@/res/designmode.css
 @RESPATH@/res/table-add-column-after-active.gif
 @RESPATH@/res/table-add-column-after-hover.gif
 @RESPATH@/res/table-add-column-after.gif
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -5652,8 +5652,115 @@ pref("fission.preserve_browsing_contexts
 // user profile directory for these stylesheets:
 //  * userContent.css
 //  * userChrome.css
 pref("toolkit.legacyUserProfileCustomizations.stylesheets", false);
 
 pref("services.common.log.logger.rest.request", "Debug");
 pref("services.common.log.logger.rest.response", "Debug");
 pref("services.common.log.logger.tokenserverclient", "Debug");
+
+#ifdef MOZ_SERVICES_SYNC
+pref("services.sync.lastversion", "firstrun");
+pref("services.sync.sendVersionInfo", true);
+
+pref("services.sync.scheduler.idleInterval", 3600);  // 1 hour
+pref("services.sync.scheduler.activeInterval", 600);   // 10 minutes
+pref("services.sync.scheduler.immediateInterval", 90);    // 1.5 minutes
+pref("services.sync.scheduler.idleTime", 300);   // 5 minutes
+
+pref("services.sync.scheduler.fxa.singleDeviceInterval", 3600); // 1 hour
+
+// Note that new engines are typically added with a default of disabled, so
+// when an existing sync user gets the Firefox upgrade that supports the engine
+// it starts as disabled until the user has explicitly opted in.
+// The sync "create account" process typically *will* offer these engines, so
+// they may be flipped to enabled at that time.
+pref("services.sync.engine.addons", true);
+pref("services.sync.engine.addresses", false);
+pref("services.sync.engine.bookmarks", true);
+#ifdef EARLY_BETA_OR_EARLIER
+// Enable the new bookmark sync engine through early Beta, but not release
+// candidates or Release.
+pref("services.sync.engine.bookmarks.buffer", true);
+#else
+pref("services.sync.engine.bookmarks.buffer", false);
+#endif
+pref("services.sync.engine.creditcards", false);
+pref("services.sync.engine.history", true);
+pref("services.sync.engine.passwords", true);
+pref("services.sync.engine.prefs", true);
+pref("services.sync.engine.tabs", true);
+pref("services.sync.engine.tabs.filteredUrls", "^(about:.*|resource:.*|chrome:.*|wyciwyg:.*|file:.*|blob:.*|moz-extension:.*)$");
+
+// The addresses and CC engines might not actually be available at all.
+pref("services.sync.engine.addresses.available", false);
+pref("services.sync.engine.creditcards.available", false);
+
+// If true, add-on sync ignores changes to the user-enabled flag. This
+// allows people to have the same set of add-ons installed across all
+// profiles while maintaining different enabled states.
+pref("services.sync.addons.ignoreUserEnabledChanges", false);
+
+// Comma-delimited list of hostnames to trust for add-on install.
+pref("services.sync.addons.trustedSourceHostnames", "addons.mozilla.org");
+
+pref("services.sync.log.appender.console", "Fatal");
+pref("services.sync.log.appender.dump", "Error");
+pref("services.sync.log.appender.file.level", "Trace");
+pref("services.sync.log.appender.file.logOnError", true);
+#if defined(NIGHTLY_BUILD)
+pref("services.sync.log.appender.file.logOnSuccess", true);
+#else
+pref("services.sync.log.appender.file.logOnSuccess", false);
+#endif
+pref("services.sync.log.appender.file.maxErrorAge", 864000); // 10 days
+
+// The default log level for all "Sync.*" logs. Adjusting this pref will
+// adjust the level for *all* Sync logs (except engines, and that's only
+// because we supply a default for the engines below.)
+pref("services.sync.log.logger", "Debug");
+
+// Prefs for Sync engines can be controlled globally or per-engine.
+// We only define the global level here, but manually creating prefs
+// like "services.sync.log.logger.engine.bookmarks" will control just
+// that engine.
+pref("services.sync.log.logger.engine", "Debug");
+pref("services.sync.log.cryptoDebug", false);
+
+pref("services.sync.fxa.termsURL", "https://accounts.firefox.com/legal/terms");
+pref("services.sync.fxa.privacyURL", "https://accounts.firefox.com/legal/privacy");
+
+pref("services.sync.telemetry.submissionInterval", 43200); // 12 hours in seconds
+pref("services.sync.telemetry.maxPayloadCount", 500);
+
+#ifdef EARLY_BETA_OR_EARLIER
+// Enable the (fairly costly) client/server validation through early Beta, but
+// not release candidates or Release.
+pref("services.sync.engine.bookmarks.validation.enabled", true);
+pref("services.sync.engine.passwords.validation.enabled", true);
+#endif
+
+#if defined(NIGHTLY_BUILD)
+// Enable repair of bookmarks on Nightly only - requires validation also be
+// enabled.
+pref("services.sync.engine.bookmarks.repair.enabled", true);
+#endif
+
+// We consider validation this frequently. After considering validation, even
+// if we don't end up validating, we won't try again unless this much time has passed.
+pref("services.sync.engine.bookmarks.validation.interval", 86400); // 24 hours in seconds
+pref("services.sync.engine.passwords.validation.interval", 86400); // 24 hours in seconds
+
+// We only run validation `services.sync.validation.percentageChance` percent of
+// the time, even if it's been the right amount of time since the last validation,
+// and you meet the maxRecord checks.
+pref("services.sync.engine.bookmarks.validation.percentageChance", 10);
+pref("services.sync.engine.passwords.validation.percentageChance", 10);
+
+// We won't validate an engine if it has more than this many records on the server.
+pref("services.sync.engine.bookmarks.validation.maxRecords", 1000);
+pref("services.sync.engine.passwords.validation.maxRecords", 1000);
+
+// The maximum number of immediate resyncs to trigger for changes made during
+// a sync.
+pref("services.sync.maxResyncs", 5);
+#endif // MOZ_SERVICES_SYNC
--- a/modules/libpref/moz.build
+++ b/modules/libpref/moz.build
@@ -129,16 +129,19 @@ SPHINX_TREES['libpref'] = 'docs'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 DEFINES['OS_ARCH'] = CONFIG['OS_ARCH']
 DEFINES['MOZ_WIDGET_TOOLKIT'] = CONFIG['MOZ_WIDGET_TOOLKIT']
 
+if CONFIG['MOZ_SERVICES_SYNC']:
+  DEFINES['MOZ_SERVICES_SYNC'] = True
+
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
     if not CONFIG['MOZ_ANDROID_FAT_AAR_ARCHITECTURES']:
         FINAL_TARGET_PP_FILES[CONFIG['ANDROID_CPU_ARCH']] += [
             'greprefs.js',
         ]
     else:
         for arch in CONFIG['MOZ_ANDROID_FAT_AAR_ARCHITECTURES']:
             FINAL_TARGET_FILES[arch] += [
--- a/services/sync/modules/engines/addons.js
+++ b/services/sync/modules/engines/addons.js
@@ -27,17 +27,17 @@
  *
  *  - services.sync.addons.ignoreUserEnabledChanges
  *  - services.sync.addons.trustedSourceHostnames
  *
  *  and also influenced by whether addons have repository caching enabled and
  *  whether they allow installation of addons from insecure options (both of
  *  which are themselves influenced by the "extensions." pref branch)
  *
- * See the documentation in services-sync.js for the behavior of these prefs.
+ * See the documentation in all.js for the behavior of these prefs.
  */
 "use strict";
 
 const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 const { Preferences } = ChromeUtils.import(
   "resource://gre/modules/Preferences.jsm"
 );
 const { AddonUtils } = ChromeUtils.import(
--- a/services/sync/moz.build
+++ b/services/sync/moz.build
@@ -63,12 +63,8 @@ XPCOM_MANIFESTS += [
 ]
 
 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 += [
-    'services-sync.js',
-]
deleted file mode 100644
--- a/services/sync/services-sync.js
+++ /dev/null
@@ -1,110 +0,0 @@
-/* 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/. */
-
-/* global pref */
-
-pref("services.sync.lastversion", "firstrun");
-pref("services.sync.sendVersionInfo", true);
-
-pref("services.sync.scheduler.idleInterval", 3600);  // 1 hour
-pref("services.sync.scheduler.activeInterval", 600);   // 10 minutes
-pref("services.sync.scheduler.immediateInterval", 90);    // 1.5 minutes
-pref("services.sync.scheduler.idleTime", 300);   // 5 minutes
-
-pref("services.sync.scheduler.fxa.singleDeviceInterval", 3600); // 1 hour
-
-// Note that new engines are typically added with a default of disabled, so
-// when an existing sync user gets the Firefox upgrade that supports the engine
-// it starts as disabled until the user has explicitly opted in.
-// The sync "create account" process typically *will* offer these engines, so
-// they may be flipped to enabled at that time.
-pref("services.sync.engine.addons", true);
-pref("services.sync.engine.addresses", false);
-pref("services.sync.engine.bookmarks", true);
-#ifdef EARLY_BETA_OR_EARLIER
-// Enable the new bookmark sync engine through early Beta, but not release
-// candidates or Release.
-pref("services.sync.engine.bookmarks.buffer", true);
-#else
-pref("services.sync.engine.bookmarks.buffer", false);
-#endif
-pref("services.sync.engine.creditcards", false);
-pref("services.sync.engine.history", true);
-pref("services.sync.engine.passwords", true);
-pref("services.sync.engine.prefs", true);
-pref("services.sync.engine.tabs", true);
-pref("services.sync.engine.tabs.filteredUrls", "^(about:.*|resource:.*|chrome:.*|wyciwyg:.*|file:.*|blob:.*|moz-extension:.*)$");
-
-// The addresses and CC engines might not actually be available at all.
-pref("services.sync.engine.addresses.available", false);
-pref("services.sync.engine.creditcards.available", false);
-
-// If true, add-on sync ignores changes to the user-enabled flag. This
-// allows people to have the same set of add-ons installed across all
-// profiles while maintaining different enabled states.
-pref("services.sync.addons.ignoreUserEnabledChanges", false);
-
-// Comma-delimited list of hostnames to trust for add-on install.
-pref("services.sync.addons.trustedSourceHostnames", "addons.mozilla.org");
-
-pref("services.sync.log.appender.console", "Fatal");
-pref("services.sync.log.appender.dump", "Error");
-pref("services.sync.log.appender.file.level", "Trace");
-pref("services.sync.log.appender.file.logOnError", true);
-#if defined(NIGHTLY_BUILD)
-pref("services.sync.log.appender.file.logOnSuccess", true);
-#else
-pref("services.sync.log.appender.file.logOnSuccess", false);
-#endif
-pref("services.sync.log.appender.file.maxErrorAge", 864000); // 10 days
-
-// The default log level for all "Sync.*" logs. Adjusting this pref will
-// adjust the level for *all* Sync logs (except engines, and that's only
-// because we supply a default for the engines below.)
-pref("services.sync.log.logger", "Debug");
-
-// Prefs for Sync engines can be controlled globally or per-engine.
-// We only define the global level here, but manually creating prefs
-// like "services.sync.log.logger.engine.bookmarks" will control just
-// that engine.
-pref("services.sync.log.logger.engine", "Debug");
-pref("services.sync.log.cryptoDebug", false);
-
-pref("services.sync.fxa.termsURL", "https://accounts.firefox.com/legal/terms");
-pref("services.sync.fxa.privacyURL", "https://accounts.firefox.com/legal/privacy");
-
-pref("services.sync.telemetry.submissionInterval", 43200); // 12 hours in seconds
-pref("services.sync.telemetry.maxPayloadCount", 500);
-
-#ifdef EARLY_BETA_OR_EARLIER
-// Enable the (fairly costly) client/server validation through early Beta, but
-// not release candidates or Release.
-pref("services.sync.engine.bookmarks.validation.enabled", true);
-pref("services.sync.engine.passwords.validation.enabled", true);
-#endif
-
-#if defined(NIGHTLY_BUILD)
-// Enable repair of bookmarks on Nightly only - requires validation also be
-// enabled.
-pref("services.sync.engine.bookmarks.repair.enabled", true);
-#endif
-
-// We consider validation this frequently. After considering validation, even
-// if we don't end up validating, we won't try again unless this much time has passed.
-pref("services.sync.engine.bookmarks.validation.interval", 86400); // 24 hours in seconds
-pref("services.sync.engine.passwords.validation.interval", 86400); // 24 hours in seconds
-
-// We only run validation `services.sync.validation.percentageChance` percent of
-// the time, even if it's been the right amount of time since the last validation,
-// and you meet the maxRecord checks.
-pref("services.sync.engine.bookmarks.validation.percentageChance", 10);
-pref("services.sync.engine.passwords.validation.percentageChance", 10);
-
-// We won't validate an engine if it has more than this many records on the server.
-pref("services.sync.engine.bookmarks.validation.maxRecords", 1000);
-pref("services.sync.engine.passwords.validation.maxRecords", 1000);
-
-// The maximum number of immediate resyncs to trigger for changes made during
-// a sync.
-pref("services.sync.maxResyncs", 5);