зеркало из https://github.com/mozilla/gecko-dev.git
merge fx-team to mozilla-central a=merge
This commit is contained in:
Коммит
76a8b3a7df
|
@ -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";
|
||||
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче