summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-12-05 11:37:04 +0000
committerMoonchild <moonchild@palemoon.org>2022-04-07 23:35:02 +0200
commitd3cc8bc1ae4e0815273c56f3858d979def03abd1 (patch)
treea94925a2abd719971f96a738c1c3413197d5a4ee /toolkit
parent02afcba61492797f77d54bde3c919e59b2772036 (diff)
downloaduxp-d3cc8bc1ae4e0815273c56f3858d979def03abd1.tar.gz
Issue #21 - Remove calls to Services.telemetry and nsITelemetry
These calls would cause breakage without the supporting plumbing.
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/content/browser-content.js21
-rw-r--r--toolkit/modules/NewTabUtils.jsm43
-rw-r--r--toolkit/modules/Services.jsm1
3 files changed, 0 insertions, 65 deletions
diff --git a/toolkit/content/browser-content.js b/toolkit/content/browser-content.js
index d6185c5dd2..954848cb80 100644
--- a/toolkit/content/browser-content.js
+++ b/toolkit/content/browser-content.js
@@ -213,7 +213,6 @@ var ClickEventHandler = {
}
const kAutoscroll = 15; // defined in mozilla/layers/ScrollInputMethods.h
- Services.telemetry.getHistogramById("SCROLL_INPUT_METHODS").add(kAutoscroll);
this._scrollable.scrollBy({
left: actualScrollX,
@@ -681,23 +680,8 @@ var Printing = {
let print = contentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebBrowserPrint);
- if (print.doingPrintPreview) {
- this.logKeyedTelemetry("PRINT_DIALOG_OPENED_COUNT", "FROM_PREVIEW");
- } else {
- this.logKeyedTelemetry("PRINT_DIALOG_OPENED_COUNT", "FROM_PAGE");
- }
-
print.print(printSettings, null);
- if (print.doingPrintPreview) {
- if (simplifiedMode) {
- this.logKeyedTelemetry("PRINT_COUNT", "SIMPLIFIED");
- } else {
- this.logKeyedTelemetry("PRINT_COUNT", "WITH_PREVIEW");
- }
- } else {
- this.logKeyedTelemetry("PRINT_COUNT", "WITHOUT_PREVIEW");
- }
} catch (e) {
// Pressing cancel is expressed as an NS_ERROR_ABORT return value,
// causing an exception to be thrown which we catch here.
@@ -722,11 +706,6 @@ var Printing = {
}
},
- logKeyedTelemetry(id, key) {
- let histogram = Services.telemetry.getKeyedHistogramById(id);
- histogram.add(key);
- },
-
updatePageCount() {
let numPages = docShell.printPreview.printPreviewNumPages;
sendAsyncMessage("Printing:Preview:UpdatePageCount", {
diff --git a/toolkit/modules/NewTabUtils.jsm b/toolkit/modules/NewTabUtils.jsm
index 500d08fa52..bf2fc78b72 100644
--- a/toolkit/modules/NewTabUtils.jsm
+++ b/toolkit/modules/NewTabUtils.jsm
@@ -49,9 +49,6 @@ const HISTORY_RESULTS_LIMIT = 100;
// The maximum number of links Links.getLinks will return.
const LINKS_GET_LINKS_LIMIT = 100;
-// The gather telemetry topic.
-const TOPIC_GATHER_TELEMETRY = "gather-telemetry";
-
/**
* Calculate the MD5 hash for a string.
* @param aValue
@@ -1249,45 +1246,6 @@ var Links = {
Links.compareLinks = Links.compareLinks.bind(Links);
/**
- * Singleton used to collect telemetry data.
- *
- */
-var Telemetry = {
- /**
- * Initializes object.
- */
- init: function Telemetry_init() {
- Services.obs.addObserver(this, TOPIC_GATHER_TELEMETRY, false);
- },
-
- /**
- * Collects data.
- */
- _collect: function Telemetry_collect() {
- let probes = [
- { histogram: "NEWTAB_PAGE_ENABLED",
- value: AllPages.enabled },
- { histogram: "NEWTAB_PAGE_PINNED_SITES_COUNT",
- value: PinnedLinks.links.length },
- { histogram: "NEWTAB_PAGE_BLOCKED_SITES_COUNT",
- value: Object.keys(BlockedLinks.links).length }
- ];
-
- probes.forEach(function Telemetry_collect_forEach(aProbe) {
- Services.telemetry.getHistogramById(aProbe.histogram)
- .add(aProbe.value);
- });
- },
-
- /**
- * Listens for gather telemetry topic.
- */
- observe: function Telemetry_observe(aSubject, aTopic, aData) {
- this._collect();
- }
-};
-
-/**
* Singleton that checks if a given link should be displayed on about:newtab
* or if we should rather not do it for security reasons. URIs that inherit
* their caller's principal will be filtered.
@@ -1387,7 +1345,6 @@ this.NewTabUtils = {
if (!this._initialized) {
this._initialized = true;
ExpirationFilter.init();
- Telemetry.init();
return true;
}
return false;
diff --git a/toolkit/modules/Services.jsm b/toolkit/modules/Services.jsm
index 09e5df077c..2cb47be3a6 100644
--- a/toolkit/modules/Services.jsm
+++ b/toolkit/modules/Services.jsm
@@ -76,7 +76,6 @@ var initTable = [
["storage", "@mozilla.org/storage/service;1", "mozIStorageService"],
["domStorageManager", "@mozilla.org/dom/localStorage-manager;1", "nsIDOMStorageManager"],
["strings", "@mozilla.org/intl/stringbundle;1", "nsIStringBundleService"],
- ["telemetry", "@mozilla.org/base/telemetry;1", "nsITelemetry"],
["tm", "@mozilla.org/thread-manager;1", "nsIThreadManager"],
["urlFormatter", "@mozilla.org/toolkit/URLFormatterService;1", "nsIURLFormatter"],
["vc", "@mozilla.org/xpcom/version-comparator;1", "nsIVersionComparator"],