Bug 1388145 - Make Master Password telemetry only run once per session (and not per window), and run it after an idle period. r=MattN

MozReview-Commit-ID: 1Ecy94TGGar

--HG--
extra : rebase_source : 40596aaaf9f01fe6a565d5ebf1357951c928a863
This commit is contained in:
Felipe Gomes 2017-08-09 15:43:10 -03:00
Родитель fadfebac0a
Коммит 635177b023
2 изменённых файлов: 12 добавлений и 15 удалений

Просмотреть файл

@ -1747,21 +1747,6 @@ var gBrowserInit = {
SidebarUI.startDelayedLoad();
SocialUI.init();
// Telemetry for master-password - we do this after 5 seconds as it
// can cause IO if NSS/PSM has not already initialized.
setTimeout(() => {
if (window.closed) {
return;
}
let tokenDB = Cc["@mozilla.org/security/pk11tokendb;1"]
.getService(Ci.nsIPK11TokenDB);
let token = tokenDB.getInternalKeyToken();
let mpEnabled = token.hasPassword;
if (mpEnabled) {
Services.telemetry.getHistogramById("MASTER_PASSWORD_ENABLED").add(mpEnabled);
}
}, 5000);
PanicButtonNotifier.init();
});

Просмотреть файл

@ -1161,6 +1161,18 @@ BrowserGlue.prototype = {
Services.tm.idleDispatchToMainThread(() => {
this._sendMediaTelemetry();
});
Services.tm.idleDispatchToMainThread(() => {
// Telemetry for master-password - we do this after a delay as it
// can cause IO if NSS/PSM has not already initialized.
let tokenDB = Cc["@mozilla.org/security/pk11tokendb;1"]
.getService(Ci.nsIPK11TokenDB);
let token = tokenDB.getInternalKeyToken();
let mpEnabled = token.hasPassword;
if (mpEnabled) {
Services.telemetry.getHistogramById("MASTER_PASSWORD_ENABLED").add(mpEnabled);
}
});
},
_createExtraDefaultProfile() {