Bug 717069 - correct sessionstore-windows-restored usage in TelemetryPing; r=taras

This commit is contained in:
Nathan Froyd 2012-03-06 14:54:02 -05:00
parent d00573b977
commit bd96ca9e74
2 changed files with 9 additions and 2 deletions

View File

@ -634,7 +634,11 @@ TelemetryPing.prototype = {
*/
uninstall: function uninstall() {
this.detachObservers()
Services.obs.removeObserver(this, "sessionstore-windows-restored");
try {
Services.obs.removeObserver(this, "sessionstore-windows-restored");
} catch (e) {
// Already observed this event.
}
Services.obs.removeObserver(this, "profile-before-change");
Services.obs.removeObserver(this, "private-browsing");
Services.obs.removeObserver(this, "quit-application-granted");
@ -674,6 +678,9 @@ TelemetryPing.prototype = {
}
break;
case "sessionstore-windows-restored":
Services.obs.removeObserver(this, "sessionstore-windows-restored");
// fall through
case "test-gather-startup":
this.gatherStartupInformation();
break;
case "idle-daily":

View File

@ -29,7 +29,7 @@ var gFinished = false;
function telemetry_ping () {
const TelemetryPing = Cc["@mozilla.org/base/telemetry-ping;1"].getService(Ci.nsIObserver);
TelemetryPing.observe(null, "sessionstore-windows-restored", null);
TelemetryPing.observe(null, "test-gather-startup", null);
TelemetryPing.observe(null, "test-ping", SERVER);
}