зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1455464 - Use Normandy's cleanup manager for Preference Rollouts r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D81617
This commit is contained in:
Родитель
c6f4a0a285
Коммит
eb934eeccf
|
@ -169,7 +169,6 @@ var Normandy = {
|
|||
// topic must have already been removed or never added
|
||||
}
|
||||
}
|
||||
await PreferenceRollouts.uninit();
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -248,7 +248,7 @@ var PreferenceExperiments = {
|
|||
* default preference branch.
|
||||
*/
|
||||
async init() {
|
||||
CleanupManager.addCleanupHandler(this.saveStartupPrefs.bind(this));
|
||||
CleanupManager.addCleanupHandler(() => this.saveStartupPrefs());
|
||||
|
||||
for (const experiment of await this.getAllActive()) {
|
||||
// Check that the current value of the preference is still what we set it to
|
||||
|
|
|
@ -22,6 +22,11 @@ ChromeUtils.defineModuleGetter(
|
|||
"TelemetryEnvironment",
|
||||
"resource://gre/modules/TelemetryEnvironment.jsm"
|
||||
);
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this,
|
||||
"CleanupManager",
|
||||
"resource://normandy/lib/CleanupManager.jsm"
|
||||
);
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this,
|
||||
"PrefUtils",
|
||||
|
@ -170,6 +175,8 @@ var PreferenceRollouts = {
|
|||
},
|
||||
|
||||
async init() {
|
||||
CleanupManager.addCleanupHandler(() => this.saveStartupPrefs());
|
||||
|
||||
for (const rollout of await this.getAllActive()) {
|
||||
TelemetryEnvironment.setExperimentActive(rollout.slug, rollout.state, {
|
||||
type: "normandy-prefrollout",
|
||||
|
@ -179,10 +186,6 @@ var PreferenceRollouts = {
|
|||
}
|
||||
},
|
||||
|
||||
async uninit() {
|
||||
await this.saveStartupPrefs();
|
||||
},
|
||||
|
||||
/** When Telemetry is disabled, clear all identifiers from the stored rollouts. */
|
||||
async onTelemetryDisabled() {
|
||||
const rollouts = await this.getAll();
|
||||
|
|
Загрузка…
Ссылка в новой задаче