Bug 1462725 - Uninit study on Firefox shutdown; r=rhelmer

Intended to undo study-related changes that don't need to persist between sessions: clear prefs, remove observers, etc.

MozReview-Commit-ID: GsoDhxf6CVJ

--HG--
extra : rebase_source : 5679a48de8e7e95c2b02619738582948032b2c19
This commit is contained in:
Bianca Danforth 2018-06-04 16:20:54 -07:00
parent 8b9593b0d5
commit 30a653a6d1
2 changed files with 6 additions and 4 deletions

View File

@ -1115,6 +1115,8 @@ BrowserGlue.prototype = {
}
Normandy.uninit();
SavantShieldStudy.uninit();
},
// All initial windows have opened.

View File

@ -37,6 +37,9 @@ class SavantShieldStudyClass {
this.endStudy("ineligible");
return;
}
// TODO check expiration, add study duration override pref
// check the pref in case Normandy flipped it on before we could add the pref listener
this.shouldCollect = Services.prefs.getBoolPref(this.STUDY_PREF);
if (this.shouldCollect) {
@ -70,10 +73,7 @@ class SavantShieldStudyClass {
// Called on every Firefox shutdown and endStudy
uninit() {
// TODO: Make sure uninit() is called on every Firefox shutdown (look inside
// nsBrowserGlue.js to see where Normandy uninits)
// TODO: See what happens during Normandy's uninit method to ensure nothing
// is forgotten.
// TODO: clear study expiration override pref and remove its listener
Services.prefs.removeObserver(this.STUDY_PREF, this);
Services.prefs.clearUserPref(this.STUDY_PREF);
Services.prefs.clearUserPref(PREF_LOG_LEVEL);