[Basilisk] Issue MoonchildProductions/GRE#3029 - Remove telemetry from FE

This commit is contained in:
Moonchild 2021-11-01 00:24:15 +00:00 committed by roytam1
commit 653cba3202
49 changed files with 17 additions and 1661 deletions

View file

@ -167,7 +167,6 @@ PluginContent.prototype = {
return;
}
this._finishRecordingFlashPluginTelemetry();
this.clearPluginCaches();
this.haveShownNotification = false;
},
@ -533,19 +532,11 @@ PluginContent.prototype = {
case "PluginInstantiated":
let key = this._getPluginInfo(plugin).pluginTag.niceName;
Services.telemetry.getKeyedHistogramById('PLUGIN_ACTIVATION_COUNT').add(key);
shouldShowNotification = true;
let pluginRect = plugin.getBoundingClientRect();
if (pluginRect.width <= 5 && pluginRect.height <= 5) {
Services.telemetry.getHistogramById('PLUGIN_TINY_CONTENT').add(1);
}
break;
}
if (this._getPluginInfo(plugin).mimetype === FLASH_MIME_TYPE) {
this._recordFlashPluginTelemetry(eventType, plugin);
}
// Show the in-content UI if it's not too big. The crashed plugin handler already did this.
let overlay = this.getPluginUI(plugin, "main");
if (eventType != "PluginCrashed") {
@ -577,48 +568,6 @@ PluginContent.prototype = {
}
},
_recordFlashPluginTelemetry: function (eventType, plugin) {
if (!Services.telemetry.canRecordExtended) {
return;
}
if (!this.flashPluginStats) {
this.flashPluginStats = {
instancesCount: 0,
plugins: new WeakSet()
};
}
if (!this.flashPluginStats.plugins.has(plugin)) {
// Reporting plugin instance and its dimensions only once.
this.flashPluginStats.plugins.add(plugin);
this.flashPluginStats.instancesCount++;
let pluginRect = plugin.getBoundingClientRect();
Services.telemetry.getHistogramById('FLASH_PLUGIN_WIDTH')
.add(pluginRect.width);
Services.telemetry.getHistogramById('FLASH_PLUGIN_HEIGHT')
.add(pluginRect.height);
Services.telemetry.getHistogramById('FLASH_PLUGIN_AREA')
.add(pluginRect.width * pluginRect.height);
let state = this._getPluginInfo(plugin).fallbackType;
if (state === null) {
state = Ci.nsIObjectLoadingContent.PLUGIN_UNSUPPORTED;
}
Services.telemetry.getHistogramById('FLASH_PLUGIN_STATES')
.add(state);
}
},
_finishRecordingFlashPluginTelemetry: function () {
if (this.flashPluginStats) {
Services.telemetry.getHistogramById('FLASH_PLUGIN_INSTANCES_ON_PAGE')
.add(this.flashPluginStats.instancesCount);
delete this.flashPluginStats;
}
},
isKnownPlugin: function (objLoadingContent) {
return (objLoadingContent.getContentTypeForMIMEType(objLoadingContent.actualType) ==