mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1222042 - Dont try to show ping data in about:telemetry if Telemetry is disabled. r=dexter
This commit is contained in:
parent
682aeba654
commit
cbbf351e3c
@ -232,7 +232,7 @@ this.TelemetryController = Object.freeze({
|
||||
* Get the current session ping data as it would be sent out or stored.
|
||||
*
|
||||
* @param {bool} aSubsession Whether to get subsession data. Optional, defaults to false.
|
||||
* @return {object} The current ping data in object form.
|
||||
* @return {object} The current ping data if Telemetry is enabled, null otherwise.
|
||||
*/
|
||||
getCurrentPingData: function(aSubsession = false) {
|
||||
return Impl.getCurrentPingData(aSubsession);
|
||||
@ -956,6 +956,11 @@ var Impl = {
|
||||
getCurrentPingData: function(aSubsession) {
|
||||
this._log.trace("getCurrentPingData - subsession: " + aSubsession)
|
||||
|
||||
// Telemetry is disabled, don't gather any data.
|
||||
if (!Telemetry.canRecordBase) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const reason = aSubsession ? REASON_GATHER_SUBSESSION_PAYLOAD : REASON_GATHER_PAYLOAD;
|
||||
const type = PING_TYPE_MAIN;
|
||||
const payload = TelemetrySession.getPayload(reason);
|
||||
|
@ -328,6 +328,9 @@ var PingPicker = {
|
||||
_updateCurrentPingData: function() {
|
||||
const subsession = document.getElementById("show-subsession-data").checked;
|
||||
const ping = TelemetryController.getCurrentPingData(subsession);
|
||||
if (!ping) {
|
||||
return;
|
||||
}
|
||||
displayPingData(ping, true);
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user