From 986c82f230acd6be6c8c178cd710eb5144f21a69 Mon Sep 17 00:00:00 2001 From: Mark Hammond Date: Thu, 29 Jan 2015 10:41:00 +1100 Subject: [PATCH 1/4] Bug 1124956 - Fix Sync engine selection after migration to FxA. r=adw --- .../content/aboutaccounts/aboutaccounts.js | 2 +- services/sync/modules/FxaMigrator.jsm | 46 ++++++++++++------- services/sync/modules/browserid_identity.js | 2 +- services/sync/modules/policies.js | 6 ++- services/sync/modules/service.js | 3 ++ 5 files changed, 39 insertions(+), 20 deletions(-) diff --git a/browser/base/content/aboutaccounts/aboutaccounts.js b/browser/base/content/aboutaccounts/aboutaccounts.js index c98c0ae941a..e009af9fe4c 100644 --- a/browser/base/content/aboutaccounts/aboutaccounts.js +++ b/browser/base/content/aboutaccounts/aboutaccounts.js @@ -16,7 +16,7 @@ Cu.import("resource://gre/modules/FxAccountsCommon.js", fxAccountsCommon); Cu.import("resource://services-sync/util.js"); const PREF_LAST_FXA_USER = "identity.fxaccounts.lastSignedInUserHash"; -const PREF_SYNC_SHOW_CUSTOMIZATION = "services.sync.ui.showCustomizationDialog"; +const PREF_SYNC_SHOW_CUSTOMIZATION = "services.sync-setup.ui.showCustomizationDialog"; const ACTION_URL_PARAM = "action"; diff --git a/services/sync/modules/FxaMigrator.jsm b/services/sync/modules/FxaMigrator.jsm index 1027b15afb2..737ff36ab2d 100644 --- a/services/sync/modules/FxaMigrator.jsm +++ b/services/sync/modules/FxaMigrator.jsm @@ -210,27 +210,39 @@ Migrator.prototype = { // Must be ready to perform the actual migration. this.log.info("Performing final sync migration steps"); - // Do the actual migration. + // Do the actual migration. We setup one observer for when the new identity + // is about to be initialized so we can reset some key preferences - but + // there's no promise associated with this. + let observeStartOverIdentity; + Services.obs.addObserver(observeStartOverIdentity = () => { + this.log.info("observed that startOver is about to re-initialize the identity"); + Services.obs.removeObserver(observeStartOverIdentity, "weave:service:start-over:init-identity"); + // We've now reset all sync prefs - set the engine related prefs back to + // what they were. + for (let [prefName, prefType, prefVal] of enginePrefs) { + this.log.debug("Restoring pref ${prefName} (type=${prefType}) to ${prefVal}", + {prefName, prefType, prefVal}); + switch (prefType) { + case Services.prefs.PREF_BOOL: + Services.prefs.setBoolPref(prefName, prefVal); + break; + case Services.prefs.PREF_STRING: + Services.prefs.setCharPref(prefName, prefVal); + break; + default: + // _getEngineEnabledPrefs doesn't return any other type... + Cu.reportError("unknown engine pref type for " + prefName + ": " + prefType); + } + } + }, "weave:service:start-over:init-identity", false); + + // And another observer for the startOver being fully complete - the only + // reason for this is so we can wait until everything is fully reset. let startOverComplete = new Promise((resolve, reject) => { let observe; Services.obs.addObserver(observe = () => { this.log.info("observed that startOver is complete"); Services.obs.removeObserver(observe, "weave:service:start-over:finish"); - // We've now reset all sync prefs - set the engine related prefs back to - // what they were. - for (let [prefName, prefType, prefVal] of enginePrefs) { - switch (prefType) { - case Services.prefs.PREF_BOOL: - Services.prefs.setBoolPref(prefName, prefVal); - break; - case Services.prefs.PREF_STRING: - Services.prefs.setCharPref(prefName, prefVal); - break; - default: - // _getEngineEnabledPrefs doesn't return any other type... - Cu.reportError("unknown engine pref type for " + prefName + ": " + prefType); - } - } resolve(); }, "weave:service:start-over:finish", false); }); @@ -240,6 +252,8 @@ Migrator.prototype = { yield startOverComplete; // observer fired, now kick things off with the FxA user. this.log.info("scheduling initial FxA sync."); + // Note we technically don't need to unblockSync as by now all sync prefs + // have been reset - but it doesn't hurt. this._unblockSync(); Weave.Service.scheduler.scheduleNextSync(0); diff --git a/services/sync/modules/browserid_identity.js b/services/sync/modules/browserid_identity.js index ef8d737d22c..f466c386e90 100644 --- a/services/sync/modules/browserid_identity.js +++ b/services/sync/modules/browserid_identity.js @@ -47,7 +47,7 @@ const OBSERVER_TOPICS = [ fxAccountsCommon.ONLOGOUT_NOTIFICATION, ]; -const PREF_SYNC_SHOW_CUSTOMIZATION = "services.sync.ui.showCustomizationDialog"; +const PREF_SYNC_SHOW_CUSTOMIZATION = "services.sync-setup.ui.showCustomizationDialog"; function deriveKeyBundle(kB) { let out = CryptoUtils.hkdf(kB, undefined, diff --git a/services/sync/modules/policies.js b/services/sync/modules/policies.js index 80992e7eb1f..4451ca79d98 100644 --- a/services/sync/modules/policies.js +++ b/services/sync/modules/policies.js @@ -592,8 +592,10 @@ ErrorHandler.prototype = { fapp.level = Log.Level[Svc.Prefs.get("log.appender.file.level")]; root.addAppender(fapp); - // Arrange for the FxA, Hawk and TokenServer logs to also go to our appenders. - for (let extra of ["FirefoxAccounts", "Hawk", "Common.TokenServerClient"]) { + // Arrange for a number of other sync-related logs to also go to our + // appenders. + for (let extra of ["FirefoxAccounts", "Hawk", "Common.TokenServerClient", + "Sync.SyncMigration"]) { let log = Log.repository.getLogger(extra); for (let appender of [fapp, dapp, capp]) { log.addAppender(appender); diff --git a/services/sync/modules/service.js b/services/sync/modules/service.js index 88b68505f7d..22cd713148d 100644 --- a/services/sync/modules/service.js +++ b/services/sync/modules/service.js @@ -926,6 +926,9 @@ Sync11Service.prototype = { this.identity.finalize().then( () => { + // an observer so the FxA migration code can take some action before + // the new identity is created. + Svc.Obs.notify("weave:service:start-over:init-identity"); this.identity.username = ""; this.status.__authManager = null; this.identity = Status._authManager; From 260af914154e2b03c4aa7f52af2b0cec3ddca844 Mon Sep 17 00:00:00 2001 From: Mike Conley Date: Wed, 28 Jan 2015 14:15:40 -0500 Subject: [PATCH 2/4] Bug 1126311 - Don't show OMTC warning when opening windows on Linux if e10s enabled by default. r=felipe. --HG-- extra : amend_source : 333c7b92790cd6060eafbd7dfd36ce47b61da636 --- browser/base/content/browser.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 3820b92df61..ea0efd13e74 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -3872,7 +3872,10 @@ function OpenBrowserWindow(options) } if (options && options.remote) { - let omtcEnabled = gPrefService.getBoolPref("layers.offmainthreadcomposition.enabled"); + // If we're using remote tabs by default, then OMTC will be force-enabled, + // despite the preference returning as false. + let omtcEnabled = gPrefService.getBoolPref("layers.offmainthreadcomposition.enabled") + || Services.appinfo.browserTabsRemoteAutostart; if (!omtcEnabled) { alert("To use out-of-process tabs, you must set the layers.offmainthreadcomposition.enabled preference and restart. Opening a normal window instead."); } else { From 6fcc716dc85d58d8da0efc4be4aaa6ed5cba60e3 Mon Sep 17 00:00:00 2001 From: Matthew Noorenberghe Date: Wed, 28 Jan 2015 17:28:29 -0800 Subject: [PATCH 3/4] Bug 1125764 - Allow tour pages to hide UITour annotations and menus when losing visibility. r=Unfocused These allow list entries should be removed when bug 1123010 is fixed. --HG-- extra : rebase_source : 0e55b0ae7c140fa38f4089148a7a532171f4cf84 --- browser/components/uitour/UITour.jsm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/browser/components/uitour/UITour.jsm b/browser/components/uitour/UITour.jsm index 5a141533405..00caf149129 100644 --- a/browser/components/uitour/UITour.jsm +++ b/browser/components/uitour/UITour.jsm @@ -33,8 +33,12 @@ const PREF_LOG_LEVEL = "browser.uitour.loglevel"; const PREF_SEENPAGEIDS = "browser.uitour.seenPageIDs"; const BACKGROUND_PAGE_ACTIONS_ALLOWED = new Set([ + "endUrlbarCapture", "getConfiguration", "getTreatmentTag", + "hideHighlight", + "hideInfo", + "hideMenu", "ping", "registerPageID", "setConfiguration", From f7d7c7805df9dc476193e5233b94927f8a43f3cc Mon Sep 17 00:00:00 2001 From: Curtis Koenig Date: Thu, 29 Jan 2015 08:46:48 +0100 Subject: [PATCH 4/4] Bug 1126253 - Removed redundant NewTabUtils.jsm import. r=dao --- browser/base/content/browser-thumbnails.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/browser/base/content/browser-thumbnails.js b/browser/base/content/browser-thumbnails.js index e09086a9ba2..aad33dccc6e 100644 --- a/browser/base/content/browser-thumbnails.js +++ b/browser/base/content/browser-thumbnails.js @@ -4,8 +4,6 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #endif -Cu.import("resource://gre/modules/NewTabUtils.jsm"); - /** * Keeps thumbnails of open web pages up-to-date. */