diff --git a/application/basilisk/app/nsBrowserApp.cpp b/application/basilisk/app/nsBrowserApp.cpp
index 9cd409cc66..74575031fd 100644
--- a/application/basilisk/app/nsBrowserApp.cpp
+++ b/application/basilisk/app/nsBrowserApp.cpp
@@ -37,7 +37,6 @@
#include "nsXPCOMPrivate.h" // for MAXPATHLEN and XPCOM_DLL
#include "mozilla/Sprintf.h"
-#include "mozilla/Telemetry.h"
#include "mozilla/WindowsDllBlocklist.h"
#if !defined(MOZ_WIDGET_COCOA) && !defined(MOZ_WIDGET_ANDROID)
@@ -115,7 +114,6 @@ static bool IsArg(const char* arg, const char* s)
XRE_GetFileFromPathType XRE_GetFileFromPath;
XRE_CreateAppDataType XRE_CreateAppData;
XRE_FreeAppDataType XRE_FreeAppData;
-XRE_TelemetryAccumulateType XRE_TelemetryAccumulate;
XRE_StartupTimelineRecordType XRE_StartupTimelineRecord;
XRE_mainType XRE_main;
XRE_StopLateWriteChecksType XRE_StopLateWriteChecks;
@@ -133,7 +131,6 @@ static const nsDynamicFunctionLoad kXULFuncs[] = {
{ "XRE_GetFileFromPath", (NSFuncPtr*) &XRE_GetFileFromPath },
{ "XRE_CreateAppData", (NSFuncPtr*) &XRE_CreateAppData },
{ "XRE_FreeAppData", (NSFuncPtr*) &XRE_FreeAppData },
- { "XRE_TelemetryAccumulate", (NSFuncPtr*) &XRE_TelemetryAccumulate },
{ "XRE_StartupTimelineRecord", (NSFuncPtr*) &XRE_StartupTimelineRecord },
{ "XRE_main", (NSFuncPtr*) &XRE_main },
{ "XRE_StopLateWriteChecks", (NSFuncPtr*) &XRE_StopLateWriteChecks },
@@ -375,8 +372,6 @@ int main(int argc, char* argv[], char* envp[])
return 255;
}
- XRE_StartupTimelineRecord(mozilla::StartupTimeline::START, start);
-
#ifdef MOZ_BROWSER_CAN_BE_CONTENTPROC
XRE_EnableSameExecutableForContentProc();
#endif
diff --git a/application/basilisk/app/profile/basilisk.js b/application/basilisk/app/profile/basilisk.js
index 198d9d41c4..e332e1c624 100644
--- a/application/basilisk/app/profile/basilisk.js
+++ b/application/basilisk/app/profile/basilisk.js
@@ -1205,14 +1205,10 @@ pref("media.gmp-widevinecdm.visible", true);
pref("media.gmp-widevinecdm.enabled", true);
#endif
-// Play with different values of the decay time and get telemetry,
+// Play with different values of the decay time,
// 0 means to randomize (and persist) the experiment value in users' profiles,
// -1 means no experiment is run and we use the preferred value for frecency (6h)
-pref("browser.cache.frecency_experiment", 0);
-
-// Telemetry settings.
-// Determines if Telemetry pings can be archived locally.
-pref("toolkit.telemetry.archive.enabled", true);
+pref("browser.cache.frecency_experiment", -1);
// Enable GMP support in the addon manager.
pref("media.gmp-provider.enabled", true);
diff --git a/application/basilisk/base/content/aboutNetError.xhtml b/application/basilisk/base/content/aboutNetError.xhtml
index 5ff79ea128..77aca22d11 100644
--- a/application/basilisk/base/content/aboutNetError.xhtml
+++ b/application/basilisk/base/content/aboutNetError.xhtml
@@ -123,12 +123,6 @@
document.getElementById("advancedButton")
.addEventListener("click", function togglePanelVisibility() {
toggleDisplay(panel);
-
- if (panel.style.display == "block") {
- // send event to trigger telemetry ping
- var event = new CustomEvent("AboutNetErrorUIExpanded", {bubbles:true});
- document.dispatchEvent(event);
- }
});
if (allowOverride) {
diff --git a/application/basilisk/base/content/abouthealthreport/abouthealth.js b/application/basilisk/base/content/abouthealthreport/abouthealth.js
index 66cbe16f5e..b8ae2b1e1a 100644
--- a/application/basilisk/base/content/abouthealthreport/abouthealth.js
+++ b/application/basilisk/base/content/abouthealthreport/abouthealth.js
@@ -11,7 +11,6 @@ Cu.import("resource://gre/modules/Services.jsm");
const prefs = new Preferences("datareporting.healthreport.");
-const PREF_UNIFIED = "toolkit.telemetry.unified";
const PREF_REPORTING_URL = "datareporting.healthreport.about.reportUrl";
var healthReportWrapper = {
@@ -48,49 +47,10 @@ var healthReportWrapper = {
}
},
- sendTelemetryPingList: function () {
- console.log("AboutHealthReport: Collecting Telemetry ping list.");
- MozSelfSupport.getTelemetryPingList().then((list) => {
- console.log("AboutHealthReport: Sending Telemetry ping list.");
- this.injectData("telemetry-ping-list", list);
- }).catch((ex) => {
- console.log("AboutHealthReport: Collecting ping list failed: " + ex);
- });
- },
-
- sendTelemetryPingData: function (pingId) {
- console.log("AboutHealthReport: Collecting Telemetry ping data.");
- MozSelfSupport.getTelemetryPing(pingId).then((ping) => {
- console.log("AboutHealthReport: Sending Telemetry ping data.");
- this.injectData("telemetry-ping-data", {
- id: pingId,
- pingData: ping,
- });
- }).catch((ex) => {
- console.log("AboutHealthReport: Loading ping data failed: " + ex);
- this.injectData("telemetry-ping-data", {
- id: pingId,
- error: "error-generic",
- });
- });
- },
-
sendCurrentEnvironment: function () {
- console.log("AboutHealthReport: Sending Telemetry environment data.");
- MozSelfSupport.getCurrentTelemetryEnvironment().then((environment) => {
- this.injectData("telemetry-current-environment-data", environment);
- }).catch((ex) => {
- console.log("AboutHealthReport: Collecting current environment data failed: " + ex);
- });
},
sendCurrentPingData: function () {
- console.log("AboutHealthReport: Sending current Telemetry ping data.");
- MozSelfSupport.getCurrentTelemetrySubsessionPing().then((ping) => {
- this.injectData("telemetry-current-ping-data", ping);
- }).catch((ex) => {
- console.log("AboutHealthReport: Collecting current ping data failed: " + ex);
- });
},
injectData: function (type, content) {
@@ -129,12 +89,6 @@ var healthReportWrapper = {
case "RequestCurrentPrefs":
this.updatePrefState();
break;
- case "RequestTelemetryPingList":
- this.sendTelemetryPingList();
- break;
- case "RequestTelemetryPingData":
- this.sendTelemetryPingData(evt.detail.id);
- break;
case "RequestCurrentEnvironment":
this.sendCurrentEnvironment();
break;
diff --git a/application/basilisk/base/content/baseMenuOverlay.xul b/application/basilisk/base/content/baseMenuOverlay.xul
index dce35e92d0..14d4398cf2 100644
--- a/application/basilisk/base/content/baseMenuOverlay.xul
+++ b/application/basilisk/base/content/baseMenuOverlay.xul
@@ -57,13 +57,6 @@
onclick="checkForMiddleClick(this, event);"
label="&helpKeyboardShortcuts.label;"
accesskey="&helpKeyboardShortcuts.accesskey;"/>
-#ifdef MOZ_TELEMETRY_REPORTING
-
-#endif
{
if (topic == "Migration:ItemError") {
sawErrors = true;
} else if (topic == "Migration:Ended") {
- histogram.add(25);
- if (sawErrors) {
- histogram.add(26);
- }
Services.obs.removeObserver(migrationObserver, "Migration:Ended");
Services.obs.removeObserver(migrationObserver, "Migration:ItemError");
Services.prefs.setCharPref(kAutoMigrateBrowserPref, pickedKey);
@@ -132,7 +122,6 @@ const AutoMigrate = {
Services.obs.addObserver(migrationObserver, "Migration:Ended", false);
Services.obs.addObserver(migrationObserver, "Migration:ItemError", false);
migrator.migrate(this.resourceTypesToUse, profileStartup, profileToMigrate);
- histogram.add(20);
},
/**
@@ -209,50 +198,35 @@ const AutoMigrate = {
undo: Task.async(function* () {
let browserId = Preferences.get(kAutoMigrateBrowserPref, "unknown");
- let histogram = Services.telemetry.getHistogramById("FX_STARTUP_MIGRATION_AUTOMATED_IMPORT_UNDO");
- histogram.add(0);
if (!(yield this.canUndo())) {
- histogram.add(5);
throw new Error("Can't undo!");
}
this._pendingUndoTasks = true;
this._removeNotificationBars();
- histogram.add(10);
let readPromise = OS.File.read(kUndoStateFullPath, {
encoding: "utf-8",
compression: "lz4",
});
let stateData = this._dejsonifyUndoState(yield readPromise);
- histogram.add(12);
this._errorMap = {bookmarks: 0, visits: 0, logins: 0};
- let reportErrorTelemetry = (type) => {
- let histogramId = `FX_STARTUP_MIGRATION_UNDO_${type.toUpperCase()}_ERRORCOUNT`;
- Services.telemetry.getKeyedHistogramById(histogramId).add(browserId, this._errorMap[type]);
- };
yield this._removeUnchangedBookmarks(stateData.get("bookmarks")).catch(ex => {
Cu.reportError("Uncaught exception when removing unchanged bookmarks!");
Cu.reportError(ex);
});
- reportErrorTelemetry("bookmarks");
- histogram.add(15);
yield this._removeSomeVisits(stateData.get("visits")).catch(ex => {
Cu.reportError("Uncaught exception when removing history visits!");
Cu.reportError(ex);
});
- reportErrorTelemetry("visits");
- histogram.add(20);
yield this._removeUnchangedLogins(stateData.get("logins")).catch(ex => {
Cu.reportError("Uncaught exception when removing unchanged logins!");
Cu.reportError(ex);
});
- reportErrorTelemetry("logins");
- histogram.add(25);
// This is async, but no need to wait for it.
NewTabUtils.links.populateCache(() => {
@@ -260,7 +234,6 @@ const AutoMigrate = {
}, true);
this._purgeUndoState(this.UNDO_REMOVED_REASON_UNDO_USED);
- histogram.add(30);
}),
_removeNotificationBars() {
@@ -288,10 +261,6 @@ const AutoMigrate = {
let migrationBrowser = Preferences.get(kAutoMigrateBrowserPref, "unknown");
Services.prefs.clearUserPref(kAutoMigrateBrowserPref);
-
- let histogram =
- Services.telemetry.getKeyedHistogramById("FX_STARTUP_MIGRATION_UNDO_REASON");
- histogram.add(migrationBrowser, reason);
},
getBrowserUsedForMigration() {
@@ -367,7 +336,6 @@ const AutoMigrate = {
message, kNotificationId, null, notificationBox.PRIORITY_INFO_HIGH, buttons
);
let remainingDays = Preferences.get(kAutoMigrateDaysToOfferUndoPref, 0);
- Services.telemetry.getHistogramById("FX_STARTUP_MIGRATION_UNDO_OFFERED").add(4 - remainingDays);
}),
shouldStillShowUndoPrompt() {
diff --git a/application/basilisk/components/migration/FirefoxProfileMigrator.js b/application/basilisk/components/migration/FirefoxProfileMigrator.js
index 2714cdbcd5..b53f7b5163 100644
--- a/application/basilisk/components/migration/FirefoxProfileMigrator.js
+++ b/application/basilisk/components/migration/FirefoxProfileMigrator.js
@@ -1,6 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
- * vim: sw=2 ts=2 sts=2 et */
- /* This Source Code Form is subject to the terms of the Mozilla Public
+ * This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -170,77 +169,8 @@ FirefoxProfileMigrator.prototype._getResourcesInternal = function(sourceProfileD
};
}
- // Telemetry related migrations.
- let times = {
- name: "times", // name is used only by tests.
- type: types.OTHERDATA,
- migrate: aCallback => {
- let file = this._getFileObject(sourceProfileDir, "times.json");
- if (file) {
- file.copyTo(currentProfileDir, "");
- }
- // And record the fact a migration (ie, a reset) happened.
- let timesAccessor = new ProfileAge(currentProfileDir.path);
- timesAccessor.recordProfileReset().then(
- () => aCallback(true),
- () => aCallback(false)
- );
- }
- };
- let telemetry = {
- name: "telemetry", // name is used only by tests...
- type: types.OTHERDATA,
- migrate: aCallback => {
- let createSubDir = (name) => {
- let dir = currentProfileDir.clone();
- dir.append(name);
- dir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
- return dir;
- };
-
- // If the 'datareporting' directory exists we migrate files from it.
- let haveStateFile = false;
- let dataReportingDir = this._getFileObject(sourceProfileDir, "datareporting");
- if (dataReportingDir && dataReportingDir.isDirectory()) {
- // Copy only specific files.
- let toCopy = ["state.json", "session-state.json"];
-
- let dest = createSubDir("datareporting");
- let enumerator = dataReportingDir.directoryEntries;
- while (enumerator.hasMoreElements()) {
- let file = enumerator.getNext().QueryInterface(Ci.nsIFile);
- if (file.isDirectory() || toCopy.indexOf(file.leafName) == -1) {
- continue;
- }
-
- if (file.leafName == "state.json") {
- haveStateFile = true;
- }
- file.copyTo(dest, "");
- }
- }
-
- if (!haveStateFile) {
- // Fall back to migrating the state file that contains the client id from healthreport/.
- // We first moved the client id management from the FHR implementation to the datareporting
- // service.
- // Consequently, we try to migrate an existing FHR state file here as a fallback.
- let healthReportDir = this._getFileObject(sourceProfileDir, "healthreport");
- if (healthReportDir && healthReportDir.isDirectory()) {
- let stateFile = this._getFileObject(healthReportDir, "state.json");
- if (stateFile) {
- let dest = createSubDir("healthreport");
- stateFile.copyTo(dest, "");
- }
- }
- }
-
- aCallback(true);
- }
- };
-
return [places, cookies, passwords, formData, dictionary, bookmarksBackups,
- session, times, telemetry].filter(r => r);
+ session].filter(r => r);
};
Object.defineProperty(FirefoxProfileMigrator.prototype, "startupOnlyMigrator", {
diff --git a/application/basilisk/components/migration/MigrationUtils.jsm b/application/basilisk/components/migration/MigrationUtils.jsm
index 9425cce2a5..2bb7787731 100644
--- a/application/basilisk/components/migration/MigrationUtils.jsm
+++ b/application/basilisk/components/migration/MigrationUtils.jsm
@@ -265,27 +265,6 @@ this.MigratorPrototype = {
let maybeFinishResponsivenessMonitor = (responsivenessMonitor, histogramId) => {
if (responsivenessMonitor) {
let accumulatedDelay = responsivenessMonitor.finish();
- if (histogramId) {
- try {
- Services.telemetry.getKeyedHistogramById(histogramId)
- .add(browserKey, accumulatedDelay);
- } catch (ex) {
- Cu.reportError(histogramId + ": " + ex);
- }
- }
- }
- };
-
- let collectQuantityTelemetry = () => {
- for (let resourceType of Object.keys(MigrationUtils._importQuantities)) {
- let histogramId =
- "FX_MIGRATION_" + resourceType.toUpperCase() + "_QUANTITY";
- try {
- Services.telemetry.getKeyedHistogramById(histogramId)
- .add(browserKey, MigrationUtils._importQuantities[resourceType]);
- } catch (ex) {
- Cu.reportError(histogramId + ": " + ex);
- }
}
};
@@ -331,7 +310,6 @@ this.MigratorPrototype = {
maybeFinishResponsivenessMonitor(responsivenessMonitor, responsivenessHistogramId);
if (resourcesGroupedByItems.size == 0) {
- collectQuantityTelemetry();
notify("Migration:Ended");
}
}
@@ -803,7 +781,6 @@ this.MigrationUtils = Object.freeze({
* - {String} an identifier for the profile to use when migrating
* NB: If you add new consumers, please add a migration entry point
* constant below, and specify at least the first element of the array
- * (the migration entry point for purposes of telemetry).
*/
showMigrationWizard:
function MU_showMigrationWizard(aOpener, aParams) {
@@ -1096,7 +1073,4 @@ this.MigrationUtils = Object.freeze({
"safari": 8,
"360se": 9,
},
- getSourceIdForTelemetry(sourceName) {
- return this._sourceNameToIdMapping[sourceName] || 0;
- },
});
diff --git a/application/basilisk/components/migration/content/migration.js b/application/basilisk/components/migration/content/migration.js
index eb21756280..8ca60a3b91 100644
--- a/application/basilisk/components/migration/content/migration.js
+++ b/application/basilisk/components/migration/content/migration.js
@@ -35,7 +35,6 @@ var MigrationWizard = { /* exported MigrationWizard */
let args = window.arguments;
let entryPointId = args[0] || MigrationUtils.MIGRATION_ENTRYPOINT_UNKNOWN;
- Services.telemetry.getHistogramById("FX_MIGRATION_ENTRY_POINT").add(entryPointId);
this.isInitialMigration = entryPointId == MigrationUtils.MIGRATION_ENTRYPOINT_FIRSTRUN;
if (args.length > 1) {
@@ -105,15 +104,6 @@ var MigrationWizard = { /* exported MigrationWizard */
}
}
}
- if (this.isInitialMigration) {
- Services.telemetry.getHistogramById("FX_STARTUP_MIGRATION_BROWSER_COUNT")
- .add(this._availableMigrators.length);
- let defaultBrowser = MigrationUtils.getMigratorKeyForDefaultBrowser();
- // This will record 0 for unknown default browser IDs.
- defaultBrowser = MigrationUtils.getSourceIdForTelemetry(defaultBrowser);
- Services.telemetry.getHistogramById("FX_STARTUP_MIGRATION_EXISTING_DEFAULT_BROWSER")
- .add(defaultBrowser);
- }
group.addEventListener("command", toggleCloseBrowserWarning);
@@ -142,11 +132,6 @@ var MigrationWizard = { /* exported MigrationWizard */
var newSource = document.getElementById("importSourceGroup").selectedItem.id;
if (newSource == "nothing") {
- // Need to do telemetry here because we're closing the dialog before we get to
- // do actual migration. For actual migration, this doesn't happen until after
- // migration takes place.
- Services.telemetry.getHistogramById("FX_MIGRATION_SOURCE_BROWSER")
- .add(MigrationUtils.getSourceIdForTelemetry("nothing"));
document.documentElement.cancel();
return false;
}
@@ -366,21 +351,6 @@ var MigrationWizard = { /* exported MigrationWizard */
onMigratingMigrate: function ()
{
this._migrator.migrate(this._itemsFlags, this._autoMigrate, this._selectedProfile);
-
- Services.telemetry.getHistogramById("FX_MIGRATION_SOURCE_BROWSER")
- .add(MigrationUtils.getSourceIdForTelemetry(this._source));
- if (!this._autoMigrate) {
- let hist = Services.telemetry.getKeyedHistogramById("FX_MIGRATION_USAGE");
- let exp = 0;
- let items = this._itemsFlags;
- while (items) {
- if (items & 1) {
- hist.add(this._source, exp);
- }
- items = items >> 1;
- exp++;
- }
- }
},
_listItems: function (aID)
@@ -426,18 +396,8 @@ var MigrationWizard = { /* exported MigrationWizard */
label.removeAttribute("style");
break;
case "Migration:Ended":
- if (this.isInitialMigration) {
- // Ensure errors in reporting data recency do not affect the rest of the migration.
- try {
- this.reportDataRecencyTelemetry();
- } catch (ex) {
- Cu.reportError(ex);
- }
- }
if (this._autoMigrate) {
let hasImportedHomepage = !!(this._newHomePage && this._newHomePage != "DEFAULT");
- Services.telemetry.getKeyedHistogramById("FX_MIGRATION_IMPORTED_HOMEPAGE")
- .add(this._source, hasImportedHomepage);
if (this._newHomePage) {
try {
// set homepage properly
@@ -508,8 +468,6 @@ var MigrationWizard = { /* exported MigrationWizard */
Cc["@mozilla.org/consoleservice;1"]
.getService(Ci.nsIConsoleService)
.logStringMessage("some " + type + " did not successfully migrate.");
- Services.telemetry.getKeyedHistogramById("FX_MIGRATION_ERRORS")
- .add(this._source, Math.log2(numericType));
break;
}
},
@@ -521,29 +479,4 @@ var MigrationWizard = { /* exported MigrationWizard */
this._listItems("doneItems");
},
- reportDataRecencyTelemetry() {
- let histogram = Services.telemetry.getKeyedHistogramById("FX_STARTUP_MIGRATION_DATA_RECENCY");
- let lastUsedPromises = [];
- for (let [key, migrator] of this._availableMigrators) {
- // No block-scoped let in for...of loop conditions, so get the source:
- let localKey = key;
- lastUsedPromises.push(migrator.getLastUsedDate().then(date => {
- const ONE_YEAR = 24 * 365;
- let diffInHours = Math.round((Date.now() - date) / (60 * 60 * 1000));
- if (diffInHours > ONE_YEAR) {
- diffInHours = ONE_YEAR;
- }
- histogram.add(localKey, diffInHours);
- return [localKey, diffInHours];
- }));
- }
- Promise.all(lastUsedPromises).then(migratorUsedTimeDiff => {
- // Sort low to high.
- migratorUsedTimeDiff.sort(([keyA, diffA], [keyB, diffB]) => diffA - diffB); /* eslint no-unused-vars: off */
- let usedMostRecentBrowser = migratorUsedTimeDiff.length && this._source == migratorUsedTimeDiff[0][0];
- let usedRecentBrowser =
- Services.telemetry.getKeyedHistogramById("FX_STARTUP_MIGRATION_USED_RECENT_BROWSER");
- usedRecentBrowser.add(this._source, usedMostRecentBrowser);
- });
- },
};
diff --git a/application/basilisk/components/nsBrowserContentHandler.js b/application/basilisk/components/nsBrowserContentHandler.js
index 841d7a481c..97c9c28bca 100644
--- a/application/basilisk/components/nsBrowserContentHandler.js
+++ b/application/basilisk/components/nsBrowserContentHandler.js
@@ -236,9 +236,6 @@ function openPreferences() {
}
function logSystemBasedSearch(engine) {
- var countId = (engine.identifier || ("other-" + engine.name)) + ".system";
- var count = Services.telemetry.getKeyedHistogramById("SEARCH_COUNTS");
- count.add(countId);
}
function doSearch(searchTerm, cmdLine) {
@@ -688,18 +685,6 @@ nsDefaultCommandLineHandler.prototype = {
/* nsICommandLineHandler */
handle : function(cmdLine) {
- // The -url flag is inserted by the operating system when the default
- // application handler is used. We check for default browser to remove
- // instances where users explicitly decide to "open with" the browser.
- // Note that users who launch firefox manually with the -url flag will
- // get erroneously counted.
- try {
- if (cmdLine.findFlag("url", false) &&
- ShellService.isDefaultBrowser(false, false)) {
- Services.telemetry.getHistogramById("FX_STARTUP_EXTERNAL_CONTENT_HANDLER").add();
- }
- } catch (e) {}
-
var urilist = [];
if (AppConstants.platform == "win") {
diff --git a/application/basilisk/components/nsBrowserGlue.js b/application/basilisk/components/nsBrowserGlue.js
index 7446d1110a..2b2daeb002 100644
--- a/application/basilisk/components/nsBrowserGlue.js
+++ b/application/basilisk/components/nsBrowserGlue.js
@@ -27,7 +27,6 @@ XPCOMUtils.defineLazyServiceGetter(this, "AlertsService", "@mozilla.org/alerts-s
["AutoCompletePopup", "resource://gre/modules/AutoCompletePopup.jsm"],
["BookmarkHTMLUtils", "resource://gre/modules/BookmarkHTMLUtils.jsm"],
["BookmarkJSONUtils", "resource://gre/modules/BookmarkJSONUtils.jsm"],
- ["BrowserUsageTelemetry", "resource:///modules/BrowserUsageTelemetry.jsm"],
["ContentClick", "resource:///modules/ContentClick.jsm"],
["ContentPrefServiceParent", "resource://gre/modules/ContentPrefServiceParent.jsm"],
["ContentSearch", "resource:///modules/ContentSearch.jsm"],
@@ -308,8 +307,6 @@ BrowserGlue.prototype = {
} catch (ex) {
Cu.reportError(ex);
}
- let win = RecentWindow.getMostRecentBrowserWindow();
- win.BrowserSearch.recordSearchInTelemetry(engine, "urlbar");
break;
case "browser-search-engine-modified":
// Ensure we cleanup the hiddenOneOffs pref when removing
@@ -340,7 +337,6 @@ BrowserGlue.prototype = {
});
break;
case "autocomplete-did-enter-text":
- this._handleURLBarTelemetry(subject.QueryInterface(Ci.nsIAutoCompleteInput));
break;
case "test-initialize-sanitizer":
this._sanitizer.onStartup();
@@ -351,64 +347,6 @@ BrowserGlue.prototype = {
}
},
- _handleURLBarTelemetry(input) {
- if (!input ||
- input.id != "urlbar" ||
- input.inPrivateContext ||
- input.popup.selectedIndex < 0) {
- return;
- }
- let controller =
- input.popup.view.QueryInterface(Ci.nsIAutoCompleteController);
- let idx = input.popup.selectedIndex;
- let value = controller.getValueAt(idx);
- let action = input._parseActionUrl(value);
- let actionType;
- if (action) {
- actionType =
- action.type == "searchengine" && action.params.searchSuggestion ?
- "searchsuggestion" :
- action.type;
- }
- if (!actionType) {
- let styles = new Set(controller.getStyleAt(idx).split(/\s+/));
- let style = ["autofill", "tag", "bookmark"].find(s => styles.has(s));
- actionType = style || "history";
- }
-
- Services.telemetry
- .getHistogramById("FX_URLBAR_SELECTED_RESULT_INDEX")
- .add(idx);
-
- // Ideally this would be a keyed histogram and we'd just add(actionType),
- // but keyed histograms aren't currently shown on the telemetry dashboard
- // (bug 1151756).
- //
- // You can add values but don't change any of the existing values.
- // Otherwise you'll break our data.
- let buckets = {
- autofill: 0,
- bookmark: 1,
- history: 2,
- keyword: 3,
- searchengine: 4,
- searchsuggestion: 5,
- switchtab: 6,
- tag: 7,
- visiturl: 8,
- remotetab: 9,
- extension: 10,
- };
- if (actionType in buckets) {
- Services.telemetry
- .getHistogramById("FX_URLBAR_SELECTED_RESULT_TYPE")
- .add(buckets[actionType]);
- } else {
- Cu.reportError("Unknown FX_URLBAR_SELECTED_RESULT_TYPE type: " +
- actionType);
- }
- },
-
// initialization (called on application startup)
_init: function() {
let os = Services.obs;
@@ -436,9 +374,6 @@ BrowserGlue.prototype = {
os.addObserver(this, "distribution-customization-complete", false);
os.addObserver(this, "handle-xul-text-link", false);
os.addObserver(this, "profile-before-change", false);
- if (AppConstants.MOZ_TELEMETRY_REPORTING) {
- os.addObserver(this, "keyword-search", false);
- }
os.addObserver(this, "browser-search-engine-modified", false);
os.addObserver(this, "restart-in-safe-mode", false);
os.addObserver(this, "flash-plugin-hang", false);
@@ -490,9 +425,6 @@ BrowserGlue.prototype = {
os.removeObserver(this, "places-database-locked");
os.removeObserver(this, "handle-xul-text-link");
os.removeObserver(this, "profile-before-change");
- if (AppConstants.MOZ_TELEMETRY_REPORTING) {
- os.removeObserver(this, "keyword-search");
- }
os.removeObserver(this, "browser-search-engine-modified");
os.removeObserver(this, "flash-plugin-hang");
os.removeObserver(this, "xpi-signature-changed");
@@ -531,10 +463,6 @@ BrowserGlue.prototype = {
const STATE_USER_PICKED_IGNORE_FOREVER = 3;
const STATE_USER_CLOSED_NOTIFICATION = 4;
- let update = function(response) {
- Services.telemetry.getHistogramById("SLOW_ADDON_WARNING_STATES").add(response);
- }
-
let complete = false;
let start = Date.now();
let done = function(response) {
@@ -543,12 +471,8 @@ BrowserGlue.prototype = {
return;
}
complete = true;
- update(response);
- Services.telemetry.getHistogramById("SLOW_ADDON_WARNING_RESPONSE_TIME").add(Date.now() - start);
};
- update(STATE_WARNING_DISPLAYED);
-
if (notification) {
notification.label = message;
} else {
@@ -659,7 +583,6 @@ BrowserGlue.prototype = {
NewTabMessages.init();
SessionStore.init();
- BrowserUsageTelemetry.init();
ContentSearch.init();
FormValidationHandler.init();
@@ -874,27 +797,6 @@ BrowserGlue.prototype = {
nb.PRIORITY_WARNING_MEDIUM, buttons);
},
- _firstWindowTelemetry: function(aWindow) {
- let SCALING_PROBE_NAME = "";
- switch (AppConstants.platform) {
- case "win":
- SCALING_PROBE_NAME = "DISPLAY_SCALING_MSWIN";
- break;
- case "macosx":
- SCALING_PROBE_NAME = "DISPLAY_SCALING_OSX";
- break;
- case "linux":
- SCALING_PROBE_NAME = "DISPLAY_SCALING_LINUX";
- break;
- }
- if (SCALING_PROBE_NAME) {
- let scaling = aWindow.devicePixelRatio * 100;
- try {
- Services.telemetry.getHistogramById(SCALING_PROBE_NAME).add(scaling);
- } catch (ex) {}
- }
- },
-
// the first browser window has finished initializing
_onFirstWindowLoaded: function(aWindow) {
// Initialize PdfJs when running in-process and remote. This only
@@ -975,7 +877,6 @@ BrowserGlue.prototype = {
AutoCompletePopup.init();
DateTimePickerHelper.init();
- this._firstWindowTelemetry(aWindow);
this._firstWindowLoaded();
},
@@ -1002,7 +903,6 @@ BrowserGlue.prototype = {
delete this._bookmarksBackupIdleTime;
}
- BrowserUsageTelemetry.uninit();
UserAgentOverrides.uninit();
PageThumbs.uninit();
NewTabMessages.uninit();
@@ -1122,20 +1022,6 @@ BrowserGlue.prototype = {
Services.prefs.setIntPref("browser.shell.defaultBrowserCheckCount", promptCount);
}
- try {
- // Report default browser status on startup to telemetry
- // so we can track whether we are the default.
- Services.telemetry.getHistogramById("BROWSER_IS_USER_DEFAULT")
- .add(isDefault);
- Services.telemetry.getHistogramById("BROWSER_IS_USER_DEFAULT_ERROR")
- .add(isDefaultError);
- Services.telemetry.getHistogramById("BROWSER_SET_DEFAULT_ALWAYS_CHECK")
- .add(shouldCheck);
- Services.telemetry.getHistogramById("BROWSER_SET_DEFAULT_DIALOG_PROMPT_RAWCOUNT")
- .add(promptCount);
- }
- catch (ex) { /* Don't break the default prompt if telemetry is broken. */ }
-
if (willPrompt) {
Services.tm.mainThread.dispatch(function() {
DefaultBrowserCheck.prompt(RecentWindow.getMostRecentBrowserWindow());
@@ -1552,14 +1438,6 @@ BrowserGlue.prototype = {
// available backup compared to that session.
if (profileLastUse > lastBackupTime) {
let backupAge = Math.round((profileLastUse - lastBackupTime) / 86400000);
- // Report the age of the last available backup.
- try {
- Services.telemetry
- .getHistogramById("PLACES_BACKUPS_DAYSFROMLAST")
- .add(backupAge);
- } catch (ex) {
- Cu.reportError(new Error("Unable to report telemetry."));
- }
if (backupAge > BOOKMARKS_BACKUP_MAX_INTERVAL_DAYS)
this._bookmarksBackupIdleTime /= 2;
@@ -2408,24 +2286,12 @@ var DefaultBrowserCheck = {
if (isDefault || runTime > 600) {
this._setAsDefaultTimer.cancel();
this._setAsDefaultTimer = null;
- Services.telemetry.getHistogramById("BROWSER_SET_DEFAULT_TIME_TO_COMPLETION_SECONDS")
- .add(runTime);
}
- Services.telemetry.getHistogramById("BROWSER_IS_USER_DEFAULT_ERROR")
- .add(isDefaultError);
}, 1000, Ci.nsITimer.TYPE_REPEATING_SLACK);
} catch (ex) {
setAsDefaultError = true;
Cu.reportError(ex);
}
- // Here BROWSER_IS_USER_DEFAULT and BROWSER_SET_USER_DEFAULT_ERROR appear
- // to be inverse of each other, but that is only because this function is
- // called when the browser is set as the default. During startup we record
- // the BROWSER_IS_USER_DEFAULT value without recording BROWSER_SET_USER_DEFAULT_ERROR.
- Services.telemetry.getHistogramById("BROWSER_IS_USER_DEFAULT")
- .add(!setAsDefaultError);
- Services.telemetry.getHistogramById("BROWSER_SET_DEFAULT_ERROR")
- .add(setAsDefaultError);
},
_createPopup: function(win, notNowStrings, neverStrings) {
@@ -2537,12 +2403,6 @@ var DefaultBrowserCheck = {
} else if (!shouldAsk.value) {
ShellService.shouldCheckDefaultBrowser = false;
}
-
- try {
- let resultEnum = rv * 2 + shouldAsk.value;
- Services.telemetry.getHistogramById("BROWSER_SET_DEFAULT_RESULT")
- .add(resultEnum);
- } catch (ex) { /* Don't break if Telemetry is acting up. */ }
}
},
diff --git a/application/basilisk/components/places/content/browserPlacesViews.js b/application/basilisk/components/places/content/browserPlacesViews.js
index 2d1a9a23e3..f8a03c8a18 100644
--- a/application/basilisk/components/places/content/browserPlacesViews.js
+++ b/application/basilisk/components/places/content/browserPlacesViews.js
@@ -980,9 +980,6 @@ function PlacesToolbar(aPlace) {
}
PlacesViewBase.call(this, aPlace);
-
- Services.telemetry.getHistogramById("FX_BOOKMARKS_TOOLBAR_INIT_MS")
- .add(Date.now() - startTime);
}
PlacesToolbar.prototype = {
diff --git a/application/basilisk/components/places/content/places.js b/application/basilisk/components/places/content/places.js
index 30b4b7b462..b04aea3084 100644
--- a/application/basilisk/components/places/content/places.js
+++ b/application/basilisk/components/places/content/places.js
@@ -17,7 +17,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "DownloadUtils",
"resource://gre/modules/DownloadUtils.jsm");
const RESTORE_FILEPICKER_FILTER_EXT = "*.json;*.jsonlz4";
-const HISTORY_LIBRARY_SEARCH_TELEMETRY = "PLACES_HISTORY_LIBRARY_SEARCH_TIME_MS";
var PlacesOrganizer = {
_places: null,
@@ -360,7 +359,6 @@ var PlacesOrganizer = {
* cookies, history, preferences, and bookmarks.
*/
importFromBrowser: function() {
- // We pass in the type of source we're using for use in telemetry:
MigrationUtils.showMigrationWizard(window, [MigrationUtils.MIGRATION_ENTRYPOINT_PLACES]);
},
diff --git a/application/basilisk/components/preferences/in-content/advanced.js b/application/basilisk/components/preferences/in-content/advanced.js
index 5a94cb390c..176dbdd1d5 100644
--- a/application/basilisk/components/preferences/in-content/advanced.js
+++ b/application/basilisk/components/preferences/in-content/advanced.js
@@ -40,10 +40,6 @@ var gAdvancedPane = {
this.updateReadPrefs();
}
this.updateOfflineApps();
- this.initTelemetry();
- if (AppConstants.MOZ_TELEMETRY_REPORTING) {
- this.initSubmitHealthReport();
- }
this.updateOnScreenKeyboardVisibility();
this.updateCacheSizeInputField();
this.updateActualCacheSize();
@@ -53,10 +49,6 @@ var gAdvancedPane = {
gAdvancedPane.updateHardwareAcceleration);
setEventListener("advancedPrefs", "select",
gAdvancedPane.tabSelectionChanged);
- if (AppConstants.MOZ_TELEMETRY_REPORTING) {
- setEventListener("submitHealthReportBox", "command",
- gAdvancedPane.updateSubmitHealthReport);
- }
setEventListener("connectionSettings", "command",
gAdvancedPane.showConnections);
@@ -107,15 +99,6 @@ var gAdvancedPane = {
var advancedPrefs = document.getElementById("advancedPrefs");
var preference = document.getElementById("browser.preferences.advanced.selectedTabIndex");
- // tabSelectionChanged gets called twice due to the selectedIndex being set
- // by both the selectedItem and selectedPanel callstacks. This guard is used
- // to prevent double-counting in Telemetry.
- if (preference.valueFromPreferences != advancedPrefs.selectedIndex) {
- Services.telemetry
- .getHistogramById("FX_PREFERENCES_CATEGORY_OPENED")
- .add(telemetryBucketForCategory("advanced"));
- }
-
preference.valueFromPreferences = advancedPrefs.selectedIndex;
},
@@ -249,64 +232,16 @@ var gAdvancedPane = {
"crashReporterLearnMore");
},
- /**
- * The preference/checkbox is configured in XUL.
- *
- * In all cases, set up the Learn More link sanely.
- */
- initTelemetry: function ()
- {
- if (AppConstants.MOZ_TELEMETRY_REPORTING) {
- this._setupLearnMoreLink("toolkit.telemetry.infoURL", "telemetryLearnMore");
- }
- },
-
- /**
- * Set the status of the telemetry controls based on the input argument.
- * @param {Boolean} aEnabled False disables the controls, true enables them.
- */
- setTelemetrySectionEnabled: function (aEnabled)
- {
- if (AppConstants.MOZ_TELEMETRY_REPORTING) {
- // If FHR is disabled, additional data sharing should be disabled as well.
- let disabled = !aEnabled;
- document.getElementById("submitTelemetryBox").disabled = disabled;
- if (disabled) {
- // If we disable FHR, untick the telemetry checkbox.
- Services.prefs.setBoolPref("toolkit.telemetry.enabled", false);
- }
- document.getElementById("telemetryDataDesc").disabled = disabled;
- }
- },
-
/**
* Initialize the health report service reference and checkbox.
*/
initSubmitHealthReport: function () {
- if (AppConstants.MOZ_TELEMETRY_REPORTING) {
- this._setupLearnMoreLink("datareporting.healthreport.infoURL", "FHRLearnMore");
-
- let checkbox = document.getElementById("submitHealthReportBox");
-
- if (Services.prefs.prefIsLocked(PREF_UPLOAD_ENABLED)) {
- checkbox.setAttribute("disabled", "true");
- return;
- }
-
- checkbox.checked = Services.prefs.getBoolPref(PREF_UPLOAD_ENABLED);
- this.setTelemetrySectionEnabled(checkbox.checked);
- }
},
/**
* Update the health report preference with state from checkbox.
*/
updateSubmitHealthReport: function () {
- if (AppConstants.MOZ_TELEMETRY_REPORTING) {
- let checkbox = document.getElementById("submitHealthReportBox");
- Services.prefs.setBoolPref(PREF_UPLOAD_ENABLED, checkbox.checked);
- this.setTelemetrySectionEnabled(checkbox.checked);
- }
},
updateOnScreenKeyboardVisibility() {
diff --git a/application/basilisk/components/preferences/in-content/advanced.xul b/application/basilisk/components/preferences/in-content/advanced.xul
index d5498e783c..89572111db 100644
--- a/application/basilisk/components/preferences/in-content/advanced.xul
+++ b/application/basilisk/components/preferences/in-content/advanced.xul
@@ -47,12 +47,6 @@
name="layout.spellcheckDefault"
type="int"/>
-#ifdef MOZ_TELEMETRY_REPORTING
-
-#endif
-
-#ifdef MOZ_DATA_REPORTING
-
-
-#ifdef MOZ_TELEMETRY_REPORTING
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#endif
-
-#endif
diff --git a/application/basilisk/components/preferences/in-content/content.js b/application/basilisk/components/preferences/in-content/content.js
index 2eac10ca48..80f058aeb9 100644
--- a/application/basilisk/components/preferences/in-content/content.js
+++ b/application/basilisk/components/preferences/in-content/content.js
@@ -117,11 +117,6 @@ var gContentPane = {
gSubDialog.open("chrome://browser/content/preferences/permissions.xul",
"resizable=yes", params);
-
- try {
- Services.telemetry
- .getHistogramById("WEB_NOTIFICATION_EXCEPTIONS_OPENED").add();
- } catch (e) {}
},
diff --git a/application/basilisk/components/preferences/in-content/preferences.js b/application/basilisk/components/preferences/in-content/preferences.js
index 69cb180d56..f6a6941ceb 100644
--- a/application/basilisk/components/preferences/in-content/preferences.js
+++ b/application/basilisk/components/preferences/in-content/preferences.js
@@ -124,36 +124,6 @@ function init_dynamic_padding() {
document.documentElement.appendChild(mediaStyle);
}
-function telemetryBucketForCategory(category) {
- switch (category) {
- case "general":
- case "search":
- case "content":
- case "applications":
- case "privacy":
- case "security":
- case "sync":
- return category;
- case "advanced":
- let advancedPaneTabs = document.getElementById("advancedPrefs");
- switch (advancedPaneTabs.selectedTab.id) {
- case "generalTab":
- return "advancedGeneral";
- case "dataChoicesTab":
- return "advancedDataChoices";
- case "networkTab":
- return "advancedNetwork";
- case "updateTab":
- return "advancedUpdates";
- case "encryptionTab":
- return "advancedCerts";
- }
- // fall-through for unknown.
- default:
- return "unknown";
- }
-}
-
function onHashChange() {
gotoPref();
}
@@ -194,10 +164,6 @@ function gotoPref(aCategory) {
search(category, "data-category");
let mainContent = document.querySelector(".main-content");
mainContent.scrollTop = 0;
-
- Services.telemetry
- .getHistogramById("FX_PREFERENCES_CATEGORY_OPENED")
- .add(telemetryBucketForCategory(friendlyName));
}
function search(aQuery, aAttribute) {
diff --git a/application/basilisk/components/search/content/searchReset.js b/application/basilisk/components/search/content/searchReset.js
index b541d41da8..d0e6cfd9d8 100644
--- a/application/basilisk/components/search/content/searchReset.js
+++ b/application/basilisk/components/search/content/searchReset.js
@@ -8,14 +8,6 @@ var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/Services.jsm");
-const TELEMETRY_RESULT_ENUM = {
- RESTORED_DEFAULT: 0,
- KEPT_CURRENT: 1,
- CHANGED_ENGINE: 2,
- CLOSED_PAGE: 3,
- OPENED_SETTINGS: 4
-};
-
window.onload = function() {
let defaultEngine = document.getElementById("defaultEngine");
let originalDefault = Services.search.originalDefaultEngine;
@@ -24,7 +16,6 @@ window.onload = function() {
'url("' + originalDefault.iconURI.spec + '")';
document.getElementById("searchResetChangeEngine").focus();
- window.addEventListener("unload", recordPageClosed);
document.getElementById("linkSettingsPage")
.addEventListener("click", openingSettings);
};
@@ -46,8 +37,6 @@ function doSearch() {
let engine = Services.search.currentEngine;
let submission = engine.getSubmission(queryString, null, purpose);
- window.removeEventListener("unload", recordPageClosed);
-
let win = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
@@ -58,19 +47,12 @@ function doSearch() {
}
function openingSettings() {
- record(TELEMETRY_RESULT_ENUM.OPENED_SETTINGS);
- window.removeEventListener("unload", recordPageClosed);
-}
-
-function record(result) {
- Services.telemetry.getHistogramById("SEARCH_RESET_RESULT").add(result);
}
function keepCurrentEngine() {
// Calling the currentEngine setter will force a correct loadPathHash to be
// written for this engine, so that we don't prompt the user again.
Services.search.currentEngine = Services.search.currentEngine;
- record(TELEMETRY_RESULT_ENUM.KEPT_CURRENT);
doSearch();
}
@@ -80,11 +62,6 @@ function changeSearchEngine() {
engine.hidden = false;
Services.search.currentEngine = engine;
- record(TELEMETRY_RESULT_ENUM.RESTORED_DEFAULT);
-
doSearch();
}
-function recordPageClosed() {
- record(TELEMETRY_RESULT_ENUM.CLOSED_PAGE);
-}
diff --git a/application/basilisk/components/search/service/nsSearchService.js b/application/basilisk/components/search/service/nsSearchService.js
index 3cd2531006..403d06c44a 100644
--- a/application/basilisk/components/search/service/nsSearchService.js
+++ b/application/basilisk/components/search/service/nsSearchService.js
@@ -2313,8 +2313,6 @@ SearchService.prototype = {
this._initObservers.resolve(this._initRV);
Services.obs.notifyObservers(null, SEARCH_SERVICE_TOPIC, "init-complete");
- Services.telemetry.getHistogramById("SEARCH_SERVICE_INIT_SYNC").add(true);
- this._recordEngineTelemetry();
LOG("_syncInit end");
},
@@ -2352,8 +2350,6 @@ SearchService.prototype = {
this._cacheFileJSON = null;
this._initObservers.resolve(this._initRV);
Services.obs.notifyObservers(null, SEARCH_SERVICE_TOPIC, "init-complete");
- Services.telemetry.getHistogramById("SEARCH_SERVICE_INIT_SYNC").add(false);
- this._recordEngineTelemetry();
LOG("_asyncInit: Completed _asyncInit");
}),
@@ -2719,7 +2715,6 @@ SearchService.prototype = {
// Typically we'll re-init as a result of a pref observer,
// so signal to 'callers' that we're done.
Services.obs.notifyObservers(null, SEARCH_SERVICE_TOPIC, "init-complete");
- this._recordEngineTelemetry();
gInitialized = true;
} catch (err) {
LOG("Reinit failed: " + err);
@@ -3896,25 +3891,6 @@ SearchService.prototype = {
return result;
},
- _recordEngineTelemetry: function() {
- Services.telemetry.getHistogramById("SEARCH_SERVICE_ENGINE_COUNT")
- .add(Object.keys(this._engines).length);
- let hasUpdates = false;
- let hasIconUpdates = false;
- for (let name in this._engines) {
- let engine = this._engines[name];
- if (engine._hasUpdates) {
- hasUpdates = true;
- if (engine._iconUpdateURL) {
- hasIconUpdates = true;
- break;
- }
- }
- }
- Services.telemetry.getHistogramById("SEARCH_SERVICE_HAS_UPDATES").add(hasUpdates);
- Services.telemetry.getHistogramById("SEARCH_SERVICE_HAS_ICON_UPDATES").add(hasIconUpdates);
- },
-
/**
* This map is built lazily after the available search engines change. It
* allows quick parsing of an URL representing a search submission into the
diff --git a/application/basilisk/components/selfsupport/SelfSupportService.js b/application/basilisk/components/selfsupport/SelfSupportService.js
index 26148c6ffb..103b065e27 100644
--- a/application/basilisk/components/selfsupport/SelfSupportService.js
+++ b/application/basilisk/components/selfsupport/SelfSupportService.js
@@ -12,13 +12,6 @@ Cu.import("resource://gre/modules/Preferences.jsm");
const PREF_FHR_UPLOAD_ENABLED = "datareporting.healthreport.uploadEnabled";
-XPCOMUtils.defineLazyModuleGetter(this, "TelemetryArchive",
- "resource://gre/modules/TelemetryArchive.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "TelemetryEnvironment",
- "resource://gre/modules/TelemetryEnvironment.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "TelemetryController",
- "resource://gre/modules/TelemetryController.jsm");
-
function MozSelfSupportInterface() {
}
@@ -51,24 +44,6 @@ MozSelfSupportInterface.prototype = {
Services.search.resetToOriginalDefaultEngine();
},
- getTelemetryPingList: function() {
- return this._wrapPromise(TelemetryArchive.promiseArchivedPingList());
- },
-
- getTelemetryPing: function(pingId) {
- return this._wrapPromise(TelemetryArchive.promiseArchivedPingById(pingId));
- },
-
- getCurrentTelemetryEnvironment: function() {
- const current = TelemetryEnvironment.currentEnvironment;
- return new this._window.Promise(resolve => resolve(current));
- },
-
- getCurrentTelemetrySubsessionPing: function() {
- const current = TelemetryController.getCurrentPingData(true);
- return new this._window.Promise(resolve => resolve(current));
- },
-
_wrapPromise: function(promise) {
return new this._window.Promise(
(resolve, reject) => promise.then(resolve, reject));
diff --git a/application/basilisk/components/sessionstore/SessionFile.jsm b/application/basilisk/components/sessionstore/SessionFile.jsm
index 3c55101e41..a51b03dee2 100644
--- a/application/basilisk/components/sessionstore/SessionFile.jsm
+++ b/application/basilisk/components/sessionstore/SessionFile.jsm
@@ -45,8 +45,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "RunState",
"resource:///modules/sessionstore/RunState.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Task",
"resource://gre/modules/Task.jsm");
-XPCOMUtils.defineLazyServiceGetter(this, "Telemetry",
- "@mozilla.org/base/telemetry;1", "nsITelemetry");
XPCOMUtils.defineLazyServiceGetter(this, "sessionStartup",
"@mozilla.org/browser/sessionstartup;1", "nsISessionStartup");
XPCOMUtils.defineLazyModuleGetter(this, "SessionWorker",
@@ -234,10 +232,6 @@ var SessionFileInternal = {
source: source,
parsed: parsed
};
- Telemetry.getHistogramById("FX_SESSION_RESTORE_CORRUPT_FILE").
- add(false);
- Telemetry.getHistogramById("FX_SESSION_RESTORE_READ_FILE_MS").
- add(Date.now() - startMs);
break;
} catch (ex if ex instanceof OS.File.Error && ex.becauseNoSuchFile) {
exists = false;
@@ -253,16 +247,12 @@ var SessionFileInternal = {
} finally {
if (exists) {
noFilesFound = false;
- Telemetry.getHistogramById("FX_SESSION_RESTORE_CORRUPT_FILE").
- add(corrupted);
}
}
}
// All files are corrupted if files found but none could deliver a result.
let allCorrupt = !noFilesFound && !result;
- Telemetry.getHistogramById("FX_SESSION_RESTORE_ALL_FILES_CORRUPT").
- add(allCorrupt);
if (!result) {
// If everything fails, start with an empty session.
@@ -331,7 +321,6 @@ var SessionFileInternal = {
// Wait until the write is done.
promise = promise.then(msg => {
// Record how long the write took.
- this._recordTelemetry(msg.telemetry);
this._successes++;
if (msg.result.upgradeBackup) {
// We have just completed a backup-on-upgrade, store the information
@@ -379,19 +368,4 @@ var SessionFileInternal = {
return this._postToWorker("wipe");
},
- _recordTelemetry: function(telemetry) {
- for (let id of Object.keys(telemetry)){
- let value = telemetry[id];
- let samples = [];
- if (Array.isArray(value)) {
- samples.push(...value);
- } else {
- samples.push(value);
- }
- let histogram = Telemetry.getHistogramById(id);
- for (let sample of samples) {
- histogram.add(sample);
- }
- }
- }
};
diff --git a/application/basilisk/components/sessionstore/SessionStore.jsm b/application/basilisk/components/sessionstore/SessionStore.jsm
index 144fa46002..9d9ef55939 100644
--- a/application/basilisk/components/sessionstore/SessionStore.jsm
+++ b/application/basilisk/components/sessionstore/SessionStore.jsm
@@ -135,7 +135,6 @@ Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm", this);
Cu.import("resource://gre/modules/Promise.jsm", this);
Cu.import("resource://gre/modules/Services.jsm", this);
Cu.import("resource://gre/modules/Task.jsm", this);
-Cu.import("resource://gre/modules/TelemetryTimestamps.jsm", this);
Cu.import("resource://gre/modules/Timer.jsm", this);
Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
Cu.import("resource://gre/modules/debug.js", this);
@@ -145,8 +144,6 @@ XPCOMUtils.defineLazyServiceGetter(this, "gSessionStartup",
"@mozilla.org/browser/sessionstartup;1", "nsISessionStartup");
XPCOMUtils.defineLazyServiceGetter(this, "gScreenManager",
"@mozilla.org/gfx/screenmanager;1", "nsIScreenManager");
-XPCOMUtils.defineLazyServiceGetter(this, "Telemetry",
- "@mozilla.org/base/telemetry;1", "nsITelemetry");
XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource://gre/modules/Console.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow",
@@ -550,7 +547,6 @@ var SessionStoreInternal = {
throw new Error("SessionStore.init() must only be called once!");
}
- TelemetryTimestamps.add("sessionRestoreInitialized");
OBSERVING.forEach(function(aTopic) {
Services.obs.addObserver(this, aTopic, true);
}, this);
@@ -782,9 +778,8 @@ var SessionStoreInternal = {
return;
}
- // Record telemetry measurements done in the child and update the tab's
- // cached state. Mark the window as dirty and trigger a delayed write.
- this.recordTelemetry(aMessage.data.telemetry);
+ // Update the tab's cached state.
+ // Mark the window as dirty and trigger a delayed write.
TabState.update(browser, aMessage.data);
this.saveStateDelayed(win);
@@ -919,18 +914,6 @@ var SessionStoreInternal = {
}
},
- /**
- * Record telemetry measurements stored in an object.
- * @param telemetry
- * {histogramID: value, ...} An object mapping histogramIDs to the
- * value to be recorded for that ID,
- */
- recordTelemetry: function (telemetry) {
- for (let histogramId in telemetry){
- Telemetry.getHistogramById(histogramId).add(telemetry[histogramId]);
- }
- },
-
/* ........ Window Event Handlers .............. */
/**
@@ -1081,7 +1064,6 @@ var SessionStoreInternal = {
// Nothing to restore now, notify observers things are complete.
Services.obs.notifyObservers(null, NOTIFY_WINDOWS_RESTORED, "");
} else {
- TelemetryTimestamps.add("sessionRestoreRestoring");
this._restoreCount = aInitialState.windows ? aInitialState.windows.length : 0;
// global data must be restored before restoreWindow is called so that
@@ -3810,8 +3792,7 @@ var SessionStoreInternal = {
},
/**
- * Update the session start time and send a telemetry measurement
- * for the number of days elapsed since the session was started.
+ * Update the session start time.
*
* @param state
* The session state.
@@ -4437,13 +4418,7 @@ var SessionStoreInternal = {
* Handle an error report from a content process.
*/
reportInternalError(data) {
- // For the moment, we only report errors through Telemetry.
- if (data.telemetry) {
- for (let key of Object.keys(data.telemetry)) {
- let histogram = Telemetry.getHistogramById(key);
- histogram.add(data.telemetry[key]);
- }
- }
+ // STUB, was only reported through Telemetry.
},
/**
diff --git a/application/basilisk/components/sessionstore/SessionWorker.js b/application/basilisk/components/sessionstore/SessionWorker.js
index 7d802a7df8..1297a115c9 100644
--- a/application/basilisk/components/sessionstore/SessionWorker.js
+++ b/application/basilisk/components/sessionstore/SessionWorker.js
@@ -126,7 +126,6 @@ var Agent = {
*/
write: function (state, options = {}) {
let exn;
- let telemetry = {};
// Cap the number of backward and forward shistory entries on shutdown.
if (options.isFinalWrite) {
@@ -197,9 +196,6 @@ var Agent = {
});
}
- telemetry.FX_SESSION_RESTORE_WRITE_FILE_MS = Date.now() - startWriteMs;
- telemetry.FX_SESSION_RESTORE_FILE_SIZE_BYTES = data.byteLength;
-
} catch (ex) {
// Don't throw immediately
exn = exn || ex;
@@ -276,7 +272,6 @@ var Agent = {
result: {
upgradeBackup: upgradeBackupComplete
},
- telemetry: telemetry,
};
},
diff --git a/application/basilisk/components/sessionstore/StartupPerformance.jsm b/application/basilisk/components/sessionstore/StartupPerformance.jsm
index d1b77a237e..361602bc45 100644
--- a/application/basilisk/components/sessionstore/StartupPerformance.jsm
+++ b/application/basilisk/components/sessionstore/StartupPerformance.jsm
@@ -111,18 +111,6 @@ this.StartupPerformance = {
return;
}
- // Once we are done restoring tabs, update Telemetry.
- let histogramName = isAutoRestore ?
- "FX_SESSION_RESTORE_AUTO_RESTORE_DURATION_UNTIL_EAGER_TABS_RESTORED_MS" :
- "FX_SESSION_RESTORE_MANUAL_RESTORE_DURATION_UNTIL_EAGER_TABS_RESTORED_MS";
- let histogram = Services.telemetry.getHistogramById(histogramName);
- let delta = this._latestRestoredTimeStamp - this._startTimeStamp;
- histogram.add(delta);
-
- Services.telemetry.getHistogramById("FX_SESSION_RESTORE_NUMBER_OF_EAGER_TABS_RESTORED").add(this._totalNumberOfEagerTabs);
- Services.telemetry.getHistogramById("FX_SESSION_RESTORE_NUMBER_OF_TABS_RESTORED").add(this._totalNumberOfTabs);
- Services.telemetry.getHistogramById("FX_SESSION_RESTORE_NUMBER_OF_WINDOWS_RESTORED").add(this._totalNumberOfWindows);
-
// Reset
this._startTimeStamp = null;
} catch (ex) {
diff --git a/application/basilisk/components/sessionstore/content/content-sessionStore.js b/application/basilisk/components/sessionstore/content/content-sessionStore.js
index 858e35750e..8af335011b 100644
--- a/application/basilisk/components/sessionstore/content/content-sessionStore.js
+++ b/application/basilisk/components/sessionstore/content/content-sessionStore.js
@@ -628,7 +628,6 @@ var SessionStorageListener = {
let size = this.estimateStorageSize(collected);
- MessageQueue.push("telemetry", () => ({ FX_SESSION_RESTORE_DOM_STORAGE_SIZE_ESTIMATE_CHARS: size }));
if (size > Preferences.get("browser.sessionstore.dom_storage_limit", DOM_STORAGE_MAX_CHARS)) {
// Rather than keeping the old storage, which wouldn't match the rest
// of the state of the page, empty the storage. DOM storage will be
@@ -800,37 +799,23 @@ var MessageQueue = {
let durationMs = Date.now();
let data = {};
- let telemetry = {};
for (let [key, func] of this._data) {
let value = func();
- if (key == "telemetry") {
- for (let histogramId of Object.keys(value)) {
- telemetry[histogramId] = value[histogramId];
- }
- } else if (value || (key != "storagechange" && key != "historychange")) {
+ if (value || (key != "storagechange" && key != "historychange")) {
data[key] = value;
}
}
this._data.clear();
- durationMs = Date.now() - durationMs;
- telemetry.FX_SESSION_RESTORE_CONTENT_COLLECT_DATA_LONGEST_OP_MS = durationMs;
-
try {
// Send all data to the parent process.
sendAsyncMessage("SessionStore:update", {
- data, telemetry, flushID,
+ data, flushID,
isFinal: options.isFinal || false,
epoch: gCurrentEpoch
});
} catch (ex if ex && ex.result == Cr.NS_ERROR_OUT_OF_MEMORY) {
- let telemetry = {
- FX_SESSION_RESTORE_SEND_UPDATE_CAUSED_OOM: 1
- };
- sendAsyncMessage("SessionStore:error", {
- telemetry
- });
}
},
};
diff --git a/application/basilisk/components/sessionstore/nsSessionStartup.js b/application/basilisk/components/sessionstore/nsSessionStartup.js
index 9e77b12dac..0dba95cbe7 100644
--- a/application/basilisk/components/sessionstore/nsSessionStartup.js
+++ b/application/basilisk/components/sessionstore/nsSessionStartup.js
@@ -203,11 +203,6 @@ SessionStartup.prototype = {
}
}
- // Report shutdown success via telemetry. Shortcoming here are
- // being-killed-by-OS-shutdown-logic, shutdown freezing after
- // session restore was written, etc.
- Services.telemetry.getHistogramById("SHUTDOWN_OK").add(!this._previousSessionCrashed);
-
// set the startup type
if (this._previousSessionCrashed && resumeFromCrash)
this._sessionType = Ci.nsISessionStartup.RECOVER_SESSION;
diff --git a/application/basilisk/installer/allowed-dupes.mn b/application/basilisk/installer/allowed-dupes.mn
index 9d1d06937e..e24b47ed79 100644
--- a/application/basilisk/installer/allowed-dupes.mn
+++ b/application/basilisk/installer/allowed-dupes.mn
@@ -124,8 +124,6 @@ chrome/en-US/locale/en-US/browser/overrides/dom/dom.properties
chrome/en-US/locale/en-US/browser/overrides/global.dtd
chrome/en-US/locale/en-US/browser/overrides/global/aboutSupport.dtd
chrome/en-US/locale/en-US/browser/overrides/global/aboutSupport.properties
-chrome/en-US/locale/en-US/browser/overrides/global/aboutTelemetry.dtd
-chrome/en-US/locale/en-US/browser/overrides/global/aboutTelemetry.properties
chrome/en-US/locale/en-US/browser/overrides/global/aboutWebrtc.properties
chrome/en-US/locale/en-US/browser/overrides/global/mozilla.dtd
chrome/en-US/locale/en-US/browser/overrides/intl.css
@@ -148,8 +146,6 @@ chrome/en-US/locale/en-US/global/aboutReader.properties
chrome/en-US/locale/en-US/global/aboutRights.dtd
chrome/en-US/locale/en-US/global/aboutSupport.dtd
chrome/en-US/locale/en-US/global/aboutSupport.properties
-chrome/en-US/locale/en-US/global/aboutTelemetry.dtd
-chrome/en-US/locale/en-US/global/aboutTelemetry.properties
chrome/en-US/locale/en-US/global/aboutWebrtc.properties
chrome/en-US/locale/en-US/global/charsetMenu.properties
chrome/en-US/locale/en-US/global/commonDialogs.properties
diff --git a/application/basilisk/installer/package-manifest.in b/application/basilisk/installer/package-manifest.in
index 147567de98..44b23f962e 100644
--- a/application/basilisk/installer/package-manifest.in
+++ b/application/basilisk/installer/package-manifest.in
@@ -319,7 +319,6 @@
@RESPATH@/components/xul.xpt
@RESPATH@/components/xultmpl.xpt
@RESPATH@/components/zipwriter.xpt
-@RESPATH@/components/telemetry.xpt
; JavaScript components
@RESPATH@/components/ConsoleAPI.manifest
@@ -483,8 +482,6 @@
@RESPATH@/components/captivedetect.js
@RESPATH@/components/servicesComponents.manifest
@RESPATH@/components/cryptoComponents.manifest
-@RESPATH@/components/TelemetryStartup.js
-@RESPATH@/components/TelemetryStartup.manifest
@RESPATH@/components/XULStore.js
@RESPATH@/components/XULStore.manifest
@RESPATH@/components/messageWakeupService.js
@@ -727,7 +724,6 @@
@RESPATH@/components/dom_audiochannel.xpt
; Shutdown Terminator
-@RESPATH@/components/nsTerminatorTelemetry.js
@RESPATH@/components/terminator.manifest
#if defined(CLANG_CXX)
diff --git a/application/basilisk/locales/en-US/chrome/browser/aboutDialog.dtd b/application/basilisk/locales/en-US/chrome/browser/aboutDialog.dtd
index e0c34692e8..1f87b6046d 100644
--- a/application/basilisk/locales/en-US/chrome/browser/aboutDialog.dtd
+++ b/application/basilisk/locales/en-US/chrome/browser/aboutDialog.dtd
@@ -16,8 +16,6 @@
-
-
diff --git a/application/basilisk/locales/en-US/chrome/browser/browser.properties b/application/basilisk/locales/en-US/chrome/browser/browser.properties
index 394fb069a8..c57f466cf7 100644
--- a/application/basilisk/locales/en-US/chrome/browser/browser.properties
+++ b/application/basilisk/locales/en-US/chrome/browser/browser.properties
@@ -427,11 +427,6 @@ safeModeRestartButton=Restart
# menu, set this to "true". Otherwise, you can leave it as "false".
browser.menu.showCharacterEncoding=false
-# Mozilla data reporting notification (Telemetry, Firefox Health Report, etc)
-dataReportingNotification.message = %1$S automatically sends some data to %2$S so that we can improve your experience.
-dataReportingNotification.button.label = Choose What I Share
-dataReportingNotification.button.accessKey = C
-
# Process hang reporter
processHang.label = A web page is slowing down your browser. What would you like to do?
processHang.button_stop.label = Stop It
diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/advanced.dtd b/application/basilisk/locales/en-US/chrome/browser/preferences/advanced.dtd
index 124c00d845..25429c6335 100644
--- a/application/basilisk/locales/en-US/chrome/browser/preferences/advanced.dtd
+++ b/application/basilisk/locales/en-US/chrome/browser/preferences/advanced.dtd
@@ -35,11 +35,6 @@
-
-
-
-
-
diff --git a/application/basilisk/modules/BrowserUsageTelemetry.jsm b/application/basilisk/modules/BrowserUsageTelemetry.jsm
deleted file mode 100644
index 39012d2abc..0000000000
--- a/application/basilisk/modules/BrowserUsageTelemetry.jsm
+++ /dev/null
@@ -1,468 +0,0 @@
-/* -*- js-indent-level: 2; indent-tabs-mode: nil -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["BrowserUsageTelemetry"];
-
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
- "resource://gre/modules/PrivateBrowsingUtils.jsm");
-
-// The upper bound for the count of the visited unique domain names.
-const MAX_UNIQUE_VISITED_DOMAINS = 100;
-
-// Observed topic names.
-const WINDOWS_RESTORED_TOPIC = "sessionstore-windows-restored";
-const TAB_RESTORING_TOPIC = "SSTabRestoring";
-const TELEMETRY_SUBSESSIONSPLIT_TOPIC = "internal-telemetry-after-subsession-split";
-const DOMWINDOW_OPENED_TOPIC = "domwindowopened";
-
-// Probe names.
-const MAX_TAB_COUNT_SCALAR_NAME = "browser.engagement.max_concurrent_tab_count";
-const MAX_WINDOW_COUNT_SCALAR_NAME = "browser.engagement.max_concurrent_window_count";
-const TAB_OPEN_EVENT_COUNT_SCALAR_NAME = "browser.engagement.tab_open_event_count";
-const WINDOW_OPEN_EVENT_COUNT_SCALAR_NAME = "browser.engagement.window_open_event_count";
-const UNIQUE_DOMAINS_COUNT_SCALAR_NAME = "browser.engagement.unique_domains_count";
-const TOTAL_URI_COUNT_SCALAR_NAME = "browser.engagement.total_uri_count";
-const UNFILTERED_URI_COUNT_SCALAR_NAME = "browser.engagement.unfiltered_uri_count";
-
-// A list of known search origins.
-const KNOWN_SEARCH_SOURCES = [
- "abouthome",
- "contextmenu",
- "newtab",
- "searchbar",
- "urlbar",
-];
-
-const KNOWN_ONEOFF_SOURCES = [
- "oneoff-urlbar",
- "oneoff-searchbar",
- "unknown", // Edge case: this is the searchbar (see bug 1195733 comment 7).
-];
-
-function getOpenTabsAndWinsCounts() {
- let tabCount = 0;
- let winCount = 0;
-
- let browserEnum = Services.wm.getEnumerator("navigator:browser");
- while (browserEnum.hasMoreElements()) {
- let win = browserEnum.getNext();
- winCount++;
- tabCount += win.gBrowser.tabs.length;
- }
-
- return { tabCount, winCount };
-}
-
-function getSearchEngineId(engine) {
- if (engine) {
- if (engine.identifier) {
- return engine.identifier;
- }
- // Due to bug 1222070, we can't directly check Services.telemetry.canRecordExtended
- // here.
- const extendedTelemetry = Services.prefs.getBoolPref("toolkit.telemetry.enabled");
- if (engine.name && extendedTelemetry) {
- // If it's a custom search engine only report the engine name
- // if extended Telemetry is enabled.
- return "other-" + engine.name;
- }
- }
- return "other";
-}
-
-let URICountListener = {
- // A set containing the visited domains, see bug 1271310.
- _domainSet: new Set(),
- // A map to keep track of the URIs loaded from the restored tabs.
- _restoredURIsMap: new WeakMap(),
-
- isHttpURI(uri) {
- // Only consider http(s) schemas.
- return uri.schemeIs("http") || uri.schemeIs("https");
- },
-
- addRestoredURI(browser, uri) {
- if (!this.isHttpURI(uri)) {
- return;
- }
-
- this._restoredURIsMap.set(browser, uri.spec);
- },
-
- onLocationChange(browser, webProgress, request, uri, flags) {
- // Don't count this URI if it's an error page.
- if (flags & Ci.nsIWebProgressListener.LOCATION_CHANGE_ERROR_PAGE) {
- return;
- }
-
- // We only care about top level loads.
- if (!webProgress.isTopLevel) {
- return;
- }
-
- // The SessionStore sets the URI of a tab first, firing onLocationChange the
- // first time, then manages content loading using its scheduler. Once content
- // loads, we will hit onLocationChange again.
- // We can catch the first case by checking for null requests: be advised that
- // this can also happen when navigating page fragments, so account for it.
- if (!request &&
- !(flags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT)) {
- return;
- }
-
- // Track URI loads, even if they're not http(s).
- let uriSpec = null;
- try {
- uriSpec = uri.spec;
- } catch (e) {
- // If we have troubles parsing the spec, still count this as
- // an unfiltered URI.
- Services.telemetry.scalarAdd(UNFILTERED_URI_COUNT_SCALAR_NAME, 1);
- return;
- }
-
-
- // Don't count about:blank and similar pages, as they would artificially
- // inflate the counts.
- if (browser.ownerDocument.defaultView.gInitialPages.includes(uriSpec)) {
- return;
- }
-
- // If the URI we're loading is in the _restoredURIsMap, then it comes from a
- // restored tab. If so, let's skip it and remove it from the map as we want to
- // count page refreshes.
- if (this._restoredURIsMap.get(browser) === uriSpec) {
- this._restoredURIsMap.delete(browser);
- return;
- }
-
- // The URI wasn't from a restored tab. Count it among the unfiltered URIs.
- // If this is an http(s) URI, this also gets counted by the "total_uri_count"
- // probe.
- Services.telemetry.scalarAdd(UNFILTERED_URI_COUNT_SCALAR_NAME, 1);
-
- if (!this.isHttpURI(uri)) {
- return;
- }
-
- // Update the URI counts.
- Services.telemetry.scalarAdd(TOTAL_URI_COUNT_SCALAR_NAME, 1);
-
- // We only want to count the unique domains up to MAX_UNIQUE_VISITED_DOMAINS.
- if (this._domainSet.size == MAX_UNIQUE_VISITED_DOMAINS) {
- return;
- }
-
- // Unique domains should be aggregated by (eTLD + 1): x.test.com and y.test.com
- // are counted once as test.com.
- try {
- // Even if only considering http(s) URIs, |getBaseDomain| could still throw
- // due to the URI containing invalid characters or the domain actually being
- // an ipv4 or ipv6 address.
- this._domainSet.add(Services.eTLD.getBaseDomain(uri));
- } catch (e) {
- return;
- }
-
- Services.telemetry.scalarSet(UNIQUE_DOMAINS_COUNT_SCALAR_NAME, this._domainSet.size);
- },
-
- /**
- * Reset the counts. This should be called when breaking a session in Telemetry.
- */
- reset() {
- this._domainSet.clear();
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
- Ci.nsISupportsWeakReference]),
-};
-
-let BrowserUsageTelemetry = {
- init() {
- Services.obs.addObserver(this, WINDOWS_RESTORED_TOPIC, false);
- },
-
- /**
- * Handle subsession splits in the parent process.
- */
- afterSubsessionSplit() {
- // Scalars just got cleared due to a subsession split. We need to set the maximum
- // concurrent tab and window counts so that they reflect the correct value for the
- // new subsession.
- const counts = getOpenTabsAndWinsCounts();
- Services.telemetry.scalarSetMaximum(MAX_TAB_COUNT_SCALAR_NAME, counts.tabCount);
- Services.telemetry.scalarSetMaximum(MAX_WINDOW_COUNT_SCALAR_NAME, counts.winCount);
-
- // Reset the URI counter.
- URICountListener.reset();
- },
-
- uninit() {
- Services.obs.removeObserver(this, DOMWINDOW_OPENED_TOPIC, false);
- Services.obs.removeObserver(this, TELEMETRY_SUBSESSIONSPLIT_TOPIC, false);
- Services.obs.removeObserver(this, WINDOWS_RESTORED_TOPIC, false);
- },
-
- observe(subject, topic, data) {
- switch (topic) {
- case WINDOWS_RESTORED_TOPIC:
- this._setupAfterRestore();
- break;
- case DOMWINDOW_OPENED_TOPIC:
- this._onWindowOpen(subject);
- break;
- case TELEMETRY_SUBSESSIONSPLIT_TOPIC:
- this.afterSubsessionSplit();
- break;
- }
- },
-
- handleEvent(event) {
- switch (event.type) {
- case "TabOpen":
- this._onTabOpen();
- break;
- case "unload":
- this._unregisterWindow(event.target);
- break;
- case TAB_RESTORING_TOPIC:
- // We're restoring a new tab from a previous or crashed session.
- // We don't want to track the URIs from these tabs, so let
- // |URICountListener| know about them.
- let browser = event.target.linkedBrowser;
- URICountListener.addRestoredURI(browser, browser.currentURI);
- break;
- }
- },
-
- /**
- * The main entry point for recording search related Telemetry. This includes
- * search counts and engagement measurements.
- *
- * Telemetry records only search counts per engine and action origin, but
- * nothing pertaining to the search contents themselves.
- *
- * @param {nsISearchEngine} engine
- * The engine handling the search.
- * @param {String} source
- * Where the search originated from. See KNOWN_SEARCH_SOURCES for allowed
- * values.
- * @param {Object} [details] Options object.
- * @param {Boolean} [details.isOneOff=false]
- * true if this event was generated by a one-off search.
- * @param {Boolean} [details.isSuggestion=false]
- * true if this event was generated by a suggested search.
- * @param {Boolean} [details.isAlias=false]
- * true if this event was generated by a search using an alias.
- * @param {Object} [details.type=null]
- * The object describing the event that triggered the search.
- * @throws if source is not in the known sources list.
- */
- recordSearch(engine, source, details={}) {
- const isOneOff = !!details.isOneOff;
- const countId = getSearchEngineId(engine) + "." + source;
-
- if (isOneOff) {
- if (!KNOWN_ONEOFF_SOURCES.includes(source)) {
- // Silently drop the error if this bogus call
- // came from 'urlbar' or 'searchbar'. They're
- // calling |recordSearch| twice from two different
- // code paths because they want to record the search
- // in SEARCH_COUNTS.
- if (['urlbar', 'searchbar'].includes(source)) {
- Services.telemetry.getKeyedHistogramById("SEARCH_COUNTS").add(countId);
- return;
- }
- throw new Error("Unknown source for one-off search: " + source);
- }
- } else {
- if (!KNOWN_SEARCH_SOURCES.includes(source)) {
- throw new Error("Unknown source for search: " + source);
- }
- Services.telemetry.getKeyedHistogramById("SEARCH_COUNTS").add(countId);
- }
-
- // Dispatch the search signal to other handlers.
- this._handleSearchAction(engine, source, details);
- },
-
- _recordSearch(engine, source, action = null) {
- let scalarKey = action ? "search_" + action : "search";
- Services.telemetry.keyedScalarAdd("browser.engagement.navigation." + source,
- scalarKey, 1);
- Services.telemetry.recordEvent("navigation", "search", source, action,
- { engine: getSearchEngineId(engine) });
- },
-
- _handleSearchAction(engine, source, details) {
- switch (source) {
- case "urlbar":
- case "oneoff-urlbar":
- case "searchbar":
- case "oneoff-searchbar":
- case "unknown": // Edge case: this is the searchbar (see bug 1195733 comment 7).
- this._handleSearchAndUrlbar(engine, source, details);
- break;
- case "abouthome":
- this._recordSearch(engine, "about_home", "enter");
- break;
- case "newtab":
- this._recordSearch(engine, "about_newtab", "enter");
- break;
- case "contextmenu":
- this._recordSearch(engine, "contextmenu");
- break;
- }
- },
-
- /**
- * This function handles the "urlbar", "urlbar-oneoff", "searchbar" and
- * "searchbar-oneoff" sources.
- */
- _handleSearchAndUrlbar(engine, source, details) {
- // We want "urlbar" and "urlbar-oneoff" (and similar cases) to go in the same
- // scalar, but in a different key.
-
- // When using one-offs in the searchbar we get an "unknown" source. See bug
- // 1195733 comment 7 for the context. Fix-up the label here.
- const sourceName =
- (source === "unknown") ? "searchbar" : source.replace("oneoff-", "");
-
- const isOneOff = !!details.isOneOff;
- if (isOneOff) {
- // We will receive a signal from the "urlbar"/"searchbar" even when the
- // search came from "oneoff-urlbar". That's because both signals
- // are propagated from search.xml. Skip it if that's the case.
- // Moreover, we skip the "unknown" source that comes from the searchbar
- // when performing searches from the default search engine. See bug 1195733
- // comment 7 for context.
- if (["urlbar", "searchbar", "unknown"].includes(source)) {
- return;
- }
-
- // If that's a legit one-off search signal, record it using the relative key.
- this._recordSearch(engine, sourceName, "oneoff");
- return;
- }
-
- // The search was not a one-off. It was a search with the default search engine.
- if (details.isSuggestion) {
- // It came from a suggested search, so count it as such.
- this._recordSearch(engine, sourceName, "suggestion");
- return;
- } else if (details.isAlias) {
- // This one came from a search that used an alias.
- this._recordSearch(engine, sourceName, "alias");
- return;
- }
-
- // The search signal was generated by typing something and pressing enter.
- this._recordSearch(engine, sourceName, "enter");
- },
-
- /**
- * This gets called shortly after the SessionStore has finished restoring
- * windows and tabs. It counts the open tabs and adds listeners to all the
- * windows.
- */
- _setupAfterRestore() {
- // Make sure to catch new chrome windows and subsession splits.
- Services.obs.addObserver(this, DOMWINDOW_OPENED_TOPIC, false);
- Services.obs.addObserver(this, TELEMETRY_SUBSESSIONSPLIT_TOPIC, false);
-
- // Attach the tabopen handlers to the existing Windows.
- let browserEnum = Services.wm.getEnumerator("navigator:browser");
- while (browserEnum.hasMoreElements()) {
- this._registerWindow(browserEnum.getNext());
- }
-
- // Get the initial tab and windows max counts.
- const counts = getOpenTabsAndWinsCounts();
- Services.telemetry.scalarSetMaximum(MAX_TAB_COUNT_SCALAR_NAME, counts.tabCount);
- Services.telemetry.scalarSetMaximum(MAX_WINDOW_COUNT_SCALAR_NAME, counts.winCount);
- },
-
- /**
- * Adds listeners to a single chrome window.
- */
- _registerWindow(win) {
- win.addEventListener("unload", this);
- win.addEventListener("TabOpen", this, true);
-
- // Don't include URI and domain counts when in private mode.
- if (PrivateBrowsingUtils.isWindowPrivate(win)) {
- return;
- }
- win.gBrowser.tabContainer.addEventListener(TAB_RESTORING_TOPIC, this);
- win.gBrowser.addTabsProgressListener(URICountListener);
- },
-
- /**
- * Removes listeners from a single chrome window.
- */
- _unregisterWindow(win) {
- win.removeEventListener("unload", this);
- win.removeEventListener("TabOpen", this, true);
-
- // Don't include URI and domain counts when in private mode.
- if (PrivateBrowsingUtils.isWindowPrivate(win.defaultView)) {
- return;
- }
- win.defaultView.gBrowser.tabContainer.removeEventListener(TAB_RESTORING_TOPIC, this);
- win.defaultView.gBrowser.removeTabsProgressListener(URICountListener);
- },
-
- /**
- * Updates the tab counts.
- * @param {Number} [newTabCount=0] The count of the opened tabs across all windows. This
- * is computed manually if not provided.
- */
- _onTabOpen(tabCount = 0) {
- // Use the provided tab count if available. Otherwise, go on and compute it.
- tabCount = tabCount || getOpenTabsAndWinsCounts().tabCount;
- // Update the "tab opened" count and its maximum.
- Services.telemetry.scalarAdd(TAB_OPEN_EVENT_COUNT_SCALAR_NAME, 1);
- Services.telemetry.scalarSetMaximum(MAX_TAB_COUNT_SCALAR_NAME, tabCount);
- },
-
- /**
- * Tracks the window count and registers the listeners for the tab count.
- * @param{Object} win The window object.
- */
- _onWindowOpen(win) {
- // Make sure to have a |nsIDOMWindow|.
- if (!(win instanceof Ci.nsIDOMWindow)) {
- return;
- }
-
- let onLoad = () => {
- win.removeEventListener("load", onLoad, false);
-
- // Ignore non browser windows.
- if (win.document.documentElement.getAttribute("windowtype") != "navigator:browser") {
- return;
- }
-
- this._registerWindow(win);
- // Track the window open event and check the maximum.
- const counts = getOpenTabsAndWinsCounts();
- Services.telemetry.scalarAdd(WINDOW_OPEN_EVENT_COUNT_SCALAR_NAME, 1);
- Services.telemetry.scalarSetMaximum(MAX_WINDOW_COUNT_SCALAR_NAME, counts.winCount);
-
- // We won't receive the "TabOpen" event for the first tab within a new window.
- // Account for that.
- this._onTabOpen(counts.tabCount);
- };
- win.addEventListener("load", onLoad, false);
- },
-};
diff --git a/application/basilisk/modules/ContentCrashHandlers.jsm b/application/basilisk/modules/ContentCrashHandlers.jsm
index 488cc4f265..4319c43dfd 100644
--- a/application/basilisk/modules/ContentCrashHandlers.jsm
+++ b/application/basilisk/modules/ContentCrashHandlers.jsm
@@ -86,12 +86,6 @@ this.TabCrashHandler = {
let childID = aSubject.get("childID");
let dumpID = aSubject.get("dumpID");
- if (!dumpID) {
- Services.telemetry
- .getHistogramById("FX_CONTENT_CRASH_DUMP_UNAVAILABLE")
- .add(1);
- }
-
if (!this.flushCrashedBrowserQueue(childID)) {
this.unseenCrashedChildIDs.push(childID);
// The elements in unseenCrashedChildIDs will only be removed if
@@ -375,12 +369,6 @@ this.TabCrashHandler = {
data.email = this.prefs.getCharPref("email", "");
}
- // Make sure to only count once even if there are multiple windows
- // that will all show about:tabcrashed.
- if (this._crashedTabCount == 1) {
- Services.telemetry.getHistogramById("FX_CONTENT_CRASH_PRESENTED").add(1);
- }
-
message.target.sendAsyncMessage("SetCrashReportAvailable", data);
},
@@ -402,11 +390,6 @@ this.TabCrashHandler = {
let browser = message.target.browser;
let childID = this.browserMap.get(browser.permanentKey);
- // Make sure to only count once even if there are multiple windows
- // that will all show about:tabcrashed.
- if (this._crashedTabCount == 0 && childID) {
- Services.telemetry.getHistogramById("FX_CONTENT_CRASH_NOT_SUBMITTED").add(1);
- }
},
/**
diff --git a/application/basilisk/modules/ContentLinkHandler.jsm b/application/basilisk/modules/ContentLinkHandler.jsm
index 443cae2daf..76822e8030 100644
--- a/application/basilisk/modules/ContentLinkHandler.jsm
+++ b/application/basilisk/modules/ContentLinkHandler.jsm
@@ -19,13 +19,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "Feeds",
XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
"resource://gre/modules/BrowserUtils.jsm");
-const SIZES_TELEMETRY_ENUM = {
- NO_SIZES: 0,
- ANY: 1,
- DIMENSION: 2,
- INVALID: 3,
-};
-
this.ContentLinkHandler = {
init: function(chromeGlobal) {
chromeGlobal.addEventListener("DOMLinkAdded", (event) => {
@@ -79,35 +72,6 @@ this.ContentLinkHandler = {
if (!uri)
break;
- // Telemetry probes for measuring the sizes attribute
- // usage and available dimensions.
- let sizeHistogramTypes = Services.telemetry.
- getHistogramById("LINK_ICON_SIZES_ATTR_USAGE");
- let sizeHistogramDimension = Services.telemetry.
- getHistogramById("LINK_ICON_SIZES_ATTR_DIMENSION");
- let sizesType;
- if (link.sizes.length) {
- for (let size of link.sizes) {
- if (size.toLowerCase() == "any") {
- sizesType = SIZES_TELEMETRY_ENUM.ANY;
- break;
- } else {
- let re = /^([1-9][0-9]*)x[1-9][0-9]*$/i;
- let values = re.exec(size);
- if (values && values.length > 1) {
- sizesType = SIZES_TELEMETRY_ENUM.DIMENSION;
- sizeHistogramDimension.add(parseInt(values[1]));
- } else {
- sizesType = SIZES_TELEMETRY_ENUM.INVALID;
- break;
- }
- }
- }
- } else {
- sizesType = SIZES_TELEMETRY_ENUM.NO_SIZES;
- }
- sizeHistogramTypes.add(sizesType);
-
chromeGlobal.sendAsyncMessage(
"Link:SetIcon",
{url: uri.spec, loadingPrincipal: link.ownerDocument.nodePrincipal});
diff --git a/application/basilisk/modules/ContentSearch.jsm b/application/basilisk/modules/ContentSearch.jsm
index 91b0b9ac8b..8e10b79bb7 100644
--- a/application/basilisk/modules/ContentSearch.jsm
+++ b/application/basilisk/modules/ContentSearch.jsm
@@ -254,8 +254,6 @@ this.ContentSearch = {
};
win.openUILinkIn(submission.uri.spec, where, params);
}
- win.BrowserSearch.recordSearchInTelemetry(engine, data.healthReportKey,
- { selection: data.selection });
return;
},
diff --git a/application/basilisk/modules/PermissionUI.jsm b/application/basilisk/modules/PermissionUI.jsm
index 5c8b94421c..984f95cd58 100644
--- a/application/basilisk/modules/PermissionUI.jsm
+++ b/application/basilisk/modules/PermissionUI.jsm
@@ -234,9 +234,7 @@ this.PermissionPromptPrototype = {
/**
* If the prompt will be shown to the user, this callback will
- * be called just before. Subclasses may want to override this
- * in order to, for example, bump a counter Telemetry probe for
- * how often a particular permission request is seen.
+ * be called just before. Subclasses may want to override this.
*/
onBeforeShow() {},
diff --git a/application/basilisk/modules/PluginContent.jsm b/application/basilisk/modules/PluginContent.jsm
index 622d608bcb..7317b19267 100644
--- a/application/basilisk/modules/PluginContent.jsm
+++ b/application/basilisk/modules/PluginContent.jsm
@@ -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) ==
diff --git a/application/basilisk/modules/ProcessHangMonitor.jsm b/application/basilisk/modules/ProcessHangMonitor.jsm
index 80c506ac75..1e4c192d85 100644
--- a/application/basilisk/modules/ProcessHangMonitor.jsm
+++ b/application/basilisk/modules/ProcessHangMonitor.jsm
@@ -364,17 +364,6 @@ var ProcessHangMonitor = {
return;
}
- // On e10s this counts slow-script/hanged-plugin notice only once.
- // This code is not reached on non-e10s.
- if (report.hangType == report.SLOW_SCRIPT) {
- // On non-e10s, SLOW_SCRIPT_NOTICE_COUNT is probed at nsGlobalWindow.cpp
- Services.telemetry.getHistogramById("SLOW_SCRIPT_NOTICE_COUNT").add();
- } else if (report.hangType == report.PLUGIN_HANG) {
- // On non-e10s we have sufficient plugin telemetry probes,
- // so PLUGIN_HANG_NOTICE_COUNT is only probed on e10s.
- Services.telemetry.getHistogramById("PLUGIN_HANG_NOTICE_COUNT").add();
- }
-
this._activeReports.add(report);
this.updateWindows();
},
diff --git a/application/basilisk/modules/moz.build b/application/basilisk/modules/moz.build
index 26661dbb76..881ff98f36 100644
--- a/application/basilisk/modules/moz.build
+++ b/application/basilisk/modules/moz.build
@@ -7,7 +7,6 @@ EXTRA_JS_MODULES += [
'AboutHome.jsm',
'AboutNewTab.jsm',
'AttributionCode.jsm',
- 'BrowserUsageTelemetry.jsm',
'ContentClick.jsm',
'ContentCrashHandlers.jsm',
'ContentLinkHandler.jsm',