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
4526eb0ffe
commit
6e37b85f37
@ -232,7 +232,7 @@ this.TelemetryController = Object.freeze({
|
|||||||
* Get the current session ping data as it would be sent out or stored.
|
* 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.
|
* @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) {
|
getCurrentPingData: function(aSubsession = false) {
|
||||||
return Impl.getCurrentPingData(aSubsession);
|
return Impl.getCurrentPingData(aSubsession);
|
||||||
@ -956,6 +956,11 @@ var Impl = {
|
|||||||
getCurrentPingData: function(aSubsession) {
|
getCurrentPingData: function(aSubsession) {
|
||||||
this._log.trace("getCurrentPingData - subsession: " + 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 reason = aSubsession ? REASON_GATHER_SUBSESSION_PAYLOAD : REASON_GATHER_PAYLOAD;
|
||||||
const type = PING_TYPE_MAIN;
|
const type = PING_TYPE_MAIN;
|
||||||
const payload = TelemetrySession.getPayload(reason);
|
const payload = TelemetrySession.getPayload(reason);
|
||||||
|
@ -328,6 +328,9 @@ var PingPicker = {
|
|||||||
_updateCurrentPingData: function() {
|
_updateCurrentPingData: function() {
|
||||||
const subsession = document.getElementById("show-subsession-data").checked;
|
const subsession = document.getElementById("show-subsession-data").checked;
|
||||||
const ping = TelemetryController.getCurrentPingData(subsession);
|
const ping = TelemetryController.getCurrentPingData(subsession);
|
||||||
|
if (!ping) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
displayPingData(ping, true);
|
displayPingData(ping, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user