Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 639ee50b7c6f6113a25047fc8c7723b3c2ec8610 Mon Sep 17 00:00:00 2001
- Subject: [PATCH 1/1] Telemetry branch hacks
- ---
- application/basilisk/app/profile/basilisk.js | 4 -
- .../basilisk/base/content/aboutNetError.xhtml | 6 -
- .../browser-fullScreenAndPointerLock.js | 5 -
- .../basilisk/base/content/browser-media.js | 19 +-
- .../basilisk/base/content/browser-plugins.js | 27 +-
- .../content/browser-trackingprotection.js | 46 --
- .../basilisk/base/content/newtab/page.js | 14 +-
- .../basilisk/base/content/newtab/sites.js | 28 +-
- .../basilisk/base/content/tabbrowser.xml | 127 +----
- .../components/migration/AutoMigrate.jsm | 30 --
- .../migration/FirefoxProfileMigrator.js | 71 +--
- .../components/migration/MigrationUtils.jsm | 39 +-
- .../components/migration/content/migration.js | 74 +--
- .../components/nsBrowserContentHandler.js | 23 +-
- .../places/content/browserPlacesViews.js | 3 -
- .../preferences/in-content/advanced.js | 77 ---
- .../preferences/in-content/advanced.xul | 42 --
- .../preferences/in-content/content.js | 5 -
- .../preferences/in-content/preferences.js | 34 --
- .../components/search/content/searchReset.js | 26 -
- .../search/service/nsSearchService.js | 24 -
- .../components/sessionstore/SessionWorker.js | 5 -
- .../sessionstore/StartupPerformance.jsm | 12 -
- .../content/content-sessionStore.js | 35 --
- .../sessionstore/nsSessionStartup.js | 5 -
- .../pdfjs/content/PdfJsTelemetry.jsm | 70 ---
- .../pdfjs/content/PdfStreamConverter.jsm | 73 +--
- .../en-US/chrome/browser/aboutDialog.dtd | 2 -
- .../chrome/browser/preferences/advanced.dtd | 17 -
- .../modules/BrowserUsageTelemetry.jsm | 468 ------------------
- .../basilisk/modules/ContentCrashHandlers.jsm | 21 -
- .../basilisk/modules/ContentLinkHandler.jsm | 36 --
- .../basilisk/modules/PluginContent.jsm | 52 --
- .../basilisk/modules/ProcessHangMonitor.jsm | 11 -
- application/basilisk/modules/moz.build | 1 -
- .../shared/incontentprefs/preferences.inc.css | 11 -
- .../palemoon/base/content/tabbrowser.xml | 85 ----
- .../palemoon/components/newtab/page.js | 3 -
- .../palemoon/components/newtab/sites.js | 15 -
- .../components/addoncompat/CompatWarning.jsm | 5 -
- .../alerts/resources/content/alert.js | 2 -
- .../asyncshutdown/AsyncShutdown.jsm | 1 -
- .../blocklist/nsBlocklistService.js | 5 -
- .../ContextualIdentityService.jsm | 25 -
- toolkit/components/gfx/SanityTest.js | 15 -
- .../osfile/modules/osfile_async_front.jsm | 24 -
- .../osfile/modules/osfile_async_worker.js | 8 -
- .../nsIParentalControlsService.idl | 1 -
- .../passwordmgr/InsecurePasswordUtils.jsm | 2 -
- .../passwordmgr/LoginManagerContent.jsm | 1 -
- .../passwordmgr/content/passwordManager.js | 9 -
- .../components/passwordmgr/nsLoginManager.js | 75 ---
- .../passwordmgr/nsLoginManagerPrompter.js | 13 -
- .../components/places/BookmarkHTMLUtils.jsm | 8 -
- toolkit/components/places/PlacesDBUtils.jsm | 186 -------
- .../components/places/nsPlacesExpiration.js | 21 -
- .../components/printing/content/printUtils.js | 13 -
- toolkit/components/terminator/moz.build | 1 -
- .../terminator/nsTerminatorTelemetry.js | 105 ----
- .../thumbnails/BackgroundPageThumbs.jsm | 38 --
- toolkit/components/thumbnails/PageThumbs.jsm | 7 -
- .../content/backgroundPageThumbsContent.js | 4 -
- .../nsUrlClassifierHashCompleter.js | 115 -----
- .../viewsource/content/viewSourceUtils.js | 9 -
- 64 files changed, 25 insertions(+), 2314 deletions(-)
- delete mode 100644 application/basilisk/extensions/pdfjs/content/PdfJsTelemetry.jsm
- delete mode 100644 application/basilisk/modules/BrowserUsageTelemetry.jsm
- delete mode 100644 toolkit/components/terminator/nsTerminatorTelemetry.js
- diff --git a/application/basilisk/app/profile/basilisk.js b/application/basilisk/app/profile/basilisk.js
- index a3ecce64d..33f6cb9b8 100644
- --- a/application/basilisk/app/profile/basilisk.js
- +++ b/application/basilisk/app/profile/basilisk.js
- @@ -1199,10 +1199,6 @@ pref("media.gmp-widevinecdm.enabled", true);
- // -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);
- -
- // 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 5ff79ea12..77aca22d1 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/browser-fullScreenAndPointerLock.js b/application/basilisk/base/content/browser-fullScreenAndPointerLock.js
- index b26a31f78..a72b409c4 100644
- --- a/application/basilisk/base/content/browser-fullScreenAndPointerLock.js
- +++ b/application/basilisk/base/content/browser-fullScreenAndPointerLock.js
- @@ -342,11 +342,6 @@ var FullScreen = {
- // TabsInTitlebar._update() and bug 1173768.
- TabsInTitlebar.updateAppearance(true);
- }
- -
- - if (enterFS && !document.fullscreenElement) {
- - Services.telemetry.getHistogramById("FX_BROWSER_FULLSCREEN_USED")
- - .add(1);
- - }
- },
- exitDomFullScreen : function() {
- diff --git a/application/basilisk/base/content/browser-media.js b/application/basilisk/base/content/browser-media.js
- index 775fc4de5..b2af8a00f 100644
- --- a/application/basilisk/base/content/browser-media.js
- +++ b/application/basilisk/base/content/browser-media.js
- @@ -185,12 +185,6 @@ XPCOMUtils.defineLazyGetter(gEMEHandler, "_brandShortName", function() {
- return document.getElementById("bundle_brand").getString("brandShortName");
- });
- -const TELEMETRY_DDSTAT_SHOWN = 0;
- -const TELEMETRY_DDSTAT_SHOWN_FIRST = 1;
- -const TELEMETRY_DDSTAT_CLICKED = 2;
- -const TELEMETRY_DDSTAT_CLICKED_FIRST = 3;
- -const TELEMETRY_DDSTAT_SOLVED = 4;
- -
- let gDecoderDoctorHandler = {
- getLabelForNotificationBox(type) {
- if (type == "platform-decoder-not-found") {
- @@ -264,8 +258,6 @@ let gDecoderDoctorHandler = {
- // (Writing prefs from e10s content is now allowed.)
- let formatsPref = "media.decoder-doctor." + decoderDoctorReportId + ".formats";
- let buttonClickedPref = "media.decoder-doctor." + decoderDoctorReportId + ".button-clicked";
- - let histogram =
- - Services.telemetry.getKeyedHistogramById("DECODER_DOCTOR_INFOBAR_STATS");
- let formatsInPref = Services.prefs.getPrefType(formatsPref) &&
- Services.prefs.getCharPref(formatsPref);
- @@ -275,10 +267,7 @@ let gDecoderDoctorHandler = {
- Cu.reportError("Malformed Decoder Doctor unsolved message with no formats");
- return;
- }
- - if (!formatsInPref) {
- - Services.prefs.setCharPref(formatsPref, formats);
- - histogram.add(decoderDoctorReportId, TELEMETRY_DDSTAT_SHOWN_FIRST);
- - } else {
- + if (formatsInPref) {
- // Split existing formats into an array of strings.
- let existing = formatsInPref.split(",").map(String.trim);
- // Keep given formats that were not already recorded.
- @@ -290,7 +279,6 @@ let gDecoderDoctorHandler = {
- existing.concat(newbies).join(", "));
- }
- }
- - histogram.add(decoderDoctorReportId, TELEMETRY_DDSTAT_SHOWN);
- let buttons = [];
- let sumo = gDecoderDoctorHandler.getSumoForLearnHowButton(type);
- @@ -303,9 +291,7 @@ let gDecoderDoctorHandler = {
- Services.prefs.getBoolPref(buttonClickedPref);
- if (!clickedInPref) {
- Services.prefs.setBoolPref(buttonClickedPref, true);
- - histogram.add(decoderDoctorReportId, TELEMETRY_DDSTAT_CLICKED_FIRST);
- }
- - histogram.add(decoderDoctorReportId, TELEMETRY_DDSTAT_CLICKED);
- let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
- openUILinkIn(baseURL + sumo, "tab");
- @@ -322,10 +308,9 @@ let gDecoderDoctorHandler = {
- );
- } else if (formatsInPref) {
- // Issue is solved, and prefs haven't been cleared yet, meaning it's the
- - // first time we get this resolution -> Clear prefs and report telemetry.
- + // first time we get this resolution -> Clear prefs.
- Services.prefs.clearUserPref(formatsPref);
- Services.prefs.clearUserPref(buttonClickedPref);
- - histogram.add(decoderDoctorReportId, TELEMETRY_DDSTAT_SOLVED);
- }
- },
- }
- diff --git a/application/basilisk/base/content/browser-plugins.js b/application/basilisk/base/content/browser-plugins.js
- index c1bc65860..5b043d17d 100644
- --- a/application/basilisk/base/content/browser-plugins.js
- +++ b/application/basilisk/base/content/browser-plugins.js
- @@ -111,18 +111,7 @@ var gPluginHandler = {
- },
- _clickToPlayNotificationEventCallback: function PH_ctpEventCallback(event) {
- - if (event == "showing") {
- - Services.telemetry.getHistogramById("PLUGINS_NOTIFICATION_SHOWN")
- - .add(!this.options.primaryPlugin);
- - // Histograms always start at 0, even though our data starts at 1
- - let histogramCount = this.options.pluginData.size - 1;
- - if (histogramCount > 4) {
- - histogramCount = 4;
- - }
- - Services.telemetry.getHistogramById("PLUGINS_NOTIFICATION_PLUGIN_COUNT")
- - .add(histogramCount);
- - }
- - else if (event == "dismissed") {
- + if (event == "dismissed") {
- // Once the popup is dismissed, clicking the icon should show the full
- // list again
- this.options.primaryPlugin = null;
- @@ -138,8 +127,6 @@ var gPluginHandler = {
- let permission;
- let expireType;
- let expireTime;
- - let histogram =
- - Services.telemetry.getHistogramById("PLUGINS_NOTIFICATION_USER_ACTION");
- // Update the permission manager.
- // Also update the current state of pluginInfo.fallbackType so that
- @@ -149,7 +136,6 @@ var gPluginHandler = {
- permission = Ci.nsIPermissionManager.ALLOW_ACTION;
- expireType = Ci.nsIPermissionManager.EXPIRE_SESSION;
- expireTime = Date.now() + Services.prefs.getIntPref(this.PREF_SESSION_PERSIST_MINUTES) * 60 * 1000;
- - histogram.add(0);
- aPluginInfo.fallbackType = Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE;
- break;
- @@ -158,7 +144,6 @@ var gPluginHandler = {
- expireType = Ci.nsIPermissionManager.EXPIRE_TIME;
- expireTime = Date.now() +
- Services.prefs.getIntPref(this.PREF_PERSISTENT_DAYS) * 24 * 60 * 60 * 1000;
- - histogram.add(1);
- aPluginInfo.fallbackType = Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE;
- break;
- @@ -166,7 +151,6 @@ var gPluginHandler = {
- permission = Ci.nsIPermissionManager.PROMPT_ACTION;
- expireType = Ci.nsIPermissionManager.EXPIRE_NEVER;
- expireTime = 0;
- - histogram.add(2);
- switch (aPluginInfo.blocklistState) {
- case Ci.nsIBlocklistService.STATE_VULNERABLE_UPDATE_AVAILABLE:
- aPluginInfo.fallbackType = Ci.nsIObjectLoadingContent.PLUGIN_VULNERABLE_UPDATABLE;
- @@ -347,9 +331,6 @@ var gPluginHandler = {
- return;
- }
- - Services.telemetry.getHistogramById("PLUGINS_INFOBAR_SHOWN").
- - add(true);
- -
- let message;
- // Icons set directly cannot be manipulated using moz-image-region, so
- // we use CSS classes instead.
- @@ -386,9 +367,6 @@ var gPluginHandler = {
- label: gNavigatorBundle.getString("pluginContinueBlocking.label"),
- accessKey: gNavigatorBundle.getString("pluginContinueBlocking.accesskey"),
- callback: function() {
- - Services.telemetry.getHistogramById("PLUGINS_INFOBAR_BLOCK").
- - add(true);
- -
- Services.perms.addFromPrincipal(principal,
- "plugin-hidden-notification",
- Services.perms.DENY_ACTION);
- @@ -398,9 +376,6 @@ var gPluginHandler = {
- label: gNavigatorBundle.getString("pluginActivateTrigger.label"),
- accessKey: gNavigatorBundle.getString("pluginActivateTrigger.accesskey"),
- callback: function() {
- - Services.telemetry.getHistogramById("PLUGINS_INFOBAR_ALLOW").
- - add(true);
- -
- let curNotification =
- PopupNotifications.getNotification("click-to-play-plugins",
- browser);
- diff --git a/application/basilisk/base/content/browser-trackingprotection.js b/application/basilisk/base/content/browser-trackingprotection.js
- index 20917a083..2b887ecbf 100644
- --- a/application/basilisk/base/content/browser-trackingprotection.js
- +++ b/application/basilisk/base/content/browser-trackingprotection.js
- @@ -28,9 +28,6 @@ var TrackingProtection = {
- gNavigatorBundle.getString("trackingProtection.icon.activeTooltip");
- this.disabledTooltipText =
- gNavigatorBundle.getString("trackingProtection.icon.disabledTooltip");
- -
- - this.enabledHistogramAdd(this.enabledGlobally);
- - this.disabledPBMHistogramAdd(!this.enabledInPrivateWindows);
- },
- uninit() {
- @@ -56,34 +53,6 @@ var TrackingProtection = {
- this.container.hidden = !this.enabled;
- },
- - enabledHistogramAdd(value) {
- - if (PrivateBrowsingUtils.isWindowPrivate(window)) {
- - return;
- - }
- - Services.telemetry.getHistogramById("TRACKING_PROTECTION_ENABLED").add(value);
- - },
- -
- - disabledPBMHistogramAdd(value) {
- - if (PrivateBrowsingUtils.isWindowPrivate(window)) {
- - return;
- - }
- - Services.telemetry.getHistogramById("TRACKING_PROTECTION_PBM_DISABLED").add(value);
- - },
- -
- - eventsHistogramAdd(value) {
- - if (PrivateBrowsingUtils.isWindowPrivate(window)) {
- - return;
- - }
- - Services.telemetry.getHistogramById("TRACKING_PROTECTION_EVENTS").add(value);
- - },
- -
- - shieldHistogramAdd(value) {
- - if (PrivateBrowsingUtils.isWindowPrivate(window)) {
- - return;
- - }
- - Services.telemetry.getHistogramById("TRACKING_PROTECTION_SHIELD").add(value);
- - },
- -
- onSecurityChange(state, isSimulated) {
- if (!this.enabled) {
- return;
- @@ -104,25 +73,16 @@ var TrackingProtection = {
- this.icon.setAttribute("tooltiptext", this.activeTooltipText);
- this.icon.setAttribute("state", "blocked-tracking-content");
- this.content.setAttribute("state", "blocked-tracking-content");
- -
- - this.shieldHistogramAdd(2);
- } else if (isAllowing) {
- this.icon.setAttribute("tooltiptext", this.disabledTooltipText);
- this.icon.setAttribute("state", "loaded-tracking-content");
- this.content.setAttribute("state", "loaded-tracking-content");
- -
- - this.shieldHistogramAdd(1);
- } else {
- this.icon.removeAttribute("tooltiptext");
- this.icon.removeAttribute("state");
- this.content.removeAttribute("state");
- -
- - // We didn't show the shield
- - this.shieldHistogramAdd(0);
- }
- - // Telemetry for state change.
- - this.eventsHistogramAdd(0);
- },
- disableForCurrentPage() {
- @@ -143,9 +103,6 @@ var TrackingProtection = {
- "trackingprotection", Services.perms.ALLOW_ACTION);
- }
- - // Telemetry for disable protection.
- - this.eventsHistogramAdd(1);
- -
- // Hide the control center.
- document.getElementById("identity-popup").hidePopup();
- @@ -166,9 +123,6 @@ var TrackingProtection = {
- Services.perms.remove(normalizedUrl, "trackingprotection");
- }
- - // Telemetry for enable protection.
- - this.eventsHistogramAdd(2);
- -
- // Hide the control center.
- document.getElementById("identity-popup").hidePopup();
- diff --git a/application/basilisk/base/content/newtab/page.js b/application/basilisk/base/content/newtab/page.js
- index 7c19a9827..af56aad73 100644
- --- a/application/basilisk/base/content/newtab/page.js
- +++ b/application/basilisk/base/content/newtab/page.js
- @@ -157,13 +157,6 @@ var gPage = {
- }
- },
- - /**
- - * Handles unload event
- - */
- - _handleUnloadEvent: function Page_handleUnloadEvent() {
- - gAllPages.unregister(this);
- - },
- -
- /**
- * Handles all page events.
- */
- @@ -173,7 +166,7 @@ var gPage = {
- this.onPageVisibleAndLoaded();
- break;
- case "unload":
- - this._handleUnloadEvent();
- + gAllPages.unregister(this);
- break;
- case "click":
- let {button, target} = aEvent;
- @@ -213,8 +206,6 @@ var gPage = {
- },
- onPageFirstVisible: function () {
- - // Record another page impression.
- - Services.telemetry.getHistogramById("NEWTAB_PAGE_SHOWN").add(true);
- for (let site of gGrid.sites) {
- if (site) {
- @@ -225,9 +216,6 @@ var gPage = {
- }
- }
- - // save timestamp to compute page life-span delta
- - this._firstVisibleTime = Date.now();
- -
- if (document.readyState == "complete") {
- this.onPageVisibleAndLoaded();
- } else {
- diff --git a/application/basilisk/base/content/newtab/sites.js b/application/basilisk/base/content/newtab/sites.js
- index 00f81869a..4c5ef0294 100644
- --- a/application/basilisk/base/content/newtab/sites.js
- +++ b/application/basilisk/base/content/newtab/sites.js
- @@ -254,6 +254,10 @@ Site.prototype = {
- this._node.addEventListener("dragstart", this, false);
- this._node.addEventListener("dragend", this, false);
- this._node.addEventListener("mouseover", this, false);
- +
- + let controls = this.node.querySelectorAll(".newtab-control");
- + for (let i = 0; i < controls.length; i++)
- + controls[i].addEventListener("click", this, false);
- },
- /**
- @@ -269,21 +273,6 @@ Site.prototype = {
- } catch (e) {}
- },
- - /**
- - * Record interaction with site using telemetry.
- - */
- - _recordSiteClicked: function Site_recordSiteClicked(aIndex) {
- - if (Services.prefs.prefHasUserValue("browser.newtabpage.rows") ||
- - Services.prefs.prefHasUserValue("browser.newtabpage.columns") ||
- - aIndex > 8) {
- - // We only want to get indices for the default configuration, everything
- - // else goes in the same bucket.
- - aIndex = 9;
- - }
- - Services.telemetry.getHistogramById("NEWTAB_PAGE_SITE_CLICKED")
- - .add(aIndex);
- - },
- -
- /**
- * Handles site click events.
- */
- @@ -328,6 +317,15 @@ Site.prototype = {
- */
- handleEvent: function Site_handleEvent(aEvent) {
- switch (aEvent.type) {
- + case "click":
- + aEvent.preventDefault();
- + if (aEvent.target.classList.contains("newtab-control-block"))
- + this.block();
- + else if (this.isPinned())
- + this.unpin();
- + else
- + this.pin();
- + break;
- case "mouseover":
- this._node.removeEventListener("mouseover", this, false);
- this._speculativeConnect();
- diff --git a/application/basilisk/base/content/tabbrowser.xml b/application/basilisk/base/content/tabbrowser.xml
- index df83f677f..e14342cf3 100644
- --- a/application/basilisk/base/content/tabbrowser.xml
- +++ b/application/basilisk/base/content/tabbrowser.xml
- @@ -1109,8 +1109,6 @@
- }
- if (!this._previewMode) {
- - this._recordTabAccess(this.mCurrentTab);
- -
- this.mCurrentTab.updateLastAccessed();
- this.mCurrentTab.removeAttribute("unread");
- oldTab.updateLastAccessed();
- @@ -1300,45 +1298,6 @@
- ]]></body>
- </method>
- - <!--
- - This function assumes we have an LRU cache of tabs (either
- - images of tab content or their layers). The goal is to find
- - out how far into the cache we need to look in order to find
- - aTab. We record this number in telemetry and also move aTab to
- - the front of the cache.
- -
- - A newly created tab has position Infinity in the cache.
- - If a tab is closed, it has no effect on the position of other
- - tabs in the cache since we assume that closing a tab doesn't
- - cause us to load in any other tabs.
- -
- - We ignore the effect of dragging tabs between windows.
- - -->
- - <method name="_recordTabAccess">
- - <parameter name="aTab"/>
- - <body><![CDATA[
- - if (!Services.telemetry.canRecordExtended) {
- - return;
- - }
- -
- - let tabs = Array.from(this.visibleTabs);
- -
- - let pos = aTab.cachePosition;
- - for (let i = 0; i < tabs.length; i++) {
- - // If aTab is moving to the front, everything that was
- - // previously in front of it is bumped up one position.
- - if (tabs[i].cachePosition < pos) {
- - tabs[i].cachePosition++;
- - }
- - }
- - aTab.cachePosition = 0;
- -
- - if (isFinite(pos)) {
- - Services.telemetry.getHistogramById("TAB_SWITCH_CACHE_POSITION").add(pos);
- - }
- - ]]></body>
- - </method>
- -
- <method name="_tabAttrModified">
- <parameter name="aTab"/>
- <parameter name="aChanged"/>
- @@ -2243,8 +2202,6 @@
- if (animate) {
- requestAnimationFrame(function () {
- - this.tabContainer._handleTabTelemetryStart(t, aURI);
- -
- // kick the animation off
- t.setAttribute("fadein", "true");
- }.bind(this));
- @@ -2428,8 +2385,6 @@
- return;
- }
- - this.tabContainer._handleTabTelemetryStart(aTab);
- -
- this._blurTab(aTab);
- aTab.style.maxWidth = ""; // ensure that fade-out transition happens
- aTab.removeAttribute("fadein");
- @@ -4069,7 +4024,7 @@
- },
- /*
- - * Telemetry and Profiler related helpers for recording tab switch
- + * Profiler related helpers for recording tab switch
- * timing.
- */
- @@ -4697,7 +4652,6 @@
- this.mCurrentTab.permanentKey = this.mCurrentBrowser.permanentKey;
- this.mCurrentTab._tPos = 0;
- this.mCurrentTab._fullyOpen = true;
- - this.mCurrentTab.cachePosition = 0;
- this.mCurrentTab.linkedBrowser = this.mCurrentBrowser;
- this.mCurrentTab.hasBrowser = true;
- this._tabForBrowser.set(this.mCurrentBrowser, this.mCurrentTab);
- @@ -5846,81 +5800,6 @@
- </body>
- </method>
- - <method name="_handleTabTelemetryStart">
- - <parameter name="aTab"/>
- - <parameter name="aURI"/>
- - <body>
- - <![CDATA[
- - // Animation-smoothness telemetry/logging
- - if (Services.telemetry.canRecordExtended || this._tabAnimationLoggingEnabled) {
- - if (aURI == "about:newtab" && (aTab._tPos == 1 || aTab._tPos == 2)) {
- - // Indicate newtab page animation where other tabs are unaffected
- - // (for which case, the 2nd or 3rd tabs are good representatives, even if not absolute)
- - aTab._recordingTabOpenPlain = true;
- - }
- - aTab._recordingHandle = window.QueryInterface(Ci.nsIInterfaceRequestor)
- - .getInterface(Ci.nsIDOMWindowUtils)
- - .startFrameTimeRecording();
- - }
- -
- - // Overall animation duration
- - aTab._animStartTime = Date.now();
- - ]]>
- - </body>
- - </method>
- -
- - <method name="_handleTabTelemetryEnd">
- - <parameter name="aTab"/>
- - <body>
- - <![CDATA[
- - if (!aTab._animStartTime) {
- - return;
- - }
- -
- - aTab._animStartTime = 0;
- -
- - // Handle tab animation smoothness telemetry/logging of frame intervals and paint times
- - if (!("_recordingHandle" in aTab)) {
- - return;
- - }
- -
- - let intervals = window.QueryInterface(Ci.nsIInterfaceRequestor)
- - .getInterface(Ci.nsIDOMWindowUtils)
- - .stopFrameTimeRecording(aTab._recordingHandle);
- - delete aTab._recordingHandle;
- - let frameCount = intervals.length;
- -
- - if (this._tabAnimationLoggingEnabled) {
- - let msg = "Tab " + (aTab.closing ? "close" : "open") + " (Frame-interval):\n";
- - for (let i = 0; i < frameCount; i++) {
- - msg += Math.round(intervals[i]) + "\n";
- - }
- - Services.console.logStringMessage(msg);
- - }
- -
- - // For telemetry, the first frame interval is not useful since it may represent an interval
- - // to a relatively old frame (prior to recording start). So we'll ignore it for the average.
- - if (frameCount > 1) {
- - let averageInterval = 0;
- - for (let i = 1; i < frameCount; i++) {
- - averageInterval += intervals[i];
- - }
- - averageInterval = averageInterval / (frameCount - 1);
- -
- - Services.telemetry.getHistogramById("FX_TAB_ANIM_ANY_FRAME_INTERVAL_MS").add(averageInterval);
- -
- - if (aTab._recordingTabOpenPlain) {
- - delete aTab._recordingTabOpenPlain;
- - // While we do have a telemetry probe NEWTAB_PAGE_ENABLED to monitor newtab preview, it'll be
- - // easier to overview the data without slicing by it. Hence the additional histograms with _PREVIEW.
- - let preview = this._browserNewtabpageEnabled ? "_PREVIEW" : "";
- - Services.telemetry.getHistogramById("FX_TAB_ANIM_OPEN" + preview + "_FRAME_INTERVAL_MS").add(averageInterval);
- - }
- - }
- - ]]>
- - </body>
- - </method>
- -
- <!-- Deprecated stuff, implemented for backwards compatibility. -->
- <property name="mAllTabsPopup" readonly="true"
- onget="return document.getElementById('alltabs-popup');"/>
- @@ -5935,8 +5814,6 @@
- var tab = event.target;
- - this._handleTabTelemetryEnd(tab);
- -
- if (tab.getAttribute("fadein") == "true") {
- if (tab._fullyOpen)
- this.adjustTabstrip();
- @@ -6610,8 +6487,6 @@
- ]]></body>
- </method>
- - <field name="cachePosition">Infinity</field>
- -
- <field name="mOverCloseButton">false</field>
- <property name="_overPlayingIcon" readonly="true">
- <getter><![CDATA[
- diff --git a/application/basilisk/components/migration/AutoMigrate.jsm b/application/basilisk/components/migration/AutoMigrate.jsm
- index 003f70d70..856805798 100644
- --- a/application/basilisk/components/migration/AutoMigrate.jsm
- +++ b/application/basilisk/components/migration/AutoMigrate.jsm
- @@ -93,29 +93,21 @@ const AutoMigrate = {
- * failed for some reason.
- */
- migrate(profileStartup, migratorKey, profileToMigrate) {
- - let histogram = Services.telemetry.getHistogramById(
- - "FX_STARTUP_MIGRATION_AUTOMATED_IMPORT_PROCESS_SUCCESS");
- - histogram.add(0);
- let {migrator, pickedKey} = this.pickMigrator(migratorKey);
- - histogram.add(5);
- profileToMigrate = this.pickProfile(migrator, profileToMigrate);
- - histogram.add(10);
- let resourceTypes = migrator.getMigrateData(profileToMigrate, profileStartup);
- if (!(resourceTypes & this.resourceTypesToUse)) {
- throw new Error("No usable resources were found for the selected browser!");
- }
- - histogram.add(15);
- let sawErrors = false;
- let migrationObserver = (subject, topic) => {
- 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");
- @@ -132,7 +124,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 +200,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 +236,6 @@ const AutoMigrate = {
- }, true);
- this._purgeUndoState(this.UNDO_REMOVED_REASON_UNDO_USED);
- - histogram.add(30);
- }),
- _removeNotificationBars() {
- @@ -288,10 +263,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 +338,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 2714cdbcd..8f786e463 100644
- --- a/application/basilisk/components/migration/FirefoxProfileMigrator.js
- +++ b/application/basilisk/components/migration/FirefoxProfileMigrator.js
- @@ -170,77 +170,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 ccae006fe..db5a02637 100644
- --- a/application/basilisk/components/migration/MigrationUtils.jsm
- +++ b/application/basilisk/components/migration/MigrationUtils.jsm
- @@ -262,30 +262,9 @@ this.MigratorPrototype = {
- return {responsivenessMonitor, responsivenessHistogramId};
- };
- - let maybeFinishResponsivenessMonitor = (responsivenessMonitor, histogramId) => {
- + let maybeFinishResponsivenessMonitor = (responsivenessMonitor) => {
- 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);
- - }
- }
- };
- @@ -306,9 +285,6 @@ this.MigratorPrototype = {
- Services.obs.notifyObservers(null, aMsg, aItemType);
- };
- - for (let resourceType of Object.keys(MigrationUtils._importQuantities)) {
- - MigrationUtils._importQuantities[resourceType] = 0;
- - }
- notify("Migration:Started");
- for (let [migrationType, itemResources] of resourcesGroupedByItems) {
- notify("Migration:ItemBeforeMigrate", migrationType);
- @@ -331,7 +307,6 @@ this.MigratorPrototype = {
- maybeFinishResponsivenessMonitor(responsivenessMonitor, responsivenessHistogramId);
- if (resourcesGroupedByItems.size == 0) {
- - collectQuantityTelemetry();
- notify("Migration:Ended");
- }
- }
- @@ -960,14 +935,7 @@ this.MigrationUtils = Object.freeze({
- this.showMigrationWizard(null, params);
- },
- - _importQuantities: {
- - bookmarks: 0,
- - logins: 0,
- - history: 0,
- - },
- -
- insertBookmarkWrapper(bookmark) {
- - this._importQuantities.bookmarks++;
- let insertionPromise = PlacesUtils.bookmarks.insert(bookmark);
- if (!gKeepUndoData) {
- return insertionPromise;
- @@ -985,7 +953,6 @@ this.MigrationUtils = Object.freeze({
- },
- insertVisitsWrapper(places, options) {
- - this._importQuantities.history += places.length;
- if (gKeepUndoData) {
- this._updateHistoryUndo(places);
- }
- @@ -993,7 +960,6 @@ this.MigrationUtils = Object.freeze({
- },
- insertLoginWrapper(login) {
- - this._importQuantities.logins++;
- let insertedLogin = LoginHelper.maybeImportLogin(login);
- // Note that this means that if we import a login that has a newer password
- // than we know about, we will update the login, and an undo of the import
- @@ -1096,7 +1062,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 eb2175628..50c187c87 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;
- }
- @@ -360,27 +345,12 @@ var MigrationWizard = { /* exported MigrationWizard */
- this._itemsFlags = this._migrator.getMigrateData(this._selectedProfile, this._autoMigrate);
- this._listItems("migratingItems");
- - setTimeout(() => this.onMigratingMigrate(), 0);
- + setTimeout(this.onMigratingMigrate, 0, this);
- },
- - onMigratingMigrate: function ()
- + onMigratingMigrate: function (aOuter)
- {
- - 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++;
- - }
- - }
- + aOuter._migrator.migrate(aOuter._itemsFlags, aOuter._autoMigrate, aOuter._selectedProfile);
- },
- _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;
- }
- },
- @@ -520,30 +478,4 @@ var MigrationWizard = { /* exported MigrationWizard */
- this._wiz.canRewind = false;
- 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 d65e52594..93851f84a 100644
- --- a/application/basilisk/components/nsBrowserContentHandler.js
- +++ b/application/basilisk/components/nsBrowserContentHandler.js
- @@ -235,17 +235,8 @@ function openPreferences() {
- args);
- }
- -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) {
- - var engine = Services.search.defaultEngine;
- - logSystemBasedSearch(engine);
- -
- - var submission = engine.getSubmission(searchTerm, null, "system");
- + var submission = ss.defaultEngine.getSubmission(searchTerm, null, "system");
- // fill our nsIMutableArray with uri-as-wstring, null, null, postData
- var args = Components.classes["@mozilla.org/array;1"]
- @@ -688,18 +679,6 @@ nsDefaultCommandLineHandler.prototype = {
- /* nsICommandLineHandler */
- handle : function dch_handle(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/places/content/browserPlacesViews.js b/application/basilisk/components/places/content/browserPlacesViews.js
- index c6ee9b6ce..bab882561 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/preferences/in-content/advanced.js b/application/basilisk/components/preferences/in-content/advanced.js
- index 850f0e09f..da6ce30db 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,66 +232,6 @@ 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() {
- if (AppConstants.platform == "win") {
- let minVersion = Services.prefs.getBoolPref("ui.osk.require_win10") ? 10 : 6.2;
- diff --git a/application/basilisk/components/preferences/in-content/advanced.xul b/application/basilisk/components/preferences/in-content/advanced.xul
- index 50e276501..b428ed7e0 100644
- --- a/application/basilisk/components/preferences/in-content/advanced.xul
- +++ b/application/basilisk/components/preferences/in-content/advanced.xul
- @@ -48,12 +48,6 @@
- name="layout.spellcheckDefault"
- type="int"/>
- -#ifdef MOZ_TELEMETRY_REPORTING
- - <preference id="toolkit.telemetry.enabled"
- - name="toolkit.telemetry.enabled"
- - type="bool"/>
- -#endif
- -
- <!-- Network tab -->
- <preference id="browser.cache.disk.capacity"
- name="browser.cache.disk.capacity"
- @@ -186,42 +180,6 @@
- preference="layout.spellcheckDefault"/>
- </groupbox>
- </tabpanel>
- -#ifdef MOZ_DATA_REPORTING
- - <!-- Data Choices -->
- - <tabpanel id="dataChoicesPanel" orient="vertical">
- -#ifdef MOZ_TELEMETRY_REPORTING
- - <groupbox>
- - <caption>
- - <checkbox id="submitHealthReportBox" label="&enableHealthReport.label;"
- - accesskey="&enableHealthReport.accesskey;"/>
- - </caption>
- - <vbox>
- - <hbox class="indent">
- - <label flex="1">&healthReportDesc.label;</label>
- - <spacer flex="10"/>
- - <label id="FHRLearnMore"
- - class="text-link">&healthReportLearnMore.label;</label>
- - </hbox>
- - <hbox class="indent">
- - <groupbox flex="1">
- - <caption>
- - <checkbox id="submitTelemetryBox" preference="toolkit.telemetry.enabled"
- - label="&enableTelemetryData.label;"
- - accesskey="&enableTelemetryData.accesskey;"/>
- - </caption>
- - <hbox class="indent">
- - <label id="telemetryDataDesc" flex="1">&telemetryDesc.label;</label>
- - <spacer flex="10"/>
- - <label id="telemetryLearnMore"
- - class="text-link">&telemetryLearnMore.label;</label>
- - </hbox>
- - </groupbox>
- - </hbox>
- - </vbox>
- - </groupbox>
- -#endif
- - </tabpanel>
- -#endif
- <!-- Network -->
- <tabpanel id="networkPanel" orient="vertical">
- diff --git a/application/basilisk/components/preferences/in-content/content.js b/application/basilisk/components/preferences/in-content/content.js
- index 2eac10ca4..80f058aeb 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 69cb180d5..f6a6941ce 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 b541d41da..cfbddf945 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);
- };
- @@ -57,20 +48,9 @@ function doSearch() {
- win.openUILinkIn(submission.uri.spec, "current", false, submission.postData);
- }
- -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 +60,5 @@ 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 b4db31dee..aaa719ec5 100644
- --- a/application/basilisk/components/search/service/nsSearchService.js
- +++ b/application/basilisk/components/search/service/nsSearchService.js
- @@ -2309,8 +2309,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");
- },
- @@ -2348,8 +2346,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");
- }),
- @@ -2715,7 +2711,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);
- @@ -3892,25 +3887,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/sessionstore/SessionWorker.js b/application/basilisk/components/sessionstore/SessionWorker.js
- index 7d802a7df..1297a115c 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 d1b77a237..361602bc4 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 858e35750..4fc160ed2 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
- @@ -797,42 +796,8 @@ var MessageQueue = {
- let flushID = (options && options.flushID) || 0;
- - 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")) {
- - 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,
- - 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
- - });
- }
- - },
- };
- EventListener.init();
- diff --git a/application/basilisk/components/sessionstore/nsSessionStartup.js b/application/basilisk/components/sessionstore/nsSessionStartup.js
- index 9cda1552e..c7bb3384c 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/extensions/pdfjs/content/PdfJsTelemetry.jsm b/application/basilisk/extensions/pdfjs/content/PdfJsTelemetry.jsm
- deleted file mode 100644
- index 275da9d87..000000000
- --- a/application/basilisk/extensions/pdfjs/content/PdfJsTelemetry.jsm
- +++ /dev/null
- @@ -1,70 +0,0 @@
- -/* Copyright 2013 Mozilla Foundation
- - *
- - * Licensed under the Apache License, Version 2.0 (the "License");
- - * you may not use this file except in compliance with the License.
- - * You may obtain a copy of the License at
- - *
- - * http://www.apache.org/licenses/LICENSE-2.0
- - *
- - * Unless required by applicable law or agreed to in writing, software
- - * distributed under the License is distributed on an "AS IS" BASIS,
- - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- - * See the License for the specific language governing permissions and
- - * limitations under the License.
- - */
- -/* jshint esnext:true, maxlen: 100 */
- -/* globals Components, Services */
- -
- -'use strict';
- -
- -this.EXPORTED_SYMBOLS = ['PdfJsTelemetry'];
- -
- -const Cu = Components.utils;
- -Cu.import('resource://gre/modules/Services.jsm');
- -
- -this.PdfJsTelemetry = {
- - onViewerIsUsed: function () {
- - let histogram = Services.telemetry.getHistogramById('PDF_VIEWER_USED');
- - histogram.add(true);
- - },
- - onFallback: function () {
- - let histogram = Services.telemetry.getHistogramById('PDF_VIEWER_FALLBACK_SHOWN');
- - histogram.add(true);
- - },
- - onDocumentSize: function (size) {
- - let histogram = Services.telemetry.getHistogramById('PDF_VIEWER_DOCUMENT_SIZE_KB');
- - histogram.add(size / 1024);
- - },
- - onDocumentVersion: function (versionId) {
- - let histogram = Services.telemetry.getHistogramById('PDF_VIEWER_DOCUMENT_VERSION');
- - histogram.add(versionId);
- - },
- - onDocumentGenerator: function (generatorId) {
- - let histogram = Services.telemetry.getHistogramById('PDF_VIEWER_DOCUMENT_GENERATOR');
- - histogram.add(generatorId);
- - },
- - onEmbed: function (isObject) {
- - let histogram = Services.telemetry.getHistogramById('PDF_VIEWER_EMBED');
- - histogram.add(isObject);
- - },
- - onFontType: function (fontTypeId) {
- - let histogram = Services.telemetry.getHistogramById('PDF_VIEWER_FONT_TYPES');
- - histogram.add(fontTypeId);
- - },
- - onForm: function (isAcroform) {
- - let histogram = Services.telemetry.getHistogramById('PDF_VIEWER_FORM');
- - histogram.add(isAcroform);
- - },
- - onPrint: function () {
- - let histogram = Services.telemetry.getHistogramById('PDF_VIEWER_PRINT');
- - histogram.add(true);
- - },
- - onStreamType: function (streamTypeId) {
- - let histogram = Services.telemetry.getHistogramById('PDF_VIEWER_STREAM_TYPES');
- - histogram.add(streamTypeId);
- - },
- - onTimeToView: function (ms) {
- - let histogram = Services.telemetry.getHistogramById('PDF_VIEWER_TIME_TO_VIEW_MS');
- - histogram.add(ms);
- - }
- -};
- diff --git a/application/basilisk/extensions/pdfjs/content/PdfStreamConverter.jsm b/application/basilisk/extensions/pdfjs/content/PdfStreamConverter.jsm
- index b5b21f214..d4a0f051f 100644
- --- a/application/basilisk/extensions/pdfjs/content/PdfStreamConverter.jsm
- +++ b/application/basilisk/extensions/pdfjs/content/PdfStreamConverter.jsm
- @@ -14,7 +14,7 @@
- */
- /* jshint esnext:true */
- /* globals Components, Services, XPCOMUtils, NetUtil, PrivateBrowsingUtils,
- - dump, NetworkManager, PdfJsTelemetry, PdfjsContentUtils */
- + dump, NetworkManager, PdfjsContentUtils */
- 'use strict';
- @@ -44,9 +44,6 @@ XPCOMUtils.defineLazyModuleGetter(this, 'NetworkManager',
- XPCOMUtils.defineLazyModuleGetter(this, 'PrivateBrowsingUtils',
- 'resource://gre/modules/PrivateBrowsingUtils.jsm');
- -XPCOMUtils.defineLazyModuleGetter(this, 'PdfJsTelemetry',
- - 'resource://pdf.js/PdfJsTelemetry.jsm');
- -
- XPCOMUtils.defineLazyModuleGetter(this, 'PdfjsContentUtils',
- 'resource://pdf.js/PdfjsContentUtils.jsm');
- @@ -214,13 +211,6 @@ PdfDataListener.prototype = {
- function ChromeActions(domWindow, contentDispositionFilename) {
- this.domWindow = domWindow;
- this.contentDispositionFilename = contentDispositionFilename;
- - this.telemetryState = {
- - documentInfo: false,
- - firstPageInfo: false,
- - streamTypesUsed: [],
- - fontTypesUsed: [],
- - startAt: Date.now()
- - };
- }
- ChromeActions.prototype = {
- @@ -356,62 +346,6 @@ ChromeActions.prototype = {
- metaKey: Services.prefs.getIntPref('mousewheel.with_meta.action', 1) === 3,
- };
- },
- - reportTelemetry: function (data) {
- - var probeInfo = JSON.parse(data);
- - switch (probeInfo.type) {
- - case 'documentInfo':
- - if (!this.telemetryState.documentInfo) {
- - PdfJsTelemetry.onDocumentVersion(probeInfo.version | 0);
- - PdfJsTelemetry.onDocumentGenerator(probeInfo.generator | 0);
- - if (probeInfo.formType) {
- - PdfJsTelemetry.onForm(probeInfo.formType === 'acroform');
- - }
- - this.telemetryState.documentInfo = true;
- - }
- - break;
- - case 'pageInfo':
- - if (!this.telemetryState.firstPageInfo) {
- - var duration = Date.now() - this.telemetryState.startAt;
- - PdfJsTelemetry.onTimeToView(duration);
- - this.telemetryState.firstPageInfo = true;
- - }
- - break;
- - case 'documentStats':
- - // documentStats can be called several times for one documents.
- - // if stream/font types are reported, trying not to submit the same
- - // enumeration value multiple times.
- - var documentStats = probeInfo.stats;
- - if (!documentStats || typeof documentStats !== 'object') {
- - break;
- - }
- - var i, streamTypes = documentStats.streamTypes;
- - if (Array.isArray(streamTypes)) {
- - var STREAM_TYPE_ID_LIMIT = 20;
- - for (i = 0; i < STREAM_TYPE_ID_LIMIT; i++) {
- - if (streamTypes[i] &&
- - !this.telemetryState.streamTypesUsed[i]) {
- - PdfJsTelemetry.onStreamType(i);
- - this.telemetryState.streamTypesUsed[i] = true;
- - }
- - }
- - }
- - var fontTypes = documentStats.fontTypes;
- - if (Array.isArray(fontTypes)) {
- - var FONT_TYPE_ID_LIMIT = 20;
- - for (i = 0; i < FONT_TYPE_ID_LIMIT; i++) {
- - if (fontTypes[i] &&
- - !this.telemetryState.fontTypesUsed[i]) {
- - PdfJsTelemetry.onFontType(i);
- - this.telemetryState.fontTypesUsed[i] = true;
- - }
- - }
- - }
- - break;
- - case 'print':
- - PdfJsTelemetry.onPrint();
- - break;
- - }
- - },
- fallback: function(args, sendResponse) {
- var featureId = args.featureId;
- var url = args.url;
- @@ -425,7 +359,6 @@ ChromeActions.prototype = {
- } else {
- message = getLocalizedString(strings, 'unsupported_feature');
- }
- - PdfJsTelemetry.onFallback();
- PdfjsContentUtils.displayWarning(domWindow, message,
- getLocalizedString(strings, 'open_with_different_viewer'),
- getLocalizedString(strings, 'open_with_different_viewer', 'accessKey'));
- @@ -940,9 +873,6 @@ PdfStreamConverter.prototype = {
- aRequest.setResponseHeader('Refresh', '', false);
- }
- - PdfJsTelemetry.onViewerIsUsed();
- - PdfJsTelemetry.onDocumentSize(aRequest.contentLength);
- -
- // Creating storage for PDF data
- var contentLength = aRequest.contentLength;
- this.dataListener = new PdfDataListener(contentLength);
- @@ -996,7 +926,6 @@ PdfStreamConverter.prototype = {
- if (domWindow.frameElement) {
- var isObjectEmbed = domWindow.frameElement.tagName !== 'IFRAME' ||
- domWindow.frameElement.className === 'previewPluginContentFrame';
- - PdfJsTelemetry.onEmbed(isObjectEmbed);
- }
- }
- };
- diff --git a/application/basilisk/locales/en-US/chrome/browser/aboutDialog.dtd b/application/basilisk/locales/en-US/chrome/browser/aboutDialog.dtd
- index e0c34692e..1f87b6046 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 @@
- <!-- LOCALIZATION NOTE (warningDesc.version): This is a warning about the experimental nature of Nightly and Aurora builds. It is only shown in those versions. -->
- <!ENTITY warningDesc.version "&brandShortName; is experimental and may be unstable.">
- -<!-- LOCALIZATION NOTE (warningDesc.telemetryDesc): This is a notification that Nightly/Aurora builds automatically send Telemetry data back to Mozilla. It is only shown in those versions. "It" refers to brandShortName. -->
- -<!ENTITY warningDesc.telemetryDesc "It automatically sends information about performance, hardware, usage and customizations back to &vendorShortName; to help make &brandShortName; better.">
- <!-- LOCALIZATION NOTE (community.exp.*) This paragraph is shown in "experimental" builds, i.e. Nightly and Aurora builds, instead of the other "community.*" strings below. -->
- <!ENTITY community.exp.start "">
- 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 124c00d84..68250196d 100644
- --- a/application/basilisk/locales/en-US/chrome/browser/preferences/advanced.dtd
- +++ b/application/basilisk/locales/en-US/chrome/browser/preferences/advanced.dtd
- @@ -28,23 +28,6 @@
- <!ENTITY checkSpelling.label "Check my spelling as I type">
- <!ENTITY checkSpelling.accesskey "t">
- -<!ENTITY dataChoicesTab.label "Data Choices">
- -
- -<!ENTITY healthReportDesc.label "Helps you understand your browser performance and shares data with &vendorShortName; about your browser health">
- -<!ENTITY enableHealthReport.label "Enable &brandShortName; Health Report">
- -<!ENTITY enableHealthReport.accesskey "R">
- -<!ENTITY healthReportLearnMore.label "Learn More">
- -
- -<!ENTITY telemetryDesc.label "Shares performance, usage, hardware and customization data about your browser with &vendorShortName; to help us make &brandShortName; better">
- -<!ENTITY enableTelemetryData.label "Share additional data (i.e., Telemetry)">
- -<!ENTITY enableTelemetryData.accesskey "T">
- -<!ENTITY telemetryLearnMore.label "Learn More">
- -
- -<!ENTITY crashReporterDesc2.label "Crash reports help &vendorShortName; fix problems and make your browser more stable and secure">
- -<!ENTITY alwaysSubmitCrashReports.label "Allow &brandShortName; to send backlogged crash reports on your behalf">
- -<!ENTITY alwaysSubmitCrashReports.accesskey "c">
- -<!ENTITY crashReporterLearnMore.label "Learn More">
- -
- <!ENTITY networkTab.label "Network">
- <!ENTITY connection.label "Connection">
- diff --git a/application/basilisk/modules/BrowserUsageTelemetry.jsm b/application/basilisk/modules/BrowserUsageTelemetry.jsm
- deleted file mode 100644
- index 39012d2ab..000000000
- --- 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 488cc4f26..1021653b7 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);
- },
- @@ -398,15 +386,6 @@ this.TabCrashHandler = {
- this.pageListener.sendAsyncMessage("UpdateCount", {
- count: this._crashedTabCount,
- });
- -
- - 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 443cae2da..76822e803 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/PluginContent.jsm b/application/basilisk/modules/PluginContent.jsm
- index 622d608bc..f9f4b0ef6 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,49 +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) ==
- Ci.nsIObjectLoadingContent.TYPE_PLUGIN);
- diff --git a/application/basilisk/modules/ProcessHangMonitor.jsm b/application/basilisk/modules/ProcessHangMonitor.jsm
- index 80c506ac7..1e4c192d8 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 cd8f2ce62..76aea5cdf 100644
- --- a/application/basilisk/modules/moz.build
- +++ b/application/basilisk/modules/moz.build
- @@ -8,7 +8,6 @@ EXTRA_JS_MODULES += [
- 'AboutHome.jsm',
- 'AboutNewTab.jsm',
- 'AttributionCode.jsm',
- - 'BrowserUsageTelemetry.jsm',
- 'CastingApps.jsm',
- 'ContentClick.jsm',
- 'ContentCrashHandlers.jsm',
- diff --git a/application/basilisk/themes/shared/incontentprefs/preferences.inc.css b/application/basilisk/themes/shared/incontentprefs/preferences.inc.css
- index 20ea98327..173904b1c 100644
- --- a/application/basilisk/themes/shared/incontentprefs/preferences.inc.css
- +++ b/application/basilisk/themes/shared/incontentprefs/preferences.inc.css
- @@ -288,17 +288,6 @@ description > html|a {
- margin-inline-end: 4px; /* add the 4px end-margin of other elements */
- }
- -#telemetryLearnMore,
- -#FHRLearnMore,
- -#crashReporterLearnMore {
- - /* provide some margin between the links and the label text */
- - /* !important is needed to override the rules defined in common.css */
- - margin-inline-start: 20px !important;
- - /* center the links */
- - margin-top: 8px;
- - margin-bottom: 8px;
- -}
- -
- .indent {
- /* !important needed to override margin-inline-start:0 !important; rule
- define in common.css for labels */
- diff --git a/application/palemoon/base/content/tabbrowser.xml b/application/palemoon/base/content/tabbrowser.xml
- index b5edd54b7..53b9b1a2d 100644
- --- a/application/palemoon/base/content/tabbrowser.xml
- +++ b/application/palemoon/base/content/tabbrowser.xml
- @@ -1753,8 +1753,6 @@
- if (animate) {
- requestAnimationFrame(function () {
- - this.tabContainer._handleTabTelemetryStart(t, aURI);
- -
- // kick the animation off
- t.setAttribute("fadein", "true");
- @@ -1955,8 +1953,6 @@
- return;
- }
- - this.tabContainer._handleTabTelemetryStart(aTab);
- -
- this._blurTab(aTab);
- aTab.style.maxWidth = ""; // ensure that fade-out transition happens
- aTab.removeAttribute("fadein");
- @@ -4343,85 +4339,6 @@
- </body>
- </method>
- - <method name="_handleTabTelemetryStart">
- - <parameter name="aTab"/>
- - <parameter name="aURI"/>
- - <body>
- - <![CDATA[
- - // Animation-smoothness telemetry/logging
- - if (this._tabAnimationLoggingEnabled) {
- - if (aURI == "about:newtab" && (aTab._tPos == 1 || aTab._tPos == 2)) {
- - // Indicate newtab page animation where other tabs are unaffected
- - // (for which case, the 2nd or 3rd tabs are good representatives, even if not absolute)
- - aTab._recordingTabOpenPlain = true;
- - }
- - aTab._recordingHandle = window.QueryInterface(Ci.nsIInterfaceRequestor)
- - .getInterface(Ci.nsIDOMWindowUtils)
- - .startFrameTimeRecording();
- - }
- -
- - // Overall animation duration
- - aTab._animStartTime = Date.now();
- - ]]>
- - </body>
- - </method>
- -
- - <method name="_handleTabTelemetryEnd">
- - <parameter name="aTab"/>
- - <body>
- - <![CDATA[
- - if (!aTab._animStartTime) {
- - return;
- - }
- -
- - aTab._animStartTime = 0;
- -
- - // Handle tab animation smoothness telemetry/logging of frame intervals and paint times
- - if (!("_recordingHandle" in aTab)) {
- - return;
- - }
- -
- - let paints = {};
- - let intervals = window.QueryInterface(Ci.nsIInterfaceRequestor)
- - .getInterface(Ci.nsIDOMWindowUtils)
- - .stopFrameTimeRecording(aTab._recordingHandle, paints);
- - delete aTab._recordingHandle;
- - paints = paints.value; // The result array itself.
- - let frameCount = intervals.length;
- -
- - if (this._tabAnimationLoggingEnabled) {
- - let msg = "Tab " + (aTab.closing ? "close" : "open") + " (Frame-interval / paint-processing):\n";
- - for (let i = 0; i < frameCount; i++) {
- - msg += Math.round(intervals[i]) + " / " + Math.round(paints[i]) + "\n";
- - }
- - Services.console.logStringMessage(msg);
- - }
- -
- - // For telemetry, the first frame interval is not useful since it may represent an interval
- - // to a relatively old frame (prior to recording start). So we'll ignore it for the average.
- - // But if we recorded only 1 frame (very rare), then the first paint duration is a good
- - // representative of the first frame interval for our cause (indicates very bad animation).
- - // First paint duration is always useful for us.
- - if (frameCount > 0) {
- - let averageInterval = 0;
- - let averagePaint = paints[0];
- - for (let i = 1; i < frameCount; i++) {
- - averageInterval += intervals[i];
- - averagePaint += paints[i];
- - };
- - averagePaint /= frameCount;
- - averageInterval = (frameCount == 1)
- - ? averagePaint
- - : averageInterval / (frameCount - 1);
- -
- - if (aTab._recordingTabOpenPlain) {
- - delete aTab._recordingTabOpenPlain;
- - }
- - }
- - ]]>
- - </body>
- - </method>
- -
- <!-- Deprecated stuff, implemented for backwards compatibility. -->
- <property name="mTabstripClosebutton" readonly="true"
- onget="return document.getElementById('tabs-closebutton');"/>
- @@ -4438,8 +4355,6 @@
- var tab = event.target;
- - this._handleTabTelemetryEnd(tab);
- -
- if (tab.getAttribute("fadein") == "true") {
- if (tab._fullyOpen)
- this.adjustTabstrip();
- diff --git a/application/palemoon/components/newtab/page.js b/application/palemoon/components/newtab/page.js
- index 34387fd44..977d04979 100644
- --- a/application/palemoon/components/newtab/page.js
- +++ b/application/palemoon/components/newtab/page.js
- @@ -212,9 +212,6 @@ var gPage = {
- },
- onPageFirstVisible: function () {
- - // Record another page impression.
- - Services.telemetry.getHistogramById("NEWTAB_PAGE_SHOWN").add(true);
- -
- for (let site of gGrid.sites) {
- if (site) {
- // The site may need to modify and/or re-render itself if
- diff --git a/application/palemoon/components/newtab/sites.js b/application/palemoon/components/newtab/sites.js
- index cb5675238..9345f8b03 100644
- --- a/application/palemoon/components/newtab/sites.js
- +++ b/application/palemoon/components/newtab/sites.js
- @@ -269,21 +269,6 @@ Site.prototype = {
- } catch (e) {}
- },
- - /**
- - * Record interaction with site using telemetry.
- - */
- - _recordSiteClicked: function Site_recordSiteClicked(aIndex) {
- - if (Services.prefs.prefHasUserValue("browser.newtabpage.rows") ||
- - Services.prefs.prefHasUserValue("browser.newtabpage.columns") ||
- - aIndex > 8) {
- - // We only want to get indices for the default configuration, everything
- - // else goes in the same bucket.
- - aIndex = 9;
- - }
- - Services.telemetry.getHistogramById("NEWTAB_PAGE_SITE_CLICKED")
- - .add(aIndex);
- - },
- -
- _toggleLegalText: function(buttonClass, explanationTextClass) {
- let button = this._querySelector(buttonClass);
- if (button.hasAttribute("active")) {
- diff --git a/toolkit/components/addoncompat/CompatWarning.jsm b/toolkit/components/addoncompat/CompatWarning.jsm
- index b32409a46..c4d45adee 100644
- --- a/toolkit/components/addoncompat/CompatWarning.jsm
- +++ b/toolkit/components/addoncompat/CompatWarning.jsm
- @@ -47,11 +47,6 @@ var CompatWarning = {
- }
- alreadyWarned = true;
- - if (addon) {
- - let histogram = Services.telemetry.getKeyedHistogramById("ADDON_SHIM_USAGE");
- - histogram.add(addon, warning ? warning.number : 0);
- - }
- -
- if (!Preferences.get("dom.ipc.shims.enabledWarnings", false))
- return;
- diff --git a/toolkit/components/alerts/resources/content/alert.js b/toolkit/components/alerts/resources/content/alert.js
- index 12068b548..396fb8ba4 100644
- --- a/toolkit/components/alerts/resources/content/alert.js
- +++ b/toolkit/components/alerts/resources/content/alert.js
- @@ -325,8 +325,6 @@ function doNotDisturb() {
- .getService(Ci.nsIAlertsService)
- .QueryInterface(Ci.nsIAlertsDoNotDisturb);
- alertService.manualDoNotDisturb = true;
- - Services.telemetry.getHistogramById("WEB_NOTIFICATION_MENU")
- - .add(0);
- onAlertClose();
- }
- diff --git a/toolkit/components/asyncshutdown/AsyncShutdown.jsm b/toolkit/components/asyncshutdown/AsyncShutdown.jsm
- index 9cdf9e126..ca4f21ab0 100644
- --- a/toolkit/components/asyncshutdown/AsyncShutdown.jsm
- +++ b/toolkit/components/asyncshutdown/AsyncShutdown.jsm
- @@ -1001,7 +1001,6 @@ if (!isContent) {
- this.AsyncShutdown.profileChangeTeardown = getPhase("profile-change-teardown");
- this.AsyncShutdown.profileBeforeChange = getPhase("profile-before-change");
- this.AsyncShutdown.placesClosingInternalConnection = getPhase("places-will-close-connection");
- - this.AsyncShutdown.sendTelemetry = getPhase("profile-before-change-telemetry");
- }
- // Notifications that fire in the parent and content process, but should
- diff --git a/toolkit/components/blocklist/nsBlocklistService.js b/toolkit/components/blocklist/nsBlocklistService.js
- index 788ce192f..77adca67e 100644
- --- a/toolkit/components/blocklist/nsBlocklistService.js
- +++ b/toolkit/components/blocklist/nsBlocklistService.js
- @@ -749,10 +749,7 @@ Blocklist.prototype = {
- return;
- }
- - let telemetry = Services.telemetry;
- -
- if (this._isBlocklistPreloaded()) {
- - telemetry.getHistogramById("BLOCKLIST_SYNC_FILE_LOAD").add(false);
- this._loadBlocklistFromString(this._preloadedBlocklistContent);
- delete this._preloadedBlocklistContent;
- return;
- @@ -763,8 +760,6 @@ Blocklist.prototype = {
- return;
- }
- - telemetry.getHistogramById("BLOCKLIST_SYNC_FILE_LOAD").add(true);
- -
- let text = "";
- let fstream = null;
- let cstream = null;
- diff --git a/toolkit/components/contextualidentity/ContextualIdentityService.jsm b/toolkit/components/contextualidentity/ContextualIdentityService.jsm
- index 6aae3673d..dfc72e617 100644
- --- a/toolkit/components/contextualidentity/ContextualIdentityService.jsm
- +++ b/toolkit/components/contextualidentity/ContextualIdentityService.jsm
- @@ -45,7 +45,6 @@ _ContextualIdentityService.prototype = {
- color: "blue",
- l10nID: "userContextPersonal.label",
- accessKey: "userContextPersonal.accesskey",
- - telemetryId: 1,
- },
- { userContextId: 2,
- public: true,
- @@ -53,7 +52,6 @@ _ContextualIdentityService.prototype = {
- color: "orange",
- l10nID: "userContextWork.label",
- accessKey: "userContextWork.accesskey",
- - telemetryId: 2,
- },
- { userContextId: 3,
- public: true,
- @@ -61,7 +59,6 @@ _ContextualIdentityService.prototype = {
- color: "green",
- l10nID: "userContextBanking.label",
- accessKey: "userContextBanking.accesskey",
- - telemetryId: 3,
- },
- { userContextId: 4,
- public: true,
- @@ -69,7 +66,6 @@ _ContextualIdentityService.prototype = {
- color: "pink",
- l10nID: "userContextShopping.label",
- accessKey: "userContextShopping.accesskey",
- - telemetryId: 4,
- },
- { userContextId: 5,
- public: false,
- @@ -314,27 +310,6 @@ _ContextualIdentityService.prototype = {
- }
- },
- - telemetry(userContextId) {
- - let identity = this.getIdentityFromId(userContextId);
- -
- - // Let's ignore unknown identities for now.
- - if (!identity || !identity.public) {
- - return;
- - }
- -
- - if (!this._openedIdentities.has(userContextId)) {
- - this._openedIdentities.add(userContextId);
- - Services.telemetry.getHistogramById("UNIQUE_CONTAINERS_OPENED").add(1);
- - }
- -
- - Services.telemetry.getHistogramById("TOTAL_CONTAINERS_OPENED").add(1);
- -
- - if (identity.telemetryId) {
- - Services.telemetry.getHistogramById("CONTAINER_USED")
- - .add(identity.telemetryId);
- - }
- - },
- -
- createNewInstanceForTesting(path) {
- return new _ContextualIdentityService(path);
- },
- diff --git a/toolkit/components/gfx/SanityTest.js b/toolkit/components/gfx/SanityTest.js
- index a563ec361..8e0cde1de 100644
- --- a/toolkit/components/gfx/SanityTest.js
- +++ b/toolkit/components/gfx/SanityTest.js
- @@ -56,20 +56,10 @@ function testPixel(ctx, x, y, r, g, b, a, fuzz) {
- }
- function reportResult(val) {
- - try {
- - let histogram = Services.telemetry.getHistogramById("GRAPHICS_SANITY_TEST");
- - histogram.add(val);
- - } catch (e) {}
- -
- Preferences.set(RUNNING_PREF, false);
- Services.prefs.savePrefFile(null);
- }
- -function reportTestReason(val) {
- - let histogram = Services.telemetry.getHistogramById("GRAPHICS_SANITY_TEST_REASON");
- - histogram.add(val);
- -}
- -
- function annotateCrashReport(value) {
- try {
- // "1" if we're annotating the crash report, "" to remove the annotation.
- @@ -257,11 +247,6 @@ SanityTest.prototype = {
- if (prefValue == value) {
- return true;
- }
- - if (prefValue === undefined) {
- - reportTestReason(REASON_FIRST_RUN);
- - } else {
- - reportTestReason(reason);
- - }
- return false;
- }
- diff --git a/toolkit/components/osfile/modules/osfile_async_front.jsm b/toolkit/components/osfile/modules/osfile_async_front.jsm
- index 9f3b7fb21..e68157378 100644
- --- a/toolkit/components/osfile/modules/osfile_async_front.jsm
- +++ b/toolkit/components/osfile/modules/osfile_async_front.jsm
- @@ -434,34 +434,10 @@ var Scheduler = this.Scheduler = {
- Scheduler.Debugging.latestReceived = [Date.now(), error.message, error.fileName, error.lineNumber];
- throw error;
- } finally {
- - if (firstLaunch) {
- - Scheduler._updateTelemetry();
- - }
- Scheduler.restartTimer();
- }
- }.bind(this)));
- },
- -
- - /**
- - * Post Telemetry statistics.
- - *
- - * This is only useful on first launch.
- - */
- - _updateTelemetry: function() {
- - let worker = this.worker;
- - let workerTimeStamps = worker.workerTimeStamps;
- - if (!workerTimeStamps) {
- - // If the first call to OS.File results in an uncaught errors,
- - // the timestamps are absent. As this case is a developer error,
- - // let's not waste time attempting to extract telemetry from it.
- - return;
- - }
- - let HISTOGRAM_LAUNCH = Services.telemetry.getHistogramById("OSFILE_WORKER_LAUNCH_MS");
- - HISTOGRAM_LAUNCH.add(worker.workerTimeStamps.entered - worker.launchTimeStamp);
- -
- - let HISTOGRAM_READY = Services.telemetry.getHistogramById("OSFILE_WORKER_READY_MS");
- - HISTOGRAM_READY.add(worker.workerTimeStamps.loaded - worker.launchTimeStamp);
- - }
- };
- const PREF_OSFILE_LOG = "toolkit.osfile.log";
- diff --git a/toolkit/components/osfile/modules/osfile_async_worker.js b/toolkit/components/osfile/modules/osfile_async_worker.js
- index 84287c75e..8a03e6535 100644
- --- a/toolkit/components/osfile/modules/osfile_async_worker.js
- +++ b/toolkit/components/osfile/modules/osfile_async_worker.js
- @@ -12,14 +12,6 @@ if (this.Components) {
- (function(exports) {
- "use strict";
- - // Timestamps, for use in Telemetry.
- - // The object is set to |null| once it has been sent
- - // to the main thread.
- - let timeStamps = {
- - entered: Date.now(),
- - loaded: null
- - };
- -
- importScripts("resource://gre/modules/osfile.jsm");
- let PromiseWorker = require("resource://gre/modules/workers/PromiseWorker.js");
- diff --git a/toolkit/components/parentalcontrols/nsIParentalControlsService.idl b/toolkit/components/parentalcontrols/nsIParentalControlsService.idl
- index 45d349add..5bba6cb29 100644
- --- a/toolkit/components/parentalcontrols/nsIParentalControlsService.idl
- +++ b/toolkit/components/parentalcontrols/nsIParentalControlsService.idl
- @@ -36,7 +36,6 @@ interface nsIParentalControlsService : nsISupports
- const short ADVANCED_SETTINGS = 17; // Advanced settings
- const short CAMERA_MICROPHONE = 18; // Camera and microphone (WebRTC)
- const short BLOCK_LIST = 19; // Block websites that include sensitive content
- - const short TELEMETRY = 20; // Submit telemetry data
- const short HEALTH_REPORT = 21; // Submit FHR data
- const short DEFAULT_THEME = 22; // Use default theme or a special parental controls theme
- diff --git a/toolkit/components/passwordmgr/InsecurePasswordUtils.jsm b/toolkit/components/passwordmgr/InsecurePasswordUtils.jsm
- index 5351e45b2..68e4de759 100644
- --- a/toolkit/components/passwordmgr/InsecurePasswordUtils.jsm
- +++ b/toolkit/components/passwordmgr/InsecurePasswordUtils.jsm
- @@ -144,7 +144,5 @@ this.InsecurePasswordUtils = {
- } else {
- passwordSafety = 5;
- }
- -
- - Services.telemetry.getHistogramById("PWMGR_LOGIN_PAGE_SAFETY").add(passwordSafety);
- },
- };
- diff --git a/toolkit/components/passwordmgr/LoginManagerContent.jsm b/toolkit/components/passwordmgr/LoginManagerContent.jsm
- index 60805530d..2d93a6b11 100644
- --- a/toolkit/components/passwordmgr/LoginManagerContent.jsm
- +++ b/toolkit/components/passwordmgr/LoginManagerContent.jsm
- @@ -1235,7 +1235,6 @@ var LoginManagerContent = {
- if (!userTriggered) {
- // Ignore fills as a result of user action for this probe.
- - Services.telemetry.getHistogramById("PWMGR_FORM_AUTOFILL_RESULT").add(autofillResult);
- if (usernameField) {
- let focusedElement = this._formFillService.focusedInput;
- diff --git a/toolkit/components/passwordmgr/content/passwordManager.js b/toolkit/components/passwordmgr/content/passwordManager.js
- index 327ebbdf8..37d1c6a0e 100644
- --- a/toolkit/components/passwordmgr/content/passwordManager.js
- +++ b/toolkit/components/passwordmgr/content/passwordManager.js
- @@ -91,7 +91,6 @@ function Startup() {
- }
- SignonColumnSort(sortField);
- - Services.telemetry.getKeyedHistogramById("PWMGR_MANAGE_SORTED").add(sortField);
- });
- LoadSignons();
- @@ -101,9 +100,6 @@ function Startup() {
- window.arguments[0] &&
- window.arguments[0].filterString) {
- setFilter(window.arguments[0].filterString);
- - Services.telemetry.getHistogramById("PWMGR_MANAGE_OPENED").add(1);
- - } else {
- - Services.telemetry.getHistogramById("PWMGR_MANAGE_OPENED").add(0);
- }
- FocusFilterBox();
- @@ -435,7 +431,6 @@ function DeleteAllSignons() {
- removeButton.setAttribute("disabled", "true");
- removeAllButton.setAttribute("disabled", "true");
- FinalizeSignonDeletions(syncNeeded);
- - Services.telemetry.getHistogramById("PWMGR_MANAGE_DELETED_ALL").add(1);
- }
- function TogglePasswordVisible() {
- @@ -450,7 +445,6 @@ function TogglePasswordVisible() {
- // Notify observers that the password visibility toggling is
- // completed. (Mostly useful for tests)
- Services.obs.notifyObservers(null, "passwordmgr-password-toggle-complete", null);
- - Services.telemetry.getHistogramById("PWMGR_MANAGE_VISIBILITY_TOGGLED").add(showingPasswords);
- }
- function AskUserShowPasswords() {
- @@ -467,7 +461,6 @@ function AskUserShowPasswords() {
- function FinalizeSignonDeletions(syncNeeded) {
- for (let s = 0; s < deletedSignons.length; s++) {
- Services.logins.removeLogin(deletedSignons[s]);
- - Services.telemetry.getHistogramById("PWMGR_MANAGE_DELETED").add(1);
- }
- // If the deletion has been performed in a filtered view, reflect the deletion in the unfiltered table.
- // See bug 405389.
- @@ -642,7 +635,6 @@ function CopyPassword() {
- let row = signonsTree.currentIndex;
- let password = signonsTreeView.getCellText(row, {id : "passwordCol" });
- clipboard.copyString(password);
- - Services.telemetry.getHistogramById("PWMGR_MANAGE_COPIED_PASSWORD").add(1);
- }
- function CopyUsername() {
- @@ -652,7 +644,6 @@ function CopyUsername() {
- let row = signonsTree.currentIndex;
- let username = signonsTreeView.getCellText(row, {id : "userCol" });
- clipboard.copyString(username);
- - Services.telemetry.getHistogramById("PWMGR_MANAGE_COPIED_USERNAME").add(1);
- }
- function EditCellInSelectedRow(columnName) {
- diff --git a/toolkit/components/passwordmgr/nsLoginManager.js b/toolkit/components/passwordmgr/nsLoginManager.js
- index 514351fa5..24e0f50c5 100644
- --- a/toolkit/components/passwordmgr/nsLoginManager.js
- +++ b/toolkit/components/passwordmgr/nsLoginManager.js
- @@ -107,8 +107,6 @@ LoginManager.prototype = {
- // Initialize storage so that asynchronous data loading can start.
- this._initStorage();
- }
- -
- - Services.obs.addObserver(this._observer, "gather-telemetry", false);
- },
- @@ -173,85 +171,12 @@ LoginManager.prototype = {
- Services.obs.notifyObservers(null,
- "passwordmgr-storage-replace-complete", null);
- }.bind(this));
- - } else if (topic == "gather-telemetry") {
- - // When testing, the "data" parameter is a string containing the
- - // reference time in milliseconds for time-based statistics.
- - this._pwmgr._gatherTelemetry(data ? parseInt(data)
- - : new Date().getTime());
- } else {
- log.debug("Oops! Unexpected notification:", topic);
- }
- }
- },
- - /**
- - * Collects statistics about the current logins and settings. The telemetry
- - * histograms used here are not accumulated, but are reset each time this
- - * function is called, since it can be called multiple times in a session.
- - *
- - * This function might also not be called at all in the current session.
- - *
- - * @param referenceTimeMs
- - * Current time used to calculate time-based statistics, expressed as
- - * the number of milliseconds since January 1, 1970, 00:00:00 UTC.
- - * This is set to a fake value during unit testing.
- - */
- - _gatherTelemetry(referenceTimeMs) {
- - function clearAndGetHistogram(histogramId) {
- - let histogram = Services.telemetry.getHistogramById(histogramId);
- - histogram.clear();
- - return histogram;
- - }
- -
- - clearAndGetHistogram("PWMGR_BLOCKLIST_NUM_SITES").add(
- - this.getAllDisabledHosts({}).length
- - );
- - clearAndGetHistogram("PWMGR_NUM_SAVED_PASSWORDS").add(
- - this.countLogins("", "", "")
- - );
- - clearAndGetHistogram("PWMGR_NUM_HTTPAUTH_PASSWORDS").add(
- - this.countLogins("", null, "")
- - );
- -
- - // This is a boolean histogram, and not a flag, because we don't want to
- - // record any value if _gatherTelemetry is not called.
- - clearAndGetHistogram("PWMGR_SAVING_ENABLED").add(this._remember);
- -
- - // Don't try to get logins if MP is enabled, since we don't want to show a MP prompt.
- - if (!this.isLoggedIn) {
- - return;
- - }
- -
- - let logins = this.getAllLogins({});
- -
- - let usernamePresentHistogram = clearAndGetHistogram("PWMGR_USERNAME_PRESENT");
- - let loginLastUsedDaysHistogram = clearAndGetHistogram("PWMGR_LOGIN_LAST_USED_DAYS");
- -
- - let hostnameCount = new Map();
- - for (let login of logins) {
- - usernamePresentHistogram.add(!!login.username);
- -
- - let hostname = login.hostname;
- - hostnameCount.set(hostname, (hostnameCount.get(hostname) || 0 ) + 1);
- -
- - login.QueryInterface(Ci.nsILoginMetaInfo);
- - let timeLastUsedAgeMs = referenceTimeMs - login.timeLastUsed;
- - if (timeLastUsedAgeMs > 0) {
- - loginLastUsedDaysHistogram.add(
- - Math.floor(timeLastUsedAgeMs / MS_PER_DAY)
- - );
- - }
- - }
- -
- - let passwordsCountHistogram = clearAndGetHistogram("PWMGR_NUM_PASSWORDS_PER_HOSTNAME");
- - for (let count of hostnameCount.values()) {
- - passwordsCountHistogram.add(count);
- - }
- - },
- -
- -
- -
- -
- /* ---------- Primary Public interfaces ---------- */
- diff --git a/toolkit/components/passwordmgr/nsLoginManagerPrompter.js b/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
- index c4be39e31..9792e1088 100644
- --- a/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
- +++ b/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
- @@ -18,14 +18,6 @@ const LoginInfo =
- const BRAND_BUNDLE = "chrome://branding/locale/brand.properties";
- -/**
- - * Constants for password prompt telemetry.
- - * Mirrored in mobile/android/components/LoginManagerPrompter.js */
- -const PROMPT_DISPLAYED = 0;
- -
- -const PROMPT_ADD_OR_UPDATE = 1;
- -const PROMPT_NOTNOW = 2;
- -const PROMPT_NEVER = 3;
- /**
- * Implements nsIPromptFactory
- @@ -856,11 +848,6 @@ LoginManagerPrompter.prototype = {
- let promptMsg = type == "password-save" ? this._getLocalizedString(saveMsgNames.prompt, [brandShortName])
- : this._getLocalizedString(changeMsgNames.prompt);
- - let histogramName = type == "password-save" ? "PWMGR_PROMPT_REMEMBER_ACTION"
- - : "PWMGR_PROMPT_UPDATE_ACTION";
- - let histogram = Services.telemetry.getHistogramById(histogramName);
- - histogram.add(PROMPT_DISPLAYED);
- -
- let chromeDoc = browser.ownerDocument;
- let currentNotification;
- diff --git a/toolkit/components/places/BookmarkHTMLUtils.jsm b/toolkit/components/places/BookmarkHTMLUtils.jsm
- index c10ef85d6..6b4ea7934 100644
- --- a/toolkit/components/places/BookmarkHTMLUtils.jsm
- +++ b/toolkit/components/places/BookmarkHTMLUtils.jsm
- @@ -220,14 +220,6 @@ this.BookmarkHTMLUtils = Object.freeze({
- let exporter = new BookmarkExporter(bookmarks);
- yield exporter.exportToFile(aFilePath);
- - try {
- - Services.telemetry
- - .getHistogramById("PLACES_EXPORT_TOHTML_MS")
- - .add(Date.now() - startTime);
- - } catch (ex) {
- - Components.utils.reportError("Unable to report telemetry.");
- - }
- -
- return count;
- });
- },
- diff --git a/toolkit/components/places/PlacesDBUtils.jsm b/toolkit/components/places/PlacesDBUtils.jsm
- index 4ac6ea261..baeb17a2b 100644
- --- a/toolkit/components/places/PlacesDBUtils.jsm
- +++ b/toolkit/components/places/PlacesDBUtils.jsm
- @@ -50,14 +50,6 @@ this.PlacesDBUtils = {
- task.call(PlacesDBUtils, aTasks);
- }
- else {
- - // All tasks have been completed.
- - // Telemetry the time it took for maintenance, if a start time exists.
- - if (aTasks._telemetryStart) {
- - Services.telemetry.getHistogramById("PLACES_IDLE_MAINTENANCE_TIME_MS")
- - .add(Date.now() - aTasks._telemetryStart);
- - aTasks._telemetryStart = 0;
- - }
- -
- if (aTasks.callback) {
- let scope = aTasks.scope || Cu.getGlobalForObject(aTasks.callback);
- aTasks.callback.call(scope, aTasks.messages);
- @@ -89,7 +81,6 @@ this.PlacesDBUtils = {
- , this.checkCoherence
- , this._refreshUI
- ]);
- - tasks._telemetryStart = Date.now();
- tasks.callback = function() {
- Services.prefs.setIntPref("places.database.lastMaintenance",
- parseInt(Date.now() / 1000));
- @@ -856,181 +847,6 @@ this.PlacesDBUtils = {
- PlacesDBUtils._executeTasks(tasks);
- },
- - /**
- - * Collects telemetry data and reports it to Telemetry.
- - *
- - * @param [optional] aTasks
- - * Tasks object to execute.
- - */
- - telemetry: function PDBU_telemetry(aTasks)
- - {
- - let tasks = new Tasks(aTasks);
- -
- - // This will be populated with one integer property for each probe result,
- - // using the histogram name as key.
- - let probeValues = {};
- -
- - // The following array contains an ordered list of entries that are
- - // processed to collect telemetry data. Each entry has these properties:
- - //
- - // histogram: Name of the telemetry histogram to update.
- - // query: This is optional. If present, contains a database command
- - // that will be executed asynchronously, and whose result will
- - // be added to the telemetry histogram.
- - // callback: This is optional. If present, contains a function that must
- - // return the value that will be added to the telemetry
- - // histogram. If a query is also present, its result is passed
- - // as the first argument of the function. If the function
- - // raises an exception, no data is added to the histogram.
- - //
- - // Since all queries are executed in order by the database backend, the
- - // callbacks can also use the result of previous queries stored in the
- - // probeValues object.
- - let probes = [
- - { histogram: "PLACES_PAGES_COUNT",
- - query: "SELECT count(*) FROM moz_places" },
- -
- - { histogram: "PLACES_BOOKMARKS_COUNT",
- - query: `SELECT count(*) FROM moz_bookmarks b
- - JOIN moz_bookmarks t ON t.id = b.parent
- - AND t.parent <> :tags_folder
- - WHERE b.type = :type_bookmark` },
- -
- - { histogram: "PLACES_TAGS_COUNT",
- - query: `SELECT count(*) FROM moz_bookmarks
- - WHERE parent = :tags_folder` },
- -
- - { histogram: "PLACES_KEYWORDS_COUNT",
- - query: "SELECT count(*) FROM moz_keywords" },
- -
- - { histogram: "PLACES_SORTED_BOOKMARKS_PERC",
- - query: `SELECT IFNULL(ROUND((
- - SELECT count(*) FROM moz_bookmarks b
- - JOIN moz_bookmarks t ON t.id = b.parent
- - AND t.parent <> :tags_folder AND t.parent > :places_root
- - WHERE b.type = :type_bookmark
- - ) * 100 / (
- - SELECT count(*) FROM moz_bookmarks b
- - JOIN moz_bookmarks t ON t.id = b.parent
- - AND t.parent <> :tags_folder
- - WHERE b.type = :type_bookmark
- - )), 0)` },
- -
- - { histogram: "PLACES_TAGGED_BOOKMARKS_PERC",
- - query: `SELECT IFNULL(ROUND((
- - SELECT count(*) FROM moz_bookmarks b
- - JOIN moz_bookmarks t ON t.id = b.parent
- - AND t.parent = :tags_folder
- - ) * 100 / (
- - SELECT count(*) FROM moz_bookmarks b
- - JOIN moz_bookmarks t ON t.id = b.parent
- - AND t.parent <> :tags_folder
- - WHERE b.type = :type_bookmark
- - )), 0)` },
- -
- - { histogram: "PLACES_DATABASE_FILESIZE_MB",
- - callback: function () {
- - let DBFile = Services.dirsvc.get("ProfD", Ci.nsILocalFile);
- - DBFile.append("places.sqlite");
- - return parseInt(DBFile.fileSize / BYTES_PER_MEBIBYTE);
- - }
- - },
- -
- - { histogram: "PLACES_DATABASE_PAGESIZE_B",
- - query: "PRAGMA page_size /* PlacesDBUtils.jsm PAGESIZE_B */" },
- -
- - { histogram: "PLACES_DATABASE_SIZE_PER_PAGE_B",
- - query: "PRAGMA page_count",
- - callback: function (aDbPageCount) {
- - // Note that the database file size would not be meaningful for this
- - // calculation, because the file grows in fixed-size chunks.
- - let dbPageSize = probeValues.PLACES_DATABASE_PAGESIZE_B;
- - let placesPageCount = probeValues.PLACES_PAGES_COUNT;
- - return Math.round((dbPageSize * aDbPageCount) / placesPageCount);
- - }
- - },
- -
- - { histogram: "PLACES_ANNOS_BOOKMARKS_COUNT",
- - query: "SELECT count(*) FROM moz_items_annos" },
- -
- - { histogram: "PLACES_ANNOS_PAGES_COUNT",
- - query: "SELECT count(*) FROM moz_annos" },
- -
- - { histogram: "PLACES_MAINTENANCE_DAYSFROMLAST",
- - callback: function () {
- - try {
- - let lastMaintenance = Services.prefs.getIntPref("places.database.lastMaintenance");
- - let nowSeconds = parseInt(Date.now() / 1000);
- - return parseInt((nowSeconds - lastMaintenance) / 86400);
- - } catch (ex) {
- - return 60;
- - }
- - }
- - },
- - ];
- -
- - let params = {
- - tags_folder: PlacesUtils.tagsFolderId,
- - type_folder: PlacesUtils.bookmarks.TYPE_FOLDER,
- - type_bookmark: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- - places_root: PlacesUtils.placesRootId
- - };
- -
- - for (let i = 0; i < probes.length; i++) {
- - let probe = probes[i];
- -
- - let promiseDone = new Promise((resolve, reject) => {
- - if (!("query" in probe)) {
- - resolve([probe]);
- - return;
- - }
- -
- - let stmt = DBConn.createAsyncStatement(probe.query);
- - for (let param in params) {
- - if (probe.query.indexOf(":" + param) > 0) {
- - stmt.params[param] = params[param];
- - }
- - }
- -
- - try {
- - stmt.executeAsync({
- - handleError: reject,
- - handleResult: function (aResultSet) {
- - let row = aResultSet.getNextRow();
- - resolve([probe, row.getResultByIndex(0)]);
- - },
- - handleCompletion: function () {}
- - });
- - } finally {
- - stmt.finalize();
- - }
- - });
- -
- - // Report the result of the probe through Telemetry.
- - // The resulting promise cannot reject.
- - promiseDone.then(
- - // On success
- - ([aProbe, aValue]) => {
- - let value = aValue;
- - try {
- - if ("callback" in aProbe) {
- - value = aProbe.callback(value);
- - }
- - probeValues[aProbe.histogram] = value;
- - Services.telemetry.getHistogramById(aProbe.histogram).add(value);
- - } catch (ex) {
- - Components.utils.reportError("Error adding value " + value +
- - " to histogram " + aProbe.histogram +
- - ": " + ex);
- - }
- - },
- - // On failure
- - this._handleError);
- - }
- -
- - PlacesDBUtils._executeTasks(tasks);
- - },
- -
- /**
- * Runs a list of tasks, notifying log messages to the callback.
- *
- @@ -1068,7 +884,6 @@ function Tasks(aTasks)
- this._log = aTasks.messages;
- this.callback = aTasks.callback;
- this.scope = aTasks.scope;
- - this._telemetryStart = aTasks._telemetryStart;
- }
- }
- }
- @@ -1078,7 +893,6 @@ Tasks.prototype = {
- _log: [],
- callback: null,
- scope: null,
- - _telemetryStart: 0,
- /**
- * Adds a task to the top of the list.
- diff --git a/toolkit/components/places/nsPlacesExpiration.js b/toolkit/components/places/nsPlacesExpiration.js
- index 767a4d345..e5c5f873f 100644
- --- a/toolkit/components/places/nsPlacesExpiration.js
- +++ b/toolkit/components/places/nsPlacesExpiration.js
- @@ -709,7 +709,6 @@ nsPlacesExpiration.prototype = {
- },
- // Number of expiration steps needed to reach a CLEAN status.
- - _telemetrySteps: 1,
- handleCompletion: function PEX_handleCompletion(aReason)
- {
- if (aReason == Ci.mozIStorageStatementCallback.REASON_FINISHED) {
- @@ -730,29 +729,9 @@ nsPlacesExpiration.prototype = {
- // Adapt the aggressivity of steps based on the status of history.
- // A dirty history will return all the entries we are expecting bringing
- // our countdown to zero, while a clean one will not.
- - let oldStatus = this.status;
- this.status = this._expectedResultsCount == 0 ? STATUS.DIRTY
- : STATUS.CLEAN;
- - // Collect or send telemetry data.
- - if (this.status == STATUS.DIRTY) {
- - this._telemetrySteps++;
- - }
- - else {
- - // Avoid reporting the common cases where the database is clean, or
- - // a single step is needed.
- - if (oldStatus == STATUS.DIRTY) {
- - try {
- - Services.telemetry
- - .getHistogramById("PLACES_EXPIRATION_STEPS_TO_CLEAN2")
- - .add(this._telemetrySteps);
- - } catch (ex) {
- - Components.utils.reportError("Unable to report telemetry.");
- - }
- - }
- - this._telemetrySteps = 1;
- - }
- -
- delete this._expectedResultsCount;
- }
- diff --git a/toolkit/components/printing/content/printUtils.js b/toolkit/components/printing/content/printUtils.js
- index 416954188..62602396c 100644
- --- a/toolkit/components/printing/content/printUtils.js
- +++ b/toolkit/components/printing/content/printUtils.js
- @@ -198,9 +198,6 @@ var PrintUtils = {
- this._sourceBrowser = aListenerObj.getSourceBrowser();
- this._originalTitle = this._sourceBrowser.contentTitle;
- this._originalURL = this._sourceBrowser.currentURI.spec;
- -
- - // Here we log telemetry data for when the user enters print preview.
- - this.logTelemetry("PRINT_PREVIEW_OPENED_COUNT");
- } else {
- // collapse the browser here -- it will be shown in
- // enterPrintPreview; this forces a reflow which fixes display
- @@ -536,9 +533,6 @@ var PrintUtils = {
- URL: this._originalURL,
- windowID: this._sourceBrowser.outerWindowID,
- });
- -
- - // Here we log telemetry data for when the user enters simplify mode.
- - this.logTelemetry("PRINT_PREVIEW_SIMPLIFY_PAGE_OPENED_COUNT");
- }
- } else {
- sendEnterPreviewMessage(this._sourceBrowser, false);
- @@ -597,7 +591,6 @@ var PrintUtils = {
- if (this._sourceBrowser.isArticle) {
- printPreviewTB.enableSimplifyPage();
- } else {
- - this.logTelemetry("PRINT_PREVIEW_SIMPLIFY_PAGE_UNAVAILABLE_COUNT");
- printPreviewTB.disableSimplifyPage();
- }
- @@ -652,12 +645,6 @@ var PrintUtils = {
- this._listener.onExit();
- },
- - logTelemetry: function (ID)
- - {
- - let histogram = Services.telemetry.getHistogramById(ID);
- - histogram.add(true);
- - },
- -
- onKeyDownPP: function (aEvent)
- {
- // Esc exits the PP
- diff --git a/toolkit/components/terminator/moz.build b/toolkit/components/terminator/moz.build
- index 7e230ed4d..943a7369c 100644
- --- a/toolkit/components/terminator/moz.build
- +++ b/toolkit/components/terminator/moz.build
- @@ -15,7 +15,6 @@ EXPORTS += [
- ]
- EXTRA_COMPONENTS += [
- - 'nsTerminatorTelemetry.js',
- 'terminator.manifest',
- ]
- diff --git a/toolkit/components/terminator/nsTerminatorTelemetry.js b/toolkit/components/terminator/nsTerminatorTelemetry.js
- deleted file mode 100644
- index ed017da78..000000000
- --- a/toolkit/components/terminator/nsTerminatorTelemetry.js
- +++ /dev/null
- @@ -1,105 +0,0 @@
- -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
- -/* vim: set ts=2 et sw=2 tw=80 filetype=javascript: */
- -/* 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";
- -
- -/**
- - * Read the data saved by nsTerminator during shutdown and feed it to the
- - * relevant telemetry histograms.
- - */
- -
- -const Cc = Components.classes;
- -const Ci = Components.interfaces;
- -const Cu = Components.utils;
- -const Cr = Components.results;
- -
- -Cu.import("resource://gre/modules/XPCOMUtils.jsm");
- -
- -XPCOMUtils.defineLazyModuleGetter(this, "OS",
- - "resource://gre/modules/osfile.jsm");
- -XPCOMUtils.defineLazyModuleGetter(this, "Promise",
- - "resource://gre/modules/Promise.jsm");
- -XPCOMUtils.defineLazyModuleGetter(this, "Task",
- - "resource://gre/modules/Task.jsm");
- -XPCOMUtils.defineLazyModuleGetter(this, "setTimeout",
- - "resource://gre/modules/Timer.jsm");
- -XPCOMUtils.defineLazyModuleGetter(this, "Services",
- - "resource://gre/modules/Services.jsm");
- -
- -function nsTerminatorTelemetry() {}
- -
- -var HISTOGRAMS = {
- - "quit-application": "SHUTDOWN_PHASE_DURATION_TICKS_QUIT_APPLICATION",
- - "profile-change-teardown": "SHUTDOWN_PHASE_DURATION_TICKS_PROFILE_CHANGE_TEARDOWN",
- - "profile-before-change": "SHUTDOWN_PHASE_DURATION_TICKS_PROFILE_BEFORE_CHANGE",
- - "xpcom-will-shutdown": "SHUTDOWN_PHASE_DURATION_TICKS_XPCOM_WILL_SHUTDOWN",
- -};
- -
- -nsTerminatorTelemetry.prototype = {
- - classID: Components.ID("{3f78ada1-cba2-442a-82dd-d5fb300ddea7}"),
- -
- - _xpcom_factory: XPCOMUtils.generateSingletonFactory(nsTerminatorTelemetry),
- -
- - // nsISupports
- -
- - QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
- -
- - // nsIObserver
- -
- - observe: function DS_observe(aSubject, aTopic, aData)
- - {
- - Task.spawn(function*() {
- - //
- - // This data is hardly critical, reading it can wait for a few seconds.
- - //
- - yield new Promise(resolve => setTimeout(resolve, 3000));
- -
- - let PATH = OS.Path.join(OS.Constants.Path.localProfileDir,
- - "ShutdownDuration.json");
- - let raw;
- - try {
- - raw = yield OS.File.read(PATH, { encoding: "utf-8" });
- - } catch (ex) {
- - if (!ex.becauseNoSuchFile) {
- - throw ex;
- - }
- - return;
- - }
- - // Let other errors be reported by Promise's error-reporting.
- -
- - // Clean up
- - OS.File.remove(PATH);
- - OS.File.remove(PATH + ".tmp");
- -
- - let data = JSON.parse(raw);
- - for (let k of Object.keys(data)) {
- - let id = HISTOGRAMS[k];
- - try {
- - let histogram = Services.telemetry.getHistogramById(id);
- - if (!histogram) {
- - throw new Error("Unknown histogram " + id);
- - }
- -
- - histogram.add(Number.parseInt(data[k]));
- - } catch (ex) {
- - // Make sure that the error is reported and causes test failures,
- - // but otherwise, ignore it.
- - Promise.reject(ex);
- - continue;
- - }
- - }
- -
- - // Inform observers that we are done.
- - Services.obs.notifyObservers(null,
- - "shutdown-terminator-telemetry-updated",
- - "");
- - });
- - },
- -};
- -
- -// Module
- -
- -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsTerminatorTelemetry]);
- diff --git a/toolkit/components/thumbnails/BackgroundPageThumbs.jsm b/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
- index 3ed32665d..21d051950 100644
- --- a/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
- +++ b/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
- @@ -10,8 +10,6 @@ const DEFAULT_CAPTURE_TIMEOUT = 30000; // ms
- const DESTROY_BROWSER_TIMEOUT = 60000; // ms
- const FRAME_SCRIPT_URL = "chrome://global/content/backgroundPageThumbsContent.js";
- -const TELEMETRY_HISTOGRAM_ID_PREFIX = "FX_THUMBNAILS_BG_";
- -
- const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
- const HTML_NS = "http://www.w3.org/1999/xhtml";
- @@ -22,19 +20,6 @@ Cu.import("resource://gre/modules/PageThumbs.jsm");
- Cu.import("resource://gre/modules/Services.jsm");
- Cu.import("resource://gre/modules/Task.jsm");
- -// possible FX_THUMBNAILS_BG_CAPTURE_DONE_REASON_2 telemetry values
- -const TEL_CAPTURE_DONE_OK = 0;
- -const TEL_CAPTURE_DONE_TIMEOUT = 1;
- -// 2 and 3 were used when we had special handling for private-browsing.
- -const TEL_CAPTURE_DONE_CRASHED = 4;
- -const TEL_CAPTURE_DONE_BAD_URI = 5;
- -
- -// These are looked up on the global as properties below.
- -XPCOMUtils.defineConstant(this, "TEL_CAPTURE_DONE_OK", TEL_CAPTURE_DONE_OK);
- -XPCOMUtils.defineConstant(this, "TEL_CAPTURE_DONE_TIMEOUT", TEL_CAPTURE_DONE_TIMEOUT);
- -XPCOMUtils.defineConstant(this, "TEL_CAPTURE_DONE_CRASHED", TEL_CAPTURE_DONE_CRASHED);
- -XPCOMUtils.defineConstant(this, "TEL_CAPTURE_DONE_BAD_URI", TEL_CAPTURE_DONE_BAD_URI);
- -
- const global = this;
- // contains base64 version of a placeholder thumbnail
- @@ -67,8 +52,6 @@ const BackgroundPageThumbs = {
- this._captureQueue = this._captureQueue || [];
- this._capturesByURL = this._capturesByURL || new Map();
- - tel("QUEUE_SIZE_ON_CAPTURE", this._captureQueue.length);
- -
- // We want to avoid duplicate captures for the same URL. If there is an
- // existing one, we just add the callback to that one and we are done.
- let existing = this._capturesByURL.get(url);
- @@ -322,7 +305,6 @@ function Capture(url, captureCallback, options) {
- this.captureCallback = captureCallback;
- this.options = options;
- this.id = Capture.nextID++;
- - this.creationDate = new Date();
- this.doneCallbacks = [];
- this.doneReason;
- if (options.onDone)
- @@ -341,8 +323,6 @@ Capture.prototype = {
- * @param messageManager The nsIMessageSender of the thumbnail browser.
- */
- start: function (messageManager) {
- - this.startDate = new Date();
- - tel("CAPTURE_QUEUE_TIME_MS", this.startDate - this.creationDate);
- // timeout timer
- let timeout;
- @@ -419,13 +399,6 @@ Capture.prototype = {
- if (typeof(reason) != "number") {
- throw new Error("A done reason must be given.");
- }
- - tel("CAPTURE_DONE_REASON_2", reason);
- - if (data && data.telemetry) {
- - // Telemetry is currently disabled in the content process (bug 680508).
- - for (let id in data.telemetry) {
- - tel(id, data.telemetry[id]);
- - }
- - }
- let done = () => {
- captureCallback(this);
- @@ -454,17 +427,6 @@ Capture.prototype = {
- Capture.nextID = 0;
- -/**
- - * Adds a value to one of this module's telemetry histograms.
- - *
- - * @param histogramID This is prefixed with this module's ID.
- - * @param value The value to add.
- - */
- -function tel(histogramID, value) {
- - let id = TELEMETRY_HISTOGRAM_ID_PREFIX + histogramID;
- - Services.telemetry.getHistogramById(id).add(value);
- -}
- -
- function schedule(callback) {
- Services.tm.mainThread.dispatch(callback, Ci.nsIThread.DISPATCH_NORMAL);
- }
- diff --git a/toolkit/components/thumbnails/PageThumbs.jsm b/toolkit/components/thumbnails/PageThumbs.jsm
- index b0affee92..714bbbb77 100644
- --- a/toolkit/components/thumbnails/PageThumbs.jsm
- +++ b/toolkit/components/thumbnails/PageThumbs.jsm
- @@ -215,14 +215,10 @@ this.PageThumbs = {
- * fullScale - request that a non-downscaled image be returned.
- */
- captureToCanvas: function (aBrowser, aCanvas, aCallback, aArgs) {
- - let telemetryCaptureTime = new Date();
- let args = {
- fullScale: aArgs ? aArgs.fullScale : false
- };
- this._captureToCanvas(aBrowser, aCanvas, args, (aCanvas) => {
- - Services.telemetry
- - .getHistogramById("FX_THUMBNAILS_CAPTURE_TIME_MS")
- - .add(new Date() - telemetryCaptureTime);
- if (aCallback) {
- aCallback(aCanvas);
- }
- @@ -450,10 +446,7 @@ this.PageThumbs = {
- */
- _store: function PageThumbs__store(aOriginalURL, aFinalURL, aData, aNoOverwrite) {
- return Task.spawn(function* () {
- - let telemetryStoreTime = new Date();
- yield PageThumbsStorage.writeData(aFinalURL, aData, aNoOverwrite);
- - Services.telemetry.getHistogramById("FX_THUMBNAILS_STORE_TIME_MS")
- - .add(new Date() - telemetryStoreTime);
- Services.obs.notifyObservers(null, "page-thumbnail:create", aFinalURL);
- // We've been redirected. Create a copy of the current thumbnail for
- diff --git a/toolkit/components/thumbnails/content/backgroundPageThumbsContent.js b/toolkit/components/thumbnails/content/backgroundPageThumbsContent.js
- index 2103833b7..ab39e73f7 100644
- --- a/toolkit/components/thumbnails/content/backgroundPageThumbsContent.js
- +++ b/toolkit/components/thumbnails/content/backgroundPageThumbsContent.js
- @@ -169,10 +169,6 @@ const backgroundPageThumbsContent = {
- id: capture.id,
- imageData: fileReader.result,
- finalURL: capture.finalURL,
- - telemetry: {
- - CAPTURE_PAGE_LOAD_TIME_MS: capture.pageLoadTime,
- - CAPTURE_CANVAS_DRAW_TIME_MS: capture.canvasDrawTime,
- - },
- });
- };
- fileReader.readAsArrayBuffer(capture.imageBlob);
- diff --git a/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js b/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js
- index 5d462c90d..27e9c6b89 100644
- --- a/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js
- +++ b/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js
- @@ -30,115 +30,6 @@ function log(...stuff) {
- dump(Services.urlFormatter.trimSensitiveURLs(msg) + "\n");
- }
- -// Map the HTTP response code to a Telemetry bucket
- -// https://developers.google.com/safe-browsing/developers_guide_v2?hl=en
- -function httpStatusToBucket(httpStatus) {
- - var statusBucket;
- - switch (httpStatus) {
- - case 100:
- - case 101:
- - // Unexpected 1xx return code
- - statusBucket = 0;
- - break;
- - case 200:
- - // OK - Data is available in the HTTP response body.
- - statusBucket = 1;
- - break;
- - case 201:
- - case 202:
- - case 203:
- - case 205:
- - case 206:
- - // Unexpected 2xx return code
- - statusBucket = 2;
- - break;
- - case 204:
- - // No Content - There are no full-length hashes with the requested prefix.
- - statusBucket = 3;
- - break;
- - case 300:
- - case 301:
- - case 302:
- - case 303:
- - case 304:
- - case 305:
- - case 307:
- - case 308:
- - // Unexpected 3xx return code
- - statusBucket = 4;
- - break;
- - case 400:
- - // Bad Request - The HTTP request was not correctly formed.
- - // The client did not provide all required CGI parameters.
- - statusBucket = 5;
- - break;
- - case 401:
- - case 402:
- - case 405:
- - case 406:
- - case 407:
- - case 409:
- - case 410:
- - case 411:
- - case 412:
- - case 414:
- - case 415:
- - case 416:
- - case 417:
- - case 421:
- - case 426:
- - case 428:
- - case 429:
- - case 431:
- - case 451:
- - // Unexpected 4xx return code
- - statusBucket = 6;
- - break;
- - case 403:
- - // Forbidden - The client id is invalid.
- - statusBucket = 7;
- - break;
- - case 404:
- - // Not Found
- - statusBucket = 8;
- - break;
- - case 408:
- - // Request Timeout
- - statusBucket = 9;
- - break;
- - case 413:
- - // Request Entity Too Large - Bug 1150334
- - statusBucket = 10;
- - break;
- - case 500:
- - case 501:
- - case 510:
- - // Unexpected 5xx return code
- - statusBucket = 11;
- - break;
- - case 502:
- - case 504:
- - case 511:
- - // Local network errors, we'll ignore these.
- - statusBucket = 12;
- - break;
- - case 503:
- - // Service Unavailable - The server cannot handle the request.
- - // Clients MUST follow the backoff behavior specified in the
- - // Request Frequency section.
- - statusBucket = 13;
- - break;
- - case 505:
- - // HTTP Version Not Supported - The server CANNOT handle the requested
- - // protocol major version.
- - statusBucket = 14;
- - break;
- - default:
- - statusBucket = 15;
- - };
- - return statusBucket;
- -}
- -
- function HashCompleter() {
- // The current HashCompleterRequest in flight. Once it is started, it is set
- // to null. It may be used by multiple calls to |complete| in succession to
- @@ -321,7 +212,6 @@ HashCompleterRequest.prototype = {
- // channel.
- if (this._channel && this._channel.isPending()) {
- log("cancelling request to " + this.gethashUrl + "\n");
- - Services.telemetry.getHistogramById("URLCLASSIFIER_COMPLETE_TIMEOUT").add(1);
- this._channel.cancel(Cr.NS_BINDING_ABORTED);
- }
- },
- @@ -529,11 +419,6 @@ HashCompleterRequest.prototype = {
- let success = Components.isSuccessCode(aStatusCode);
- log('Received a ' + httpStatus + ' status code from the gethash server (success=' + success + ').');
- - let histogram =
- - Services.telemetry.getHistogramById("URLCLASSIFIER_COMPLETE_REMOTE_STATUS");
- - histogram.add(httpStatusToBucket(httpStatus));
- - Services.telemetry.getHistogramById("URLCLASSIFIER_COMPLETE_TIMEOUT").add(0);
- -
- // Notify the RequestBackoff once a response is received.
- this._completer.finishRequest(this.gethashUrl, httpStatus);
- diff --git a/toolkit/components/viewsource/content/viewSourceUtils.js b/toolkit/components/viewsource/content/viewSourceUtils.js
- index 11b39ca54..72f5dd787 100644
- --- a/toolkit/components/viewsource/content/viewSourceUtils.js
- +++ b/toolkit/components/viewsource/content/viewSourceUtils.js
- @@ -90,9 +90,6 @@ var gViewSourceUtils = {
- * The line number to focus on once the source is loaded.
- */
- viewSourceInBrowser: function(aArgs) {
- - Services.telemetry
- - .getHistogramById("VIEW_SOURCE_IN_BROWSER_OPENED_BOOLEAN")
- - .add(true);
- let viewSourceBrowser = new ViewSourceBrowser(aArgs.viewSourceBrowser);
- viewSourceBrowser.loadViewSource(aArgs);
- },
- @@ -160,9 +157,6 @@ var gViewSourceUtils = {
- } catch (ex) {
- }
- }
- - Services.telemetry
- - .getHistogramById("VIEW_SOURCE_IN_WINDOW_OPENED_BOOLEAN")
- - .add(true);
- openDialog("chrome://global/content/viewSource.xul",
- "_blank",
- "all,dialog=no",
- @@ -347,9 +341,6 @@ var gViewSourceUtils = {
- // Calls the callback, keeping in mind undefined or null values.
- handleCallBack: function(aCallBack, result, data)
- {
- - Services.telemetry
- - .getHistogramById("VIEW_SOURCE_EXTERNAL_RESULT_BOOLEAN")
- - .add(result);
- // if callback is undefined, default to the internal viewer
- if (aCallBack === undefined) {
- this.internalViewerFallback(result, data);
- --
- 2.24.0
Add Comment
Please, Sign In to add comment