Bug 1356673 - Fix a crash in RunPingSender at shutdown. r?gfritzsche
This patch makes sure to wait on the pingsender process to spawn
before shutting down Firefox.
MozReview-Commit-ID: CYYcGAy5H2s
--- a/toolkit/components/telemetry/TelemetrySend.jsm
+++ b/toolkit/components/telemetry/TelemetrySend.jsm
@@ -800,20 +800,18 @@ var TelemetrySendImpl = {
// Send the ping using the PingSender, if requested and the user was
// notified of our policy. We don't support the pingsender on Android,
// so ignore this option on that platform (see bug 1335917).
if (options.usePingSender &&
TelemetryReportingPolicy.canUpload() &&
AppConstants.platform != "android") {
const url = this._buildSubmissionURL(ping);
- // Serialize the ping to the disk and spawn the PingSender.
- let savePromise = savePing(ping);
- savePromise.then(() => this._sendWithPingSender(ping.id, url));
- return savePromise;
+ // Serialize the ping to the disk and then spawn the PingSender.
+ return savePing(ping).then(() => this._sendWithPingSender(ping.id, url));
}
if (!this.canSendNow) {
// Sending is disabled or throttled, add this to the persisted pending pings.
this._log.trace("submitPing - can't send ping now, persisting to disk - " +
"canSendNow: " + this.canSendNow);
return savePing(ping);
}