· 6 years ago · Nov 17, 2019, 10:40 PM
1From 639ee50b7c6f6113a25047fc8c7723b3c2ec8610 Mon Sep 17 00:00:00 2001
2Subject: [PATCH 1/1] Telemetry branch hacks
3
4---
5 application/basilisk/app/profile/basilisk.js | 4 -
6 .../basilisk/base/content/aboutNetError.xhtml | 6 -
7 .../browser-fullScreenAndPointerLock.js | 5 -
8 .../basilisk/base/content/browser-media.js | 19 +-
9 .../basilisk/base/content/browser-plugins.js | 27 +-
10 .../content/browser-trackingprotection.js | 46 --
11 .../basilisk/base/content/newtab/page.js | 14 +-
12 .../basilisk/base/content/newtab/sites.js | 28 +-
13 .../basilisk/base/content/tabbrowser.xml | 127 +----
14 .../components/migration/AutoMigrate.jsm | 30 --
15 .../migration/FirefoxProfileMigrator.js | 71 +--
16 .../components/migration/MigrationUtils.jsm | 39 +-
17 .../components/migration/content/migration.js | 74 +--
18 .../components/nsBrowserContentHandler.js | 23 +-
19 .../places/content/browserPlacesViews.js | 3 -
20 .../preferences/in-content/advanced.js | 77 ---
21 .../preferences/in-content/advanced.xul | 42 --
22 .../preferences/in-content/content.js | 5 -
23 .../preferences/in-content/preferences.js | 34 --
24 .../components/search/content/searchReset.js | 26 -
25 .../search/service/nsSearchService.js | 24 -
26 .../components/sessionstore/SessionWorker.js | 5 -
27 .../sessionstore/StartupPerformance.jsm | 12 -
28 .../content/content-sessionStore.js | 35 --
29 .../sessionstore/nsSessionStartup.js | 5 -
30 .../pdfjs/content/PdfJsTelemetry.jsm | 70 ---
31 .../pdfjs/content/PdfStreamConverter.jsm | 73 +--
32 .../en-US/chrome/browser/aboutDialog.dtd | 2 -
33 .../chrome/browser/preferences/advanced.dtd | 17 -
34 .../modules/BrowserUsageTelemetry.jsm | 468 ------------------
35 .../basilisk/modules/ContentCrashHandlers.jsm | 21 -
36 .../basilisk/modules/ContentLinkHandler.jsm | 36 --
37 .../basilisk/modules/PluginContent.jsm | 52 --
38 .../basilisk/modules/ProcessHangMonitor.jsm | 11 -
39 application/basilisk/modules/moz.build | 1 -
40 .../shared/incontentprefs/preferences.inc.css | 11 -
41 .../palemoon/base/content/tabbrowser.xml | 85 ----
42 .../palemoon/components/newtab/page.js | 3 -
43 .../palemoon/components/newtab/sites.js | 15 -
44 .../components/addoncompat/CompatWarning.jsm | 5 -
45 .../alerts/resources/content/alert.js | 2 -
46 .../asyncshutdown/AsyncShutdown.jsm | 1 -
47 .../blocklist/nsBlocklistService.js | 5 -
48 .../ContextualIdentityService.jsm | 25 -
49 toolkit/components/gfx/SanityTest.js | 15 -
50 .../osfile/modules/osfile_async_front.jsm | 24 -
51 .../osfile/modules/osfile_async_worker.js | 8 -
52 .../nsIParentalControlsService.idl | 1 -
53 .../passwordmgr/InsecurePasswordUtils.jsm | 2 -
54 .../passwordmgr/LoginManagerContent.jsm | 1 -
55 .../passwordmgr/content/passwordManager.js | 9 -
56 .../components/passwordmgr/nsLoginManager.js | 75 ---
57 .../passwordmgr/nsLoginManagerPrompter.js | 13 -
58 .../components/places/BookmarkHTMLUtils.jsm | 8 -
59 toolkit/components/places/PlacesDBUtils.jsm | 186 -------
60 .../components/places/nsPlacesExpiration.js | 21 -
61 .../components/printing/content/printUtils.js | 13 -
62 toolkit/components/terminator/moz.build | 1 -
63 .../terminator/nsTerminatorTelemetry.js | 105 ----
64 .../thumbnails/BackgroundPageThumbs.jsm | 38 --
65 toolkit/components/thumbnails/PageThumbs.jsm | 7 -
66 .../content/backgroundPageThumbsContent.js | 4 -
67 .../nsUrlClassifierHashCompleter.js | 115 -----
68 .../viewsource/content/viewSourceUtils.js | 9 -
69 64 files changed, 25 insertions(+), 2314 deletions(-)
70 delete mode 100644 application/basilisk/extensions/pdfjs/content/PdfJsTelemetry.jsm
71 delete mode 100644 application/basilisk/modules/BrowserUsageTelemetry.jsm
72 delete mode 100644 toolkit/components/terminator/nsTerminatorTelemetry.js
73
74diff --git a/application/basilisk/app/profile/basilisk.js b/application/basilisk/app/profile/basilisk.js
75index a3ecce64d..33f6cb9b8 100644
76--- a/application/basilisk/app/profile/basilisk.js
77+++ b/application/basilisk/app/profile/basilisk.js
78@@ -1199,10 +1199,6 @@ pref("media.gmp-widevinecdm.enabled", true);
79 // -1 means no experiment is run and we use the preferred value for frecency (6h)
80 pref("browser.cache.frecency_experiment", 0);
81
82-// Telemetry settings.
83-// Determines if Telemetry pings can be archived locally.
84-pref("toolkit.telemetry.archive.enabled", true);
85-
86 // Enable GMP support in the addon manager.
87 pref("media.gmp-provider.enabled", true);
88
89diff --git a/application/basilisk/base/content/aboutNetError.xhtml b/application/basilisk/base/content/aboutNetError.xhtml
90index 5ff79ea12..77aca22d1 100644
91--- a/application/basilisk/base/content/aboutNetError.xhtml
92+++ b/application/basilisk/base/content/aboutNetError.xhtml
93@@ -123,12 +123,6 @@
94 document.getElementById("advancedButton")
95 .addEventListener("click", function togglePanelVisibility() {
96 toggleDisplay(panel);
97-
98- if (panel.style.display == "block") {
99- // send event to trigger telemetry ping
100- var event = new CustomEvent("AboutNetErrorUIExpanded", {bubbles:true});
101- document.dispatchEvent(event);
102- }
103 });
104
105 if (allowOverride) {
106diff --git a/application/basilisk/base/content/browser-fullScreenAndPointerLock.js b/application/basilisk/base/content/browser-fullScreenAndPointerLock.js
107index b26a31f78..a72b409c4 100644
108--- a/application/basilisk/base/content/browser-fullScreenAndPointerLock.js
109+++ b/application/basilisk/base/content/browser-fullScreenAndPointerLock.js
110@@ -342,11 +342,6 @@ var FullScreen = {
111 // TabsInTitlebar._update() and bug 1173768.
112 TabsInTitlebar.updateAppearance(true);
113 }
114-
115- if (enterFS && !document.fullscreenElement) {
116- Services.telemetry.getHistogramById("FX_BROWSER_FULLSCREEN_USED")
117- .add(1);
118- }
119 },
120
121 exitDomFullScreen : function() {
122diff --git a/application/basilisk/base/content/browser-media.js b/application/basilisk/base/content/browser-media.js
123index 775fc4de5..b2af8a00f 100644
124--- a/application/basilisk/base/content/browser-media.js
125+++ b/application/basilisk/base/content/browser-media.js
126@@ -185,12 +185,6 @@ XPCOMUtils.defineLazyGetter(gEMEHandler, "_brandShortName", function() {
127 return document.getElementById("bundle_brand").getString("brandShortName");
128 });
129
130-const TELEMETRY_DDSTAT_SHOWN = 0;
131-const TELEMETRY_DDSTAT_SHOWN_FIRST = 1;
132-const TELEMETRY_DDSTAT_CLICKED = 2;
133-const TELEMETRY_DDSTAT_CLICKED_FIRST = 3;
134-const TELEMETRY_DDSTAT_SOLVED = 4;
135-
136 let gDecoderDoctorHandler = {
137 getLabelForNotificationBox(type) {
138 if (type == "platform-decoder-not-found") {
139@@ -264,8 +258,6 @@ let gDecoderDoctorHandler = {
140 // (Writing prefs from e10s content is now allowed.)
141 let formatsPref = "media.decoder-doctor." + decoderDoctorReportId + ".formats";
142 let buttonClickedPref = "media.decoder-doctor." + decoderDoctorReportId + ".button-clicked";
143- let histogram =
144- Services.telemetry.getKeyedHistogramById("DECODER_DOCTOR_INFOBAR_STATS");
145
146 let formatsInPref = Services.prefs.getPrefType(formatsPref) &&
147 Services.prefs.getCharPref(formatsPref);
148@@ -275,10 +267,7 @@ let gDecoderDoctorHandler = {
149 Cu.reportError("Malformed Decoder Doctor unsolved message with no formats");
150 return;
151 }
152- if (!formatsInPref) {
153- Services.prefs.setCharPref(formatsPref, formats);
154- histogram.add(decoderDoctorReportId, TELEMETRY_DDSTAT_SHOWN_FIRST);
155- } else {
156+ if (formatsInPref) {
157 // Split existing formats into an array of strings.
158 let existing = formatsInPref.split(",").map(String.trim);
159 // Keep given formats that were not already recorded.
160@@ -290,7 +279,6 @@ let gDecoderDoctorHandler = {
161 existing.concat(newbies).join(", "));
162 }
163 }
164- histogram.add(decoderDoctorReportId, TELEMETRY_DDSTAT_SHOWN);
165
166 let buttons = [];
167 let sumo = gDecoderDoctorHandler.getSumoForLearnHowButton(type);
168@@ -303,9 +291,7 @@ let gDecoderDoctorHandler = {
169 Services.prefs.getBoolPref(buttonClickedPref);
170 if (!clickedInPref) {
171 Services.prefs.setBoolPref(buttonClickedPref, true);
172- histogram.add(decoderDoctorReportId, TELEMETRY_DDSTAT_CLICKED_FIRST);
173 }
174- histogram.add(decoderDoctorReportId, TELEMETRY_DDSTAT_CLICKED);
175
176 let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
177 openUILinkIn(baseURL + sumo, "tab");
178@@ -322,10 +308,9 @@ let gDecoderDoctorHandler = {
179 );
180 } else if (formatsInPref) {
181 // Issue is solved, and prefs haven't been cleared yet, meaning it's the
182- // first time we get this resolution -> Clear prefs and report telemetry.
183+ // first time we get this resolution -> Clear prefs.
184 Services.prefs.clearUserPref(formatsPref);
185 Services.prefs.clearUserPref(buttonClickedPref);
186- histogram.add(decoderDoctorReportId, TELEMETRY_DDSTAT_SOLVED);
187 }
188 },
189 }
190diff --git a/application/basilisk/base/content/browser-plugins.js b/application/basilisk/base/content/browser-plugins.js
191index c1bc65860..5b043d17d 100644
192--- a/application/basilisk/base/content/browser-plugins.js
193+++ b/application/basilisk/base/content/browser-plugins.js
194@@ -111,18 +111,7 @@ var gPluginHandler = {
195 },
196
197 _clickToPlayNotificationEventCallback: function PH_ctpEventCallback(event) {
198- if (event == "showing") {
199- Services.telemetry.getHistogramById("PLUGINS_NOTIFICATION_SHOWN")
200- .add(!this.options.primaryPlugin);
201- // Histograms always start at 0, even though our data starts at 1
202- let histogramCount = this.options.pluginData.size - 1;
203- if (histogramCount > 4) {
204- histogramCount = 4;
205- }
206- Services.telemetry.getHistogramById("PLUGINS_NOTIFICATION_PLUGIN_COUNT")
207- .add(histogramCount);
208- }
209- else if (event == "dismissed") {
210+ if (event == "dismissed") {
211 // Once the popup is dismissed, clicking the icon should show the full
212 // list again
213 this.options.primaryPlugin = null;
214@@ -138,8 +127,6 @@ var gPluginHandler = {
215 let permission;
216 let expireType;
217 let expireTime;
218- let histogram =
219- Services.telemetry.getHistogramById("PLUGINS_NOTIFICATION_USER_ACTION");
220
221 // Update the permission manager.
222 // Also update the current state of pluginInfo.fallbackType so that
223@@ -149,7 +136,6 @@ var gPluginHandler = {
224 permission = Ci.nsIPermissionManager.ALLOW_ACTION;
225 expireType = Ci.nsIPermissionManager.EXPIRE_SESSION;
226 expireTime = Date.now() + Services.prefs.getIntPref(this.PREF_SESSION_PERSIST_MINUTES) * 60 * 1000;
227- histogram.add(0);
228 aPluginInfo.fallbackType = Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE;
229 break;
230
231@@ -158,7 +144,6 @@ var gPluginHandler = {
232 expireType = Ci.nsIPermissionManager.EXPIRE_TIME;
233 expireTime = Date.now() +
234 Services.prefs.getIntPref(this.PREF_PERSISTENT_DAYS) * 24 * 60 * 60 * 1000;
235- histogram.add(1);
236 aPluginInfo.fallbackType = Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE;
237 break;
238
239@@ -166,7 +151,6 @@ var gPluginHandler = {
240 permission = Ci.nsIPermissionManager.PROMPT_ACTION;
241 expireType = Ci.nsIPermissionManager.EXPIRE_NEVER;
242 expireTime = 0;
243- histogram.add(2);
244 switch (aPluginInfo.blocklistState) {
245 case Ci.nsIBlocklistService.STATE_VULNERABLE_UPDATE_AVAILABLE:
246 aPluginInfo.fallbackType = Ci.nsIObjectLoadingContent.PLUGIN_VULNERABLE_UPDATABLE;
247@@ -347,9 +331,6 @@ var gPluginHandler = {
248 return;
249 }
250
251- Services.telemetry.getHistogramById("PLUGINS_INFOBAR_SHOWN").
252- add(true);
253-
254 let message;
255 // Icons set directly cannot be manipulated using moz-image-region, so
256 // we use CSS classes instead.
257@@ -386,9 +367,6 @@ var gPluginHandler = {
258 label: gNavigatorBundle.getString("pluginContinueBlocking.label"),
259 accessKey: gNavigatorBundle.getString("pluginContinueBlocking.accesskey"),
260 callback: function() {
261- Services.telemetry.getHistogramById("PLUGINS_INFOBAR_BLOCK").
262- add(true);
263-
264 Services.perms.addFromPrincipal(principal,
265 "plugin-hidden-notification",
266 Services.perms.DENY_ACTION);
267@@ -398,9 +376,6 @@ var gPluginHandler = {
268 label: gNavigatorBundle.getString("pluginActivateTrigger.label"),
269 accessKey: gNavigatorBundle.getString("pluginActivateTrigger.accesskey"),
270 callback: function() {
271- Services.telemetry.getHistogramById("PLUGINS_INFOBAR_ALLOW").
272- add(true);
273-
274 let curNotification =
275 PopupNotifications.getNotification("click-to-play-plugins",
276 browser);
277diff --git a/application/basilisk/base/content/browser-trackingprotection.js b/application/basilisk/base/content/browser-trackingprotection.js
278index 20917a083..2b887ecbf 100644
279--- a/application/basilisk/base/content/browser-trackingprotection.js
280+++ b/application/basilisk/base/content/browser-trackingprotection.js
281@@ -28,9 +28,6 @@ var TrackingProtection = {
282 gNavigatorBundle.getString("trackingProtection.icon.activeTooltip");
283 this.disabledTooltipText =
284 gNavigatorBundle.getString("trackingProtection.icon.disabledTooltip");
285-
286- this.enabledHistogramAdd(this.enabledGlobally);
287- this.disabledPBMHistogramAdd(!this.enabledInPrivateWindows);
288 },
289
290 uninit() {
291@@ -56,34 +53,6 @@ var TrackingProtection = {
292 this.container.hidden = !this.enabled;
293 },
294
295- enabledHistogramAdd(value) {
296- if (PrivateBrowsingUtils.isWindowPrivate(window)) {
297- return;
298- }
299- Services.telemetry.getHistogramById("TRACKING_PROTECTION_ENABLED").add(value);
300- },
301-
302- disabledPBMHistogramAdd(value) {
303- if (PrivateBrowsingUtils.isWindowPrivate(window)) {
304- return;
305- }
306- Services.telemetry.getHistogramById("TRACKING_PROTECTION_PBM_DISABLED").add(value);
307- },
308-
309- eventsHistogramAdd(value) {
310- if (PrivateBrowsingUtils.isWindowPrivate(window)) {
311- return;
312- }
313- Services.telemetry.getHistogramById("TRACKING_PROTECTION_EVENTS").add(value);
314- },
315-
316- shieldHistogramAdd(value) {
317- if (PrivateBrowsingUtils.isWindowPrivate(window)) {
318- return;
319- }
320- Services.telemetry.getHistogramById("TRACKING_PROTECTION_SHIELD").add(value);
321- },
322-
323 onSecurityChange(state, isSimulated) {
324 if (!this.enabled) {
325 return;
326@@ -104,25 +73,16 @@ var TrackingProtection = {
327 this.icon.setAttribute("tooltiptext", this.activeTooltipText);
328 this.icon.setAttribute("state", "blocked-tracking-content");
329 this.content.setAttribute("state", "blocked-tracking-content");
330-
331- this.shieldHistogramAdd(2);
332 } else if (isAllowing) {
333 this.icon.setAttribute("tooltiptext", this.disabledTooltipText);
334 this.icon.setAttribute("state", "loaded-tracking-content");
335 this.content.setAttribute("state", "loaded-tracking-content");
336-
337- this.shieldHistogramAdd(1);
338 } else {
339 this.icon.removeAttribute("tooltiptext");
340 this.icon.removeAttribute("state");
341 this.content.removeAttribute("state");
342-
343- // We didn't show the shield
344- this.shieldHistogramAdd(0);
345 }
346
347- // Telemetry for state change.
348- this.eventsHistogramAdd(0);
349 },
350
351 disableForCurrentPage() {
352@@ -143,9 +103,6 @@ var TrackingProtection = {
353 "trackingprotection", Services.perms.ALLOW_ACTION);
354 }
355
356- // Telemetry for disable protection.
357- this.eventsHistogramAdd(1);
358-
359 // Hide the control center.
360 document.getElementById("identity-popup").hidePopup();
361
362@@ -166,9 +123,6 @@ var TrackingProtection = {
363 Services.perms.remove(normalizedUrl, "trackingprotection");
364 }
365
366- // Telemetry for enable protection.
367- this.eventsHistogramAdd(2);
368-
369 // Hide the control center.
370 document.getElementById("identity-popup").hidePopup();
371
372diff --git a/application/basilisk/base/content/newtab/page.js b/application/basilisk/base/content/newtab/page.js
373index 7c19a9827..af56aad73 100644
374--- a/application/basilisk/base/content/newtab/page.js
375+++ b/application/basilisk/base/content/newtab/page.js
376@@ -157,13 +157,6 @@ var gPage = {
377 }
378 },
379
380- /**
381- * Handles unload event
382- */
383- _handleUnloadEvent: function Page_handleUnloadEvent() {
384- gAllPages.unregister(this);
385- },
386-
387 /**
388 * Handles all page events.
389 */
390@@ -173,7 +166,7 @@ var gPage = {
391 this.onPageVisibleAndLoaded();
392 break;
393 case "unload":
394- this._handleUnloadEvent();
395+ gAllPages.unregister(this);
396 break;
397 case "click":
398 let {button, target} = aEvent;
399@@ -213,8 +206,6 @@ var gPage = {
400 },
401
402 onPageFirstVisible: function () {
403- // Record another page impression.
404- Services.telemetry.getHistogramById("NEWTAB_PAGE_SHOWN").add(true);
405
406 for (let site of gGrid.sites) {
407 if (site) {
408@@ -225,9 +216,6 @@ var gPage = {
409 }
410 }
411
412- // save timestamp to compute page life-span delta
413- this._firstVisibleTime = Date.now();
414-
415 if (document.readyState == "complete") {
416 this.onPageVisibleAndLoaded();
417 } else {
418diff --git a/application/basilisk/base/content/newtab/sites.js b/application/basilisk/base/content/newtab/sites.js
419index 00f81869a..4c5ef0294 100644
420--- a/application/basilisk/base/content/newtab/sites.js
421+++ b/application/basilisk/base/content/newtab/sites.js
422@@ -254,6 +254,10 @@ Site.prototype = {
423 this._node.addEventListener("dragstart", this, false);
424 this._node.addEventListener("dragend", this, false);
425 this._node.addEventListener("mouseover", this, false);
426+
427+ let controls = this.node.querySelectorAll(".newtab-control");
428+ for (let i = 0; i < controls.length; i++)
429+ controls[i].addEventListener("click", this, false);
430 },
431
432 /**
433@@ -269,21 +273,6 @@ Site.prototype = {
434 } catch (e) {}
435 },
436
437- /**
438- * Record interaction with site using telemetry.
439- */
440- _recordSiteClicked: function Site_recordSiteClicked(aIndex) {
441- if (Services.prefs.prefHasUserValue("browser.newtabpage.rows") ||
442- Services.prefs.prefHasUserValue("browser.newtabpage.columns") ||
443- aIndex > 8) {
444- // We only want to get indices for the default configuration, everything
445- // else goes in the same bucket.
446- aIndex = 9;
447- }
448- Services.telemetry.getHistogramById("NEWTAB_PAGE_SITE_CLICKED")
449- .add(aIndex);
450- },
451-
452 /**
453 * Handles site click events.
454 */
455@@ -328,6 +317,15 @@ Site.prototype = {
456 */
457 handleEvent: function Site_handleEvent(aEvent) {
458 switch (aEvent.type) {
459+ case "click":
460+ aEvent.preventDefault();
461+ if (aEvent.target.classList.contains("newtab-control-block"))
462+ this.block();
463+ else if (this.isPinned())
464+ this.unpin();
465+ else
466+ this.pin();
467+ break;
468 case "mouseover":
469 this._node.removeEventListener("mouseover", this, false);
470 this._speculativeConnect();
471diff --git a/application/basilisk/base/content/tabbrowser.xml b/application/basilisk/base/content/tabbrowser.xml
472index df83f677f..e14342cf3 100644
473--- a/application/basilisk/base/content/tabbrowser.xml
474+++ b/application/basilisk/base/content/tabbrowser.xml
475@@ -1109,8 +1109,6 @@
476 }
477
478 if (!this._previewMode) {
479- this._recordTabAccess(this.mCurrentTab);
480-
481 this.mCurrentTab.updateLastAccessed();
482 this.mCurrentTab.removeAttribute("unread");
483 oldTab.updateLastAccessed();
484@@ -1300,45 +1298,6 @@
485 ]]></body>
486 </method>
487
488- <!--
489- This function assumes we have an LRU cache of tabs (either
490- images of tab content or their layers). The goal is to find
491- out how far into the cache we need to look in order to find
492- aTab. We record this number in telemetry and also move aTab to
493- the front of the cache.
494-
495- A newly created tab has position Infinity in the cache.
496- If a tab is closed, it has no effect on the position of other
497- tabs in the cache since we assume that closing a tab doesn't
498- cause us to load in any other tabs.
499-
500- We ignore the effect of dragging tabs between windows.
501- -->
502- <method name="_recordTabAccess">
503- <parameter name="aTab"/>
504- <body><![CDATA[
505- if (!Services.telemetry.canRecordExtended) {
506- return;
507- }
508-
509- let tabs = Array.from(this.visibleTabs);
510-
511- let pos = aTab.cachePosition;
512- for (let i = 0; i < tabs.length; i++) {
513- // If aTab is moving to the front, everything that was
514- // previously in front of it is bumped up one position.
515- if (tabs[i].cachePosition < pos) {
516- tabs[i].cachePosition++;
517- }
518- }
519- aTab.cachePosition = 0;
520-
521- if (isFinite(pos)) {
522- Services.telemetry.getHistogramById("TAB_SWITCH_CACHE_POSITION").add(pos);
523- }
524- ]]></body>
525- </method>
526-
527 <method name="_tabAttrModified">
528 <parameter name="aTab"/>
529 <parameter name="aChanged"/>
530@@ -2243,8 +2202,6 @@
531
532 if (animate) {
533 requestAnimationFrame(function () {
534- this.tabContainer._handleTabTelemetryStart(t, aURI);
535-
536 // kick the animation off
537 t.setAttribute("fadein", "true");
538 }.bind(this));
539@@ -2428,8 +2385,6 @@
540 return;
541 }
542
543- this.tabContainer._handleTabTelemetryStart(aTab);
544-
545 this._blurTab(aTab);
546 aTab.style.maxWidth = ""; // ensure that fade-out transition happens
547 aTab.removeAttribute("fadein");
548@@ -4069,7 +4024,7 @@
549 },
550
551 /*
552- * Telemetry and Profiler related helpers for recording tab switch
553+ * Profiler related helpers for recording tab switch
554 * timing.
555 */
556
557@@ -4697,7 +4652,6 @@
558 this.mCurrentTab.permanentKey = this.mCurrentBrowser.permanentKey;
559 this.mCurrentTab._tPos = 0;
560 this.mCurrentTab._fullyOpen = true;
561- this.mCurrentTab.cachePosition = 0;
562 this.mCurrentTab.linkedBrowser = this.mCurrentBrowser;
563 this.mCurrentTab.hasBrowser = true;
564 this._tabForBrowser.set(this.mCurrentBrowser, this.mCurrentTab);
565@@ -5846,81 +5800,6 @@
566 </body>
567 </method>
568
569- <method name="_handleTabTelemetryStart">
570- <parameter name="aTab"/>
571- <parameter name="aURI"/>
572- <body>
573- <![CDATA[
574- // Animation-smoothness telemetry/logging
575- if (Services.telemetry.canRecordExtended || this._tabAnimationLoggingEnabled) {
576- if (aURI == "about:newtab" && (aTab._tPos == 1 || aTab._tPos == 2)) {
577- // Indicate newtab page animation where other tabs are unaffected
578- // (for which case, the 2nd or 3rd tabs are good representatives, even if not absolute)
579- aTab._recordingTabOpenPlain = true;
580- }
581- aTab._recordingHandle = window.QueryInterface(Ci.nsIInterfaceRequestor)
582- .getInterface(Ci.nsIDOMWindowUtils)
583- .startFrameTimeRecording();
584- }
585-
586- // Overall animation duration
587- aTab._animStartTime = Date.now();
588- ]]>
589- </body>
590- </method>
591-
592- <method name="_handleTabTelemetryEnd">
593- <parameter name="aTab"/>
594- <body>
595- <![CDATA[
596- if (!aTab._animStartTime) {
597- return;
598- }
599-
600- aTab._animStartTime = 0;
601-
602- // Handle tab animation smoothness telemetry/logging of frame intervals and paint times
603- if (!("_recordingHandle" in aTab)) {
604- return;
605- }
606-
607- let intervals = window.QueryInterface(Ci.nsIInterfaceRequestor)
608- .getInterface(Ci.nsIDOMWindowUtils)
609- .stopFrameTimeRecording(aTab._recordingHandle);
610- delete aTab._recordingHandle;
611- let frameCount = intervals.length;
612-
613- if (this._tabAnimationLoggingEnabled) {
614- let msg = "Tab " + (aTab.closing ? "close" : "open") + " (Frame-interval):\n";
615- for (let i = 0; i < frameCount; i++) {
616- msg += Math.round(intervals[i]) + "\n";
617- }
618- Services.console.logStringMessage(msg);
619- }
620-
621- // For telemetry, the first frame interval is not useful since it may represent an interval
622- // to a relatively old frame (prior to recording start). So we'll ignore it for the average.
623- if (frameCount > 1) {
624- let averageInterval = 0;
625- for (let i = 1; i < frameCount; i++) {
626- averageInterval += intervals[i];
627- }
628- averageInterval = averageInterval / (frameCount - 1);
629-
630- Services.telemetry.getHistogramById("FX_TAB_ANIM_ANY_FRAME_INTERVAL_MS").add(averageInterval);
631-
632- if (aTab._recordingTabOpenPlain) {
633- delete aTab._recordingTabOpenPlain;
634- // While we do have a telemetry probe NEWTAB_PAGE_ENABLED to monitor newtab preview, it'll be
635- // easier to overview the data without slicing by it. Hence the additional histograms with _PREVIEW.
636- let preview = this._browserNewtabpageEnabled ? "_PREVIEW" : "";
637- Services.telemetry.getHistogramById("FX_TAB_ANIM_OPEN" + preview + "_FRAME_INTERVAL_MS").add(averageInterval);
638- }
639- }
640- ]]>
641- </body>
642- </method>
643-
644 <!-- Deprecated stuff, implemented for backwards compatibility. -->
645 <property name="mAllTabsPopup" readonly="true"
646 onget="return document.getElementById('alltabs-popup');"/>
647@@ -5935,8 +5814,6 @@
648
649 var tab = event.target;
650
651- this._handleTabTelemetryEnd(tab);
652-
653 if (tab.getAttribute("fadein") == "true") {
654 if (tab._fullyOpen)
655 this.adjustTabstrip();
656@@ -6610,8 +6487,6 @@
657 ]]></body>
658 </method>
659
660- <field name="cachePosition">Infinity</field>
661-
662 <field name="mOverCloseButton">false</field>
663 <property name="_overPlayingIcon" readonly="true">
664 <getter><![CDATA[
665diff --git a/application/basilisk/components/migration/AutoMigrate.jsm b/application/basilisk/components/migration/AutoMigrate.jsm
666index 003f70d70..856805798 100644
667--- a/application/basilisk/components/migration/AutoMigrate.jsm
668+++ b/application/basilisk/components/migration/AutoMigrate.jsm
669@@ -93,29 +93,21 @@ const AutoMigrate = {
670 * failed for some reason.
671 */
672 migrate(profileStartup, migratorKey, profileToMigrate) {
673- let histogram = Services.telemetry.getHistogramById(
674- "FX_STARTUP_MIGRATION_AUTOMATED_IMPORT_PROCESS_SUCCESS");
675- histogram.add(0);
676 let {migrator, pickedKey} = this.pickMigrator(migratorKey);
677- histogram.add(5);
678
679 profileToMigrate = this.pickProfile(migrator, profileToMigrate);
680- histogram.add(10);
681
682 let resourceTypes = migrator.getMigrateData(profileToMigrate, profileStartup);
683 if (!(resourceTypes & this.resourceTypesToUse)) {
684 throw new Error("No usable resources were found for the selected browser!");
685 }
686- histogram.add(15);
687
688 let sawErrors = false;
689 let migrationObserver = (subject, topic) => {
690 if (topic == "Migration:ItemError") {
691 sawErrors = true;
692 } else if (topic == "Migration:Ended") {
693- histogram.add(25);
694 if (sawErrors) {
695- histogram.add(26);
696 }
697 Services.obs.removeObserver(migrationObserver, "Migration:Ended");
698 Services.obs.removeObserver(migrationObserver, "Migration:ItemError");
699@@ -132,7 +124,6 @@ const AutoMigrate = {
700 Services.obs.addObserver(migrationObserver, "Migration:Ended", false);
701 Services.obs.addObserver(migrationObserver, "Migration:ItemError", false);
702 migrator.migrate(this.resourceTypesToUse, profileStartup, profileToMigrate);
703- histogram.add(20);
704 },
705
706 /**
707@@ -209,50 +200,35 @@ const AutoMigrate = {
708
709 undo: Task.async(function* () {
710 let browserId = Preferences.get(kAutoMigrateBrowserPref, "unknown");
711- let histogram = Services.telemetry.getHistogramById("FX_STARTUP_MIGRATION_AUTOMATED_IMPORT_UNDO");
712- histogram.add(0);
713 if (!(yield this.canUndo())) {
714- histogram.add(5);
715 throw new Error("Can't undo!");
716 }
717
718 this._pendingUndoTasks = true;
719 this._removeNotificationBars();
720- histogram.add(10);
721
722 let readPromise = OS.File.read(kUndoStateFullPath, {
723 encoding: "utf-8",
724 compression: "lz4",
725 });
726 let stateData = this._dejsonifyUndoState(yield readPromise);
727- histogram.add(12);
728
729 this._errorMap = {bookmarks: 0, visits: 0, logins: 0};
730- let reportErrorTelemetry = (type) => {
731- let histogramId = `FX_STARTUP_MIGRATION_UNDO_${type.toUpperCase()}_ERRORCOUNT`;
732- Services.telemetry.getKeyedHistogramById(histogramId).add(browserId, this._errorMap[type]);
733- };
734
735 yield this._removeUnchangedBookmarks(stateData.get("bookmarks")).catch(ex => {
736 Cu.reportError("Uncaught exception when removing unchanged bookmarks!");
737 Cu.reportError(ex);
738 });
739- reportErrorTelemetry("bookmarks");
740- histogram.add(15);
741
742 yield this._removeSomeVisits(stateData.get("visits")).catch(ex => {
743 Cu.reportError("Uncaught exception when removing history visits!");
744 Cu.reportError(ex);
745 });
746- reportErrorTelemetry("visits");
747- histogram.add(20);
748
749 yield this._removeUnchangedLogins(stateData.get("logins")).catch(ex => {
750 Cu.reportError("Uncaught exception when removing unchanged logins!");
751 Cu.reportError(ex);
752 });
753- reportErrorTelemetry("logins");
754- histogram.add(25);
755
756 // This is async, but no need to wait for it.
757 NewTabUtils.links.populateCache(() => {
758@@ -260,7 +236,6 @@ const AutoMigrate = {
759 }, true);
760
761 this._purgeUndoState(this.UNDO_REMOVED_REASON_UNDO_USED);
762- histogram.add(30);
763 }),
764
765 _removeNotificationBars() {
766@@ -288,10 +263,6 @@ const AutoMigrate = {
767
768 let migrationBrowser = Preferences.get(kAutoMigrateBrowserPref, "unknown");
769 Services.prefs.clearUserPref(kAutoMigrateBrowserPref);
770-
771- let histogram =
772- Services.telemetry.getKeyedHistogramById("FX_STARTUP_MIGRATION_UNDO_REASON");
773- histogram.add(migrationBrowser, reason);
774 },
775
776 getBrowserUsedForMigration() {
777@@ -367,7 +338,6 @@ const AutoMigrate = {
778 message, kNotificationId, null, notificationBox.PRIORITY_INFO_HIGH, buttons
779 );
780 let remainingDays = Preferences.get(kAutoMigrateDaysToOfferUndoPref, 0);
781- Services.telemetry.getHistogramById("FX_STARTUP_MIGRATION_UNDO_OFFERED").add(4 - remainingDays);
782 }),
783
784 shouldStillShowUndoPrompt() {
785diff --git a/application/basilisk/components/migration/FirefoxProfileMigrator.js b/application/basilisk/components/migration/FirefoxProfileMigrator.js
786index 2714cdbcd..8f786e463 100644
787--- a/application/basilisk/components/migration/FirefoxProfileMigrator.js
788+++ b/application/basilisk/components/migration/FirefoxProfileMigrator.js
789@@ -170,77 +170,8 @@ FirefoxProfileMigrator.prototype._getResourcesInternal = function(sourceProfileD
790 };
791 }
792
793- // Telemetry related migrations.
794- let times = {
795- name: "times", // name is used only by tests.
796- type: types.OTHERDATA,
797- migrate: aCallback => {
798- let file = this._getFileObject(sourceProfileDir, "times.json");
799- if (file) {
800- file.copyTo(currentProfileDir, "");
801- }
802- // And record the fact a migration (ie, a reset) happened.
803- let timesAccessor = new ProfileAge(currentProfileDir.path);
804- timesAccessor.recordProfileReset().then(
805- () => aCallback(true),
806- () => aCallback(false)
807- );
808- }
809- };
810- let telemetry = {
811- name: "telemetry", // name is used only by tests...
812- type: types.OTHERDATA,
813- migrate: aCallback => {
814- let createSubDir = (name) => {
815- let dir = currentProfileDir.clone();
816- dir.append(name);
817- dir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
818- return dir;
819- };
820-
821- // If the 'datareporting' directory exists we migrate files from it.
822- let haveStateFile = false;
823- let dataReportingDir = this._getFileObject(sourceProfileDir, "datareporting");
824- if (dataReportingDir && dataReportingDir.isDirectory()) {
825- // Copy only specific files.
826- let toCopy = ["state.json", "session-state.json"];
827-
828- let dest = createSubDir("datareporting");
829- let enumerator = dataReportingDir.directoryEntries;
830- while (enumerator.hasMoreElements()) {
831- let file = enumerator.getNext().QueryInterface(Ci.nsIFile);
832- if (file.isDirectory() || toCopy.indexOf(file.leafName) == -1) {
833- continue;
834- }
835-
836- if (file.leafName == "state.json") {
837- haveStateFile = true;
838- }
839- file.copyTo(dest, "");
840- }
841- }
842-
843- if (!haveStateFile) {
844- // Fall back to migrating the state file that contains the client id from healthreport/.
845- // We first moved the client id management from the FHR implementation to the datareporting
846- // service.
847- // Consequently, we try to migrate an existing FHR state file here as a fallback.
848- let healthReportDir = this._getFileObject(sourceProfileDir, "healthreport");
849- if (healthReportDir && healthReportDir.isDirectory()) {
850- let stateFile = this._getFileObject(healthReportDir, "state.json");
851- if (stateFile) {
852- let dest = createSubDir("healthreport");
853- stateFile.copyTo(dest, "");
854- }
855- }
856- }
857-
858- aCallback(true);
859- }
860- };
861-
862 return [places, cookies, passwords, formData, dictionary, bookmarksBackups,
863- session, times, telemetry].filter(r => r);
864+ session].filter(r => r);
865 };
866
867 Object.defineProperty(FirefoxProfileMigrator.prototype, "startupOnlyMigrator", {
868diff --git a/application/basilisk/components/migration/MigrationUtils.jsm b/application/basilisk/components/migration/MigrationUtils.jsm
869index ccae006fe..db5a02637 100644
870--- a/application/basilisk/components/migration/MigrationUtils.jsm
871+++ b/application/basilisk/components/migration/MigrationUtils.jsm
872@@ -262,30 +262,9 @@ this.MigratorPrototype = {
873 return {responsivenessMonitor, responsivenessHistogramId};
874 };
875
876- let maybeFinishResponsivenessMonitor = (responsivenessMonitor, histogramId) => {
877+ let maybeFinishResponsivenessMonitor = (responsivenessMonitor) => {
878 if (responsivenessMonitor) {
879 let accumulatedDelay = responsivenessMonitor.finish();
880- if (histogramId) {
881- try {
882- Services.telemetry.getKeyedHistogramById(histogramId)
883- .add(browserKey, accumulatedDelay);
884- } catch (ex) {
885- Cu.reportError(histogramId + ": " + ex);
886- }
887- }
888- }
889- };
890-
891- let collectQuantityTelemetry = () => {
892- for (let resourceType of Object.keys(MigrationUtils._importQuantities)) {
893- let histogramId =
894- "FX_MIGRATION_" + resourceType.toUpperCase() + "_QUANTITY";
895- try {
896- Services.telemetry.getKeyedHistogramById(histogramId)
897- .add(browserKey, MigrationUtils._importQuantities[resourceType]);
898- } catch (ex) {
899- Cu.reportError(histogramId + ": " + ex);
900- }
901 }
902 };
903
904@@ -306,9 +285,6 @@ this.MigratorPrototype = {
905 Services.obs.notifyObservers(null, aMsg, aItemType);
906 };
907
908- for (let resourceType of Object.keys(MigrationUtils._importQuantities)) {
909- MigrationUtils._importQuantities[resourceType] = 0;
910- }
911 notify("Migration:Started");
912 for (let [migrationType, itemResources] of resourcesGroupedByItems) {
913 notify("Migration:ItemBeforeMigrate", migrationType);
914@@ -331,7 +307,6 @@ this.MigratorPrototype = {
915 maybeFinishResponsivenessMonitor(responsivenessMonitor, responsivenessHistogramId);
916
917 if (resourcesGroupedByItems.size == 0) {
918- collectQuantityTelemetry();
919 notify("Migration:Ended");
920 }
921 }
922@@ -960,14 +935,7 @@ this.MigrationUtils = Object.freeze({
923 this.showMigrationWizard(null, params);
924 },
925
926- _importQuantities: {
927- bookmarks: 0,
928- logins: 0,
929- history: 0,
930- },
931-
932 insertBookmarkWrapper(bookmark) {
933- this._importQuantities.bookmarks++;
934 let insertionPromise = PlacesUtils.bookmarks.insert(bookmark);
935 if (!gKeepUndoData) {
936 return insertionPromise;
937@@ -985,7 +953,6 @@ this.MigrationUtils = Object.freeze({
938 },
939
940 insertVisitsWrapper(places, options) {
941- this._importQuantities.history += places.length;
942 if (gKeepUndoData) {
943 this._updateHistoryUndo(places);
944 }
945@@ -993,7 +960,6 @@ this.MigrationUtils = Object.freeze({
946 },
947
948 insertLoginWrapper(login) {
949- this._importQuantities.logins++;
950 let insertedLogin = LoginHelper.maybeImportLogin(login);
951 // Note that this means that if we import a login that has a newer password
952 // than we know about, we will update the login, and an undo of the import
953@@ -1096,7 +1062,4 @@ this.MigrationUtils = Object.freeze({
954 "safari": 8,
955 "360se": 9,
956 },
957- getSourceIdForTelemetry(sourceName) {
958- return this._sourceNameToIdMapping[sourceName] || 0;
959- },
960 });
961diff --git a/application/basilisk/components/migration/content/migration.js b/application/basilisk/components/migration/content/migration.js
962index eb2175628..50c187c87 100644
963--- a/application/basilisk/components/migration/content/migration.js
964+++ b/application/basilisk/components/migration/content/migration.js
965@@ -35,7 +35,6 @@ var MigrationWizard = { /* exported MigrationWizard */
966
967 let args = window.arguments;
968 let entryPointId = args[0] || MigrationUtils.MIGRATION_ENTRYPOINT_UNKNOWN;
969- Services.telemetry.getHistogramById("FX_MIGRATION_ENTRY_POINT").add(entryPointId);
970 this.isInitialMigration = entryPointId == MigrationUtils.MIGRATION_ENTRYPOINT_FIRSTRUN;
971
972 if (args.length > 1) {
973@@ -105,15 +104,6 @@ var MigrationWizard = { /* exported MigrationWizard */
974 }
975 }
976 }
977- if (this.isInitialMigration) {
978- Services.telemetry.getHistogramById("FX_STARTUP_MIGRATION_BROWSER_COUNT")
979- .add(this._availableMigrators.length);
980- let defaultBrowser = MigrationUtils.getMigratorKeyForDefaultBrowser();
981- // This will record 0 for unknown default browser IDs.
982- defaultBrowser = MigrationUtils.getSourceIdForTelemetry(defaultBrowser);
983- Services.telemetry.getHistogramById("FX_STARTUP_MIGRATION_EXISTING_DEFAULT_BROWSER")
984- .add(defaultBrowser);
985- }
986
987 group.addEventListener("command", toggleCloseBrowserWarning);
988
989@@ -142,11 +132,6 @@ var MigrationWizard = { /* exported MigrationWizard */
990 var newSource = document.getElementById("importSourceGroup").selectedItem.id;
991
992 if (newSource == "nothing") {
993- // Need to do telemetry here because we're closing the dialog before we get to
994- // do actual migration. For actual migration, this doesn't happen until after
995- // migration takes place.
996- Services.telemetry.getHistogramById("FX_MIGRATION_SOURCE_BROWSER")
997- .add(MigrationUtils.getSourceIdForTelemetry("nothing"));
998 document.documentElement.cancel();
999 return false;
1000 }
1001@@ -360,27 +345,12 @@ var MigrationWizard = { /* exported MigrationWizard */
1002 this._itemsFlags = this._migrator.getMigrateData(this._selectedProfile, this._autoMigrate);
1003
1004 this._listItems("migratingItems");
1005- setTimeout(() => this.onMigratingMigrate(), 0);
1006+ setTimeout(this.onMigratingMigrate, 0, this);
1007 },
1008
1009- onMigratingMigrate: function ()
1010+ onMigratingMigrate: function (aOuter)
1011 {
1012- this._migrator.migrate(this._itemsFlags, this._autoMigrate, this._selectedProfile);
1013-
1014- Services.telemetry.getHistogramById("FX_MIGRATION_SOURCE_BROWSER")
1015- .add(MigrationUtils.getSourceIdForTelemetry(this._source));
1016- if (!this._autoMigrate) {
1017- let hist = Services.telemetry.getKeyedHistogramById("FX_MIGRATION_USAGE");
1018- let exp = 0;
1019- let items = this._itemsFlags;
1020- while (items) {
1021- if (items & 1) {
1022- hist.add(this._source, exp);
1023- }
1024- items = items >> 1;
1025- exp++;
1026- }
1027- }
1028+ aOuter._migrator.migrate(aOuter._itemsFlags, aOuter._autoMigrate, aOuter._selectedProfile);
1029 },
1030
1031 _listItems: function (aID)
1032@@ -426,18 +396,8 @@ var MigrationWizard = { /* exported MigrationWizard */
1033 label.removeAttribute("style");
1034 break;
1035 case "Migration:Ended":
1036- if (this.isInitialMigration) {
1037- // Ensure errors in reporting data recency do not affect the rest of the migration.
1038- try {
1039- this.reportDataRecencyTelemetry();
1040- } catch (ex) {
1041- Cu.reportError(ex);
1042- }
1043- }
1044 if (this._autoMigrate) {
1045 let hasImportedHomepage = !!(this._newHomePage && this._newHomePage != "DEFAULT");
1046- Services.telemetry.getKeyedHistogramById("FX_MIGRATION_IMPORTED_HOMEPAGE")
1047- .add(this._source, hasImportedHomepage);
1048 if (this._newHomePage) {
1049 try {
1050 // set homepage properly
1051@@ -508,8 +468,6 @@ var MigrationWizard = { /* exported MigrationWizard */
1052 Cc["@mozilla.org/consoleservice;1"]
1053 .getService(Ci.nsIConsoleService)
1054 .logStringMessage("some " + type + " did not successfully migrate.");
1055- Services.telemetry.getKeyedHistogramById("FX_MIGRATION_ERRORS")
1056- .add(this._source, Math.log2(numericType));
1057 break;
1058 }
1059 },
1060@@ -520,30 +478,4 @@ var MigrationWizard = { /* exported MigrationWizard */
1061 this._wiz.canRewind = false;
1062 this._listItems("doneItems");
1063 },
1064-
1065- reportDataRecencyTelemetry() {
1066- let histogram = Services.telemetry.getKeyedHistogramById("FX_STARTUP_MIGRATION_DATA_RECENCY");
1067- let lastUsedPromises = [];
1068- for (let [key, migrator] of this._availableMigrators) {
1069- // No block-scoped let in for...of loop conditions, so get the source:
1070- let localKey = key;
1071- lastUsedPromises.push(migrator.getLastUsedDate().then(date => {
1072- const ONE_YEAR = 24 * 365;
1073- let diffInHours = Math.round((Date.now() - date) / (60 * 60 * 1000));
1074- if (diffInHours > ONE_YEAR) {
1075- diffInHours = ONE_YEAR;
1076- }
1077- histogram.add(localKey, diffInHours);
1078- return [localKey, diffInHours];
1079- }));
1080- }
1081- Promise.all(lastUsedPromises).then(migratorUsedTimeDiff => {
1082- // Sort low to high.
1083- migratorUsedTimeDiff.sort(([keyA, diffA], [keyB, diffB]) => diffA - diffB); /* eslint no-unused-vars: off */
1084- let usedMostRecentBrowser = migratorUsedTimeDiff.length && this._source == migratorUsedTimeDiff[0][0];
1085- let usedRecentBrowser =
1086- Services.telemetry.getKeyedHistogramById("FX_STARTUP_MIGRATION_USED_RECENT_BROWSER");
1087- usedRecentBrowser.add(this._source, usedMostRecentBrowser);
1088- });
1089- },
1090 };
1091diff --git a/application/basilisk/components/nsBrowserContentHandler.js b/application/basilisk/components/nsBrowserContentHandler.js
1092index d65e52594..93851f84a 100644
1093--- a/application/basilisk/components/nsBrowserContentHandler.js
1094+++ b/application/basilisk/components/nsBrowserContentHandler.js
1095@@ -235,17 +235,8 @@ function openPreferences() {
1096 args);
1097 }
1098
1099-function logSystemBasedSearch(engine) {
1100- var countId = (engine.identifier || ("other-" + engine.name)) + ".system";
1101- var count = Services.telemetry.getKeyedHistogramById("SEARCH_COUNTS");
1102- count.add(countId);
1103-}
1104-
1105 function doSearch(searchTerm, cmdLine) {
1106- var engine = Services.search.defaultEngine;
1107- logSystemBasedSearch(engine);
1108-
1109- var submission = engine.getSubmission(searchTerm, null, "system");
1110+ var submission = ss.defaultEngine.getSubmission(searchTerm, null, "system");
1111
1112 // fill our nsIMutableArray with uri-as-wstring, null, null, postData
1113 var args = Components.classes["@mozilla.org/array;1"]
1114@@ -688,18 +679,6 @@ nsDefaultCommandLineHandler.prototype = {
1115
1116 /* nsICommandLineHandler */
1117 handle : function dch_handle(cmdLine) {
1118- // The -url flag is inserted by the operating system when the default
1119- // application handler is used. We check for default browser to remove
1120- // instances where users explicitly decide to "open with" the browser.
1121- // Note that users who launch firefox manually with the -url flag will
1122- // get erroneously counted.
1123- try {
1124- if (cmdLine.findFlag("url", false) &&
1125- ShellService.isDefaultBrowser(false, false)) {
1126- Services.telemetry.getHistogramById("FX_STARTUP_EXTERNAL_CONTENT_HANDLER").add();
1127- }
1128- } catch (e) {}
1129-
1130 var urilist = [];
1131
1132 if (AppConstants.platform == "win") {
1133diff --git a/application/basilisk/components/places/content/browserPlacesViews.js b/application/basilisk/components/places/content/browserPlacesViews.js
1134index c6ee9b6ce..bab882561 100644
1135--- a/application/basilisk/components/places/content/browserPlacesViews.js
1136+++ b/application/basilisk/components/places/content/browserPlacesViews.js
1137@@ -980,9 +980,6 @@ function PlacesToolbar(aPlace) {
1138 }
1139
1140 PlacesViewBase.call(this, aPlace);
1141-
1142- Services.telemetry.getHistogramById("FX_BOOKMARKS_TOOLBAR_INIT_MS")
1143- .add(Date.now() - startTime);
1144 }
1145
1146 PlacesToolbar.prototype = {
1147diff --git a/application/basilisk/components/preferences/in-content/advanced.js b/application/basilisk/components/preferences/in-content/advanced.js
1148index 850f0e09f..da6ce30db 100644
1149--- a/application/basilisk/components/preferences/in-content/advanced.js
1150+++ b/application/basilisk/components/preferences/in-content/advanced.js
1151@@ -40,10 +40,6 @@ var gAdvancedPane = {
1152 this.updateReadPrefs();
1153 }
1154 this.updateOfflineApps();
1155- this.initTelemetry();
1156- if (AppConstants.MOZ_TELEMETRY_REPORTING) {
1157- this.initSubmitHealthReport();
1158- }
1159 this.updateOnScreenKeyboardVisibility();
1160 this.updateCacheSizeInputField();
1161 this.updateActualCacheSize();
1162@@ -53,10 +49,6 @@ var gAdvancedPane = {
1163 gAdvancedPane.updateHardwareAcceleration);
1164 setEventListener("advancedPrefs", "select",
1165 gAdvancedPane.tabSelectionChanged);
1166- if (AppConstants.MOZ_TELEMETRY_REPORTING) {
1167- setEventListener("submitHealthReportBox", "command",
1168- gAdvancedPane.updateSubmitHealthReport);
1169- }
1170
1171 setEventListener("connectionSettings", "command",
1172 gAdvancedPane.showConnections);
1173@@ -107,15 +99,6 @@ var gAdvancedPane = {
1174 var advancedPrefs = document.getElementById("advancedPrefs");
1175 var preference = document.getElementById("browser.preferences.advanced.selectedTabIndex");
1176
1177- // tabSelectionChanged gets called twice due to the selectedIndex being set
1178- // by both the selectedItem and selectedPanel callstacks. This guard is used
1179- // to prevent double-counting in Telemetry.
1180- if (preference.valueFromPreferences != advancedPrefs.selectedIndex) {
1181- Services.telemetry
1182- .getHistogramById("FX_PREFERENCES_CATEGORY_OPENED")
1183- .add(telemetryBucketForCategory("advanced"));
1184- }
1185-
1186 preference.valueFromPreferences = advancedPrefs.selectedIndex;
1187 },
1188
1189@@ -249,66 +232,6 @@ var gAdvancedPane = {
1190 "crashReporterLearnMore");
1191 },
1192
1193- /**
1194- * The preference/checkbox is configured in XUL.
1195- *
1196- * In all cases, set up the Learn More link sanely.
1197- */
1198- initTelemetry: function ()
1199- {
1200- if (AppConstants.MOZ_TELEMETRY_REPORTING) {
1201- this._setupLearnMoreLink("toolkit.telemetry.infoURL", "telemetryLearnMore");
1202- }
1203- },
1204-
1205- /**
1206- * Set the status of the telemetry controls based on the input argument.
1207- * @param {Boolean} aEnabled False disables the controls, true enables them.
1208- */
1209- setTelemetrySectionEnabled: function (aEnabled)
1210- {
1211- if (AppConstants.MOZ_TELEMETRY_REPORTING) {
1212- // If FHR is disabled, additional data sharing should be disabled as well.
1213- let disabled = !aEnabled;
1214- document.getElementById("submitTelemetryBox").disabled = disabled;
1215- if (disabled) {
1216- // If we disable FHR, untick the telemetry checkbox.
1217- Services.prefs.setBoolPref("toolkit.telemetry.enabled", false);
1218- }
1219- document.getElementById("telemetryDataDesc").disabled = disabled;
1220- }
1221- },
1222-
1223- /**
1224- * Initialize the health report service reference and checkbox.
1225- */
1226- initSubmitHealthReport: function () {
1227- if (AppConstants.MOZ_TELEMETRY_REPORTING) {
1228- this._setupLearnMoreLink("datareporting.healthreport.infoURL", "FHRLearnMore");
1229-
1230- let checkbox = document.getElementById("submitHealthReportBox");
1231-
1232- if (Services.prefs.prefIsLocked(PREF_UPLOAD_ENABLED)) {
1233- checkbox.setAttribute("disabled", "true");
1234- return;
1235- }
1236-
1237- checkbox.checked = Services.prefs.getBoolPref(PREF_UPLOAD_ENABLED);
1238- this.setTelemetrySectionEnabled(checkbox.checked);
1239- }
1240- },
1241-
1242- /**
1243- * Update the health report preference with state from checkbox.
1244- */
1245- updateSubmitHealthReport: function () {
1246- if (AppConstants.MOZ_TELEMETRY_REPORTING) {
1247- let checkbox = document.getElementById("submitHealthReportBox");
1248- Services.prefs.setBoolPref(PREF_UPLOAD_ENABLED, checkbox.checked);
1249- this.setTelemetrySectionEnabled(checkbox.checked);
1250- }
1251- },
1252-
1253 updateOnScreenKeyboardVisibility() {
1254 if (AppConstants.platform == "win") {
1255 let minVersion = Services.prefs.getBoolPref("ui.osk.require_win10") ? 10 : 6.2;
1256diff --git a/application/basilisk/components/preferences/in-content/advanced.xul b/application/basilisk/components/preferences/in-content/advanced.xul
1257index 50e276501..b428ed7e0 100644
1258--- a/application/basilisk/components/preferences/in-content/advanced.xul
1259+++ b/application/basilisk/components/preferences/in-content/advanced.xul
1260@@ -48,12 +48,6 @@
1261 name="layout.spellcheckDefault"
1262 type="int"/>
1263
1264-#ifdef MOZ_TELEMETRY_REPORTING
1265- <preference id="toolkit.telemetry.enabled"
1266- name="toolkit.telemetry.enabled"
1267- type="bool"/>
1268-#endif
1269-
1270 <!-- Network tab -->
1271 <preference id="browser.cache.disk.capacity"
1272 name="browser.cache.disk.capacity"
1273@@ -186,42 +180,6 @@
1274 preference="layout.spellcheckDefault"/>
1275 </groupbox>
1276 </tabpanel>
1277-#ifdef MOZ_DATA_REPORTING
1278- <!-- Data Choices -->
1279- <tabpanel id="dataChoicesPanel" orient="vertical">
1280-#ifdef MOZ_TELEMETRY_REPORTING
1281- <groupbox>
1282- <caption>
1283- <checkbox id="submitHealthReportBox" label="&enableHealthReport.label;"
1284- accesskey="&enableHealthReport.accesskey;"/>
1285- </caption>
1286- <vbox>
1287- <hbox class="indent">
1288- <label flex="1">&healthReportDesc.label;</label>
1289- <spacer flex="10"/>
1290- <label id="FHRLearnMore"
1291- class="text-link">&healthReportLearnMore.label;</label>
1292- </hbox>
1293- <hbox class="indent">
1294- <groupbox flex="1">
1295- <caption>
1296- <checkbox id="submitTelemetryBox" preference="toolkit.telemetry.enabled"
1297- label="&enableTelemetryData.label;"
1298- accesskey="&enableTelemetryData.accesskey;"/>
1299- </caption>
1300- <hbox class="indent">
1301- <label id="telemetryDataDesc" flex="1">&telemetryDesc.label;</label>
1302- <spacer flex="10"/>
1303- <label id="telemetryLearnMore"
1304- class="text-link">&telemetryLearnMore.label;</label>
1305- </hbox>
1306- </groupbox>
1307- </hbox>
1308- </vbox>
1309- </groupbox>
1310-#endif
1311- </tabpanel>
1312-#endif
1313
1314 <!-- Network -->
1315 <tabpanel id="networkPanel" orient="vertical">
1316diff --git a/application/basilisk/components/preferences/in-content/content.js b/application/basilisk/components/preferences/in-content/content.js
1317index 2eac10ca4..80f058aeb 100644
1318--- a/application/basilisk/components/preferences/in-content/content.js
1319+++ b/application/basilisk/components/preferences/in-content/content.js
1320@@ -117,11 +117,6 @@ var gContentPane = {
1321
1322 gSubDialog.open("chrome://browser/content/preferences/permissions.xul",
1323 "resizable=yes", params);
1324-
1325- try {
1326- Services.telemetry
1327- .getHistogramById("WEB_NOTIFICATION_EXCEPTIONS_OPENED").add();
1328- } catch (e) {}
1329 },
1330
1331
1332diff --git a/application/basilisk/components/preferences/in-content/preferences.js b/application/basilisk/components/preferences/in-content/preferences.js
1333index 69cb180d5..f6a6941ce 100644
1334--- a/application/basilisk/components/preferences/in-content/preferences.js
1335+++ b/application/basilisk/components/preferences/in-content/preferences.js
1336@@ -124,36 +124,6 @@ function init_dynamic_padding() {
1337 document.documentElement.appendChild(mediaStyle);
1338 }
1339
1340-function telemetryBucketForCategory(category) {
1341- switch (category) {
1342- case "general":
1343- case "search":
1344- case "content":
1345- case "applications":
1346- case "privacy":
1347- case "security":
1348- case "sync":
1349- return category;
1350- case "advanced":
1351- let advancedPaneTabs = document.getElementById("advancedPrefs");
1352- switch (advancedPaneTabs.selectedTab.id) {
1353- case "generalTab":
1354- return "advancedGeneral";
1355- case "dataChoicesTab":
1356- return "advancedDataChoices";
1357- case "networkTab":
1358- return "advancedNetwork";
1359- case "updateTab":
1360- return "advancedUpdates";
1361- case "encryptionTab":
1362- return "advancedCerts";
1363- }
1364- // fall-through for unknown.
1365- default:
1366- return "unknown";
1367- }
1368-}
1369-
1370 function onHashChange() {
1371 gotoPref();
1372 }
1373@@ -194,10 +164,6 @@ function gotoPref(aCategory) {
1374 search(category, "data-category");
1375 let mainContent = document.querySelector(".main-content");
1376 mainContent.scrollTop = 0;
1377-
1378- Services.telemetry
1379- .getHistogramById("FX_PREFERENCES_CATEGORY_OPENED")
1380- .add(telemetryBucketForCategory(friendlyName));
1381 }
1382
1383 function search(aQuery, aAttribute) {
1384diff --git a/application/basilisk/components/search/content/searchReset.js b/application/basilisk/components/search/content/searchReset.js
1385index b541d41da..cfbddf945 100644
1386--- a/application/basilisk/components/search/content/searchReset.js
1387+++ b/application/basilisk/components/search/content/searchReset.js
1388@@ -8,14 +8,6 @@ var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
1389
1390 Cu.import("resource://gre/modules/Services.jsm");
1391
1392-const TELEMETRY_RESULT_ENUM = {
1393- RESTORED_DEFAULT: 0,
1394- KEPT_CURRENT: 1,
1395- CHANGED_ENGINE: 2,
1396- CLOSED_PAGE: 3,
1397- OPENED_SETTINGS: 4
1398-};
1399-
1400 window.onload = function() {
1401 let defaultEngine = document.getElementById("defaultEngine");
1402 let originalDefault = Services.search.originalDefaultEngine;
1403@@ -24,7 +16,6 @@ window.onload = function() {
1404 'url("' + originalDefault.iconURI.spec + '")';
1405
1406 document.getElementById("searchResetChangeEngine").focus();
1407- window.addEventListener("unload", recordPageClosed);
1408 document.getElementById("linkSettingsPage")
1409 .addEventListener("click", openingSettings);
1410 };
1411@@ -57,20 +48,9 @@ function doSearch() {
1412 win.openUILinkIn(submission.uri.spec, "current", false, submission.postData);
1413 }
1414
1415-function openingSettings() {
1416- record(TELEMETRY_RESULT_ENUM.OPENED_SETTINGS);
1417- window.removeEventListener("unload", recordPageClosed);
1418-}
1419-
1420-function record(result) {
1421- Services.telemetry.getHistogramById("SEARCH_RESET_RESULT").add(result);
1422-}
1423-
1424 function keepCurrentEngine() {
1425 // Calling the currentEngine setter will force a correct loadPathHash to be
1426 // written for this engine, so that we don't prompt the user again.
1427- Services.search.currentEngine = Services.search.currentEngine;
1428- record(TELEMETRY_RESULT_ENUM.KEPT_CURRENT);
1429 doSearch();
1430 }
1431
1432@@ -80,11 +60,5 @@ function changeSearchEngine() {
1433 engine.hidden = false;
1434 Services.search.currentEngine = engine;
1435
1436- record(TELEMETRY_RESULT_ENUM.RESTORED_DEFAULT);
1437-
1438 doSearch();
1439 }
1440-
1441-function recordPageClosed() {
1442- record(TELEMETRY_RESULT_ENUM.CLOSED_PAGE);
1443-}
1444diff --git a/application/basilisk/components/search/service/nsSearchService.js b/application/basilisk/components/search/service/nsSearchService.js
1445index b4db31dee..aaa719ec5 100644
1446--- a/application/basilisk/components/search/service/nsSearchService.js
1447+++ b/application/basilisk/components/search/service/nsSearchService.js
1448@@ -2309,8 +2309,6 @@ SearchService.prototype = {
1449 this._initObservers.resolve(this._initRV);
1450
1451 Services.obs.notifyObservers(null, SEARCH_SERVICE_TOPIC, "init-complete");
1452- Services.telemetry.getHistogramById("SEARCH_SERVICE_INIT_SYNC").add(true);
1453- this._recordEngineTelemetry();
1454
1455 LOG("_syncInit end");
1456 },
1457@@ -2348,8 +2346,6 @@ SearchService.prototype = {
1458 this._cacheFileJSON = null;
1459 this._initObservers.resolve(this._initRV);
1460 Services.obs.notifyObservers(null, SEARCH_SERVICE_TOPIC, "init-complete");
1461- Services.telemetry.getHistogramById("SEARCH_SERVICE_INIT_SYNC").add(false);
1462- this._recordEngineTelemetry();
1463
1464 LOG("_asyncInit: Completed _asyncInit");
1465 }),
1466@@ -2715,7 +2711,6 @@ SearchService.prototype = {
1467 // Typically we'll re-init as a result of a pref observer,
1468 // so signal to 'callers' that we're done.
1469 Services.obs.notifyObservers(null, SEARCH_SERVICE_TOPIC, "init-complete");
1470- this._recordEngineTelemetry();
1471 gInitialized = true;
1472 } catch (err) {
1473 LOG("Reinit failed: " + err);
1474@@ -3892,25 +3887,6 @@ SearchService.prototype = {
1475 return result;
1476 },
1477
1478- _recordEngineTelemetry: function() {
1479- Services.telemetry.getHistogramById("SEARCH_SERVICE_ENGINE_COUNT")
1480- .add(Object.keys(this._engines).length);
1481- let hasUpdates = false;
1482- let hasIconUpdates = false;
1483- for (let name in this._engines) {
1484- let engine = this._engines[name];
1485- if (engine._hasUpdates) {
1486- hasUpdates = true;
1487- if (engine._iconUpdateURL) {
1488- hasIconUpdates = true;
1489- break;
1490- }
1491- }
1492- }
1493- Services.telemetry.getHistogramById("SEARCH_SERVICE_HAS_UPDATES").add(hasUpdates);
1494- Services.telemetry.getHistogramById("SEARCH_SERVICE_HAS_ICON_UPDATES").add(hasIconUpdates);
1495- },
1496-
1497 /**
1498 * This map is built lazily after the available search engines change. It
1499 * allows quick parsing of an URL representing a search submission into the
1500diff --git a/application/basilisk/components/sessionstore/SessionWorker.js b/application/basilisk/components/sessionstore/SessionWorker.js
1501index 7d802a7df..1297a115c 100644
1502--- a/application/basilisk/components/sessionstore/SessionWorker.js
1503+++ b/application/basilisk/components/sessionstore/SessionWorker.js
1504@@ -126,7 +126,6 @@ var Agent = {
1505 */
1506 write: function (state, options = {}) {
1507 let exn;
1508- let telemetry = {};
1509
1510 // Cap the number of backward and forward shistory entries on shutdown.
1511 if (options.isFinalWrite) {
1512@@ -197,9 +196,6 @@ var Agent = {
1513 });
1514 }
1515
1516- telemetry.FX_SESSION_RESTORE_WRITE_FILE_MS = Date.now() - startWriteMs;
1517- telemetry.FX_SESSION_RESTORE_FILE_SIZE_BYTES = data.byteLength;
1518-
1519 } catch (ex) {
1520 // Don't throw immediately
1521 exn = exn || ex;
1522@@ -276,7 +272,6 @@ var Agent = {
1523 result: {
1524 upgradeBackup: upgradeBackupComplete
1525 },
1526- telemetry: telemetry,
1527 };
1528 },
1529
1530diff --git a/application/basilisk/components/sessionstore/StartupPerformance.jsm b/application/basilisk/components/sessionstore/StartupPerformance.jsm
1531index d1b77a237..361602bc4 100644
1532--- a/application/basilisk/components/sessionstore/StartupPerformance.jsm
1533+++ b/application/basilisk/components/sessionstore/StartupPerformance.jsm
1534@@ -111,18 +111,6 @@ this.StartupPerformance = {
1535 return;
1536 }
1537
1538- // Once we are done restoring tabs, update Telemetry.
1539- let histogramName = isAutoRestore ?
1540- "FX_SESSION_RESTORE_AUTO_RESTORE_DURATION_UNTIL_EAGER_TABS_RESTORED_MS" :
1541- "FX_SESSION_RESTORE_MANUAL_RESTORE_DURATION_UNTIL_EAGER_TABS_RESTORED_MS";
1542- let histogram = Services.telemetry.getHistogramById(histogramName);
1543- let delta = this._latestRestoredTimeStamp - this._startTimeStamp;
1544- histogram.add(delta);
1545-
1546- Services.telemetry.getHistogramById("FX_SESSION_RESTORE_NUMBER_OF_EAGER_TABS_RESTORED").add(this._totalNumberOfEagerTabs);
1547- Services.telemetry.getHistogramById("FX_SESSION_RESTORE_NUMBER_OF_TABS_RESTORED").add(this._totalNumberOfTabs);
1548- Services.telemetry.getHistogramById("FX_SESSION_RESTORE_NUMBER_OF_WINDOWS_RESTORED").add(this._totalNumberOfWindows);
1549-
1550 // Reset
1551 this._startTimeStamp = null;
1552 } catch (ex) {
1553diff --git a/application/basilisk/components/sessionstore/content/content-sessionStore.js b/application/basilisk/components/sessionstore/content/content-sessionStore.js
1554index 858e35750..4fc160ed2 100644
1555--- a/application/basilisk/components/sessionstore/content/content-sessionStore.js
1556+++ b/application/basilisk/components/sessionstore/content/content-sessionStore.js
1557@@ -628,7 +628,6 @@ var SessionStorageListener = {
1558
1559 let size = this.estimateStorageSize(collected);
1560
1561- MessageQueue.push("telemetry", () => ({ FX_SESSION_RESTORE_DOM_STORAGE_SIZE_ESTIMATE_CHARS: size }));
1562 if (size > Preferences.get("browser.sessionstore.dom_storage_limit", DOM_STORAGE_MAX_CHARS)) {
1563 // Rather than keeping the old storage, which wouldn't match the rest
1564 // of the state of the page, empty the storage. DOM storage will be
1565@@ -797,42 +796,8 @@ var MessageQueue = {
1566
1567 let flushID = (options && options.flushID) || 0;
1568
1569- let durationMs = Date.now();
1570-
1571- let data = {};
1572- let telemetry = {};
1573- for (let [key, func] of this._data) {
1574- let value = func();
1575- if (key == "telemetry") {
1576- for (let histogramId of Object.keys(value)) {
1577- telemetry[histogramId] = value[histogramId];
1578- }
1579- } else if (value || (key != "storagechange" && key != "historychange")) {
1580- data[key] = value;
1581- }
1582- }
1583-
1584 this._data.clear();
1585-
1586- durationMs = Date.now() - durationMs;
1587- telemetry.FX_SESSION_RESTORE_CONTENT_COLLECT_DATA_LONGEST_OP_MS = durationMs;
1588-
1589- try {
1590- // Send all data to the parent process.
1591- sendAsyncMessage("SessionStore:update", {
1592- data, telemetry, flushID,
1593- isFinal: options.isFinal || false,
1594- epoch: gCurrentEpoch
1595- });
1596- } catch (ex if ex && ex.result == Cr.NS_ERROR_OUT_OF_MEMORY) {
1597- let telemetry = {
1598- FX_SESSION_RESTORE_SEND_UPDATE_CAUSED_OOM: 1
1599- };
1600- sendAsyncMessage("SessionStore:error", {
1601- telemetry
1602- });
1603 }
1604- },
1605 };
1606
1607 EventListener.init();
1608diff --git a/application/basilisk/components/sessionstore/nsSessionStartup.js b/application/basilisk/components/sessionstore/nsSessionStartup.js
1609index 9cda1552e..c7bb3384c 100644
1610--- a/application/basilisk/components/sessionstore/nsSessionStartup.js
1611+++ b/application/basilisk/components/sessionstore/nsSessionStartup.js
1612@@ -203,11 +203,6 @@ SessionStartup.prototype = {
1613 }
1614 }
1615
1616- // Report shutdown success via telemetry. Shortcoming here are
1617- // being-killed-by-OS-shutdown-logic, shutdown freezing after
1618- // session restore was written, etc.
1619- Services.telemetry.getHistogramById("SHUTDOWN_OK").add(!this._previousSessionCrashed);
1620-
1621 // set the startup type
1622 if (this._previousSessionCrashed && resumeFromCrash)
1623 this._sessionType = Ci.nsISessionStartup.RECOVER_SESSION;
1624diff --git a/application/basilisk/extensions/pdfjs/content/PdfJsTelemetry.jsm b/application/basilisk/extensions/pdfjs/content/PdfJsTelemetry.jsm
1625deleted file mode 100644
1626index 275da9d87..000000000
1627--- a/application/basilisk/extensions/pdfjs/content/PdfJsTelemetry.jsm
1628+++ /dev/null
1629@@ -1,70 +0,0 @@
1630-/* Copyright 2013 Mozilla Foundation
1631- *
1632- * Licensed under the Apache License, Version 2.0 (the "License");
1633- * you may not use this file except in compliance with the License.
1634- * You may obtain a copy of the License at
1635- *
1636- * http://www.apache.org/licenses/LICENSE-2.0
1637- *
1638- * Unless required by applicable law or agreed to in writing, software
1639- * distributed under the License is distributed on an "AS IS" BASIS,
1640- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1641- * See the License for the specific language governing permissions and
1642- * limitations under the License.
1643- */
1644-/* jshint esnext:true, maxlen: 100 */
1645-/* globals Components, Services */
1646-
1647-'use strict';
1648-
1649-this.EXPORTED_SYMBOLS = ['PdfJsTelemetry'];
1650-
1651-const Cu = Components.utils;
1652-Cu.import('resource://gre/modules/Services.jsm');
1653-
1654-this.PdfJsTelemetry = {
1655- onViewerIsUsed: function () {
1656- let histogram = Services.telemetry.getHistogramById('PDF_VIEWER_USED');
1657- histogram.add(true);
1658- },
1659- onFallback: function () {
1660- let histogram = Services.telemetry.getHistogramById('PDF_VIEWER_FALLBACK_SHOWN');
1661- histogram.add(true);
1662- },
1663- onDocumentSize: function (size) {
1664- let histogram = Services.telemetry.getHistogramById('PDF_VIEWER_DOCUMENT_SIZE_KB');
1665- histogram.add(size / 1024);
1666- },
1667- onDocumentVersion: function (versionId) {
1668- let histogram = Services.telemetry.getHistogramById('PDF_VIEWER_DOCUMENT_VERSION');
1669- histogram.add(versionId);
1670- },
1671- onDocumentGenerator: function (generatorId) {
1672- let histogram = Services.telemetry.getHistogramById('PDF_VIEWER_DOCUMENT_GENERATOR');
1673- histogram.add(generatorId);
1674- },
1675- onEmbed: function (isObject) {
1676- let histogram = Services.telemetry.getHistogramById('PDF_VIEWER_EMBED');
1677- histogram.add(isObject);
1678- },
1679- onFontType: function (fontTypeId) {
1680- let histogram = Services.telemetry.getHistogramById('PDF_VIEWER_FONT_TYPES');
1681- histogram.add(fontTypeId);
1682- },
1683- onForm: function (isAcroform) {
1684- let histogram = Services.telemetry.getHistogramById('PDF_VIEWER_FORM');
1685- histogram.add(isAcroform);
1686- },
1687- onPrint: function () {
1688- let histogram = Services.telemetry.getHistogramById('PDF_VIEWER_PRINT');
1689- histogram.add(true);
1690- },
1691- onStreamType: function (streamTypeId) {
1692- let histogram = Services.telemetry.getHistogramById('PDF_VIEWER_STREAM_TYPES');
1693- histogram.add(streamTypeId);
1694- },
1695- onTimeToView: function (ms) {
1696- let histogram = Services.telemetry.getHistogramById('PDF_VIEWER_TIME_TO_VIEW_MS');
1697- histogram.add(ms);
1698- }
1699-};
1700diff --git a/application/basilisk/extensions/pdfjs/content/PdfStreamConverter.jsm b/application/basilisk/extensions/pdfjs/content/PdfStreamConverter.jsm
1701index b5b21f214..d4a0f051f 100644
1702--- a/application/basilisk/extensions/pdfjs/content/PdfStreamConverter.jsm
1703+++ b/application/basilisk/extensions/pdfjs/content/PdfStreamConverter.jsm
1704@@ -14,7 +14,7 @@
1705 */
1706 /* jshint esnext:true */
1707 /* globals Components, Services, XPCOMUtils, NetUtil, PrivateBrowsingUtils,
1708- dump, NetworkManager, PdfJsTelemetry, PdfjsContentUtils */
1709+ dump, NetworkManager, PdfjsContentUtils */
1710
1711 'use strict';
1712
1713@@ -44,9 +44,6 @@ XPCOMUtils.defineLazyModuleGetter(this, 'NetworkManager',
1714 XPCOMUtils.defineLazyModuleGetter(this, 'PrivateBrowsingUtils',
1715 'resource://gre/modules/PrivateBrowsingUtils.jsm');
1716
1717-XPCOMUtils.defineLazyModuleGetter(this, 'PdfJsTelemetry',
1718- 'resource://pdf.js/PdfJsTelemetry.jsm');
1719-
1720 XPCOMUtils.defineLazyModuleGetter(this, 'PdfjsContentUtils',
1721 'resource://pdf.js/PdfjsContentUtils.jsm');
1722
1723@@ -214,13 +211,6 @@ PdfDataListener.prototype = {
1724 function ChromeActions(domWindow, contentDispositionFilename) {
1725 this.domWindow = domWindow;
1726 this.contentDispositionFilename = contentDispositionFilename;
1727- this.telemetryState = {
1728- documentInfo: false,
1729- firstPageInfo: false,
1730- streamTypesUsed: [],
1731- fontTypesUsed: [],
1732- startAt: Date.now()
1733- };
1734 }
1735
1736 ChromeActions.prototype = {
1737@@ -356,62 +346,6 @@ ChromeActions.prototype = {
1738 metaKey: Services.prefs.getIntPref('mousewheel.with_meta.action', 1) === 3,
1739 };
1740 },
1741- reportTelemetry: function (data) {
1742- var probeInfo = JSON.parse(data);
1743- switch (probeInfo.type) {
1744- case 'documentInfo':
1745- if (!this.telemetryState.documentInfo) {
1746- PdfJsTelemetry.onDocumentVersion(probeInfo.version | 0);
1747- PdfJsTelemetry.onDocumentGenerator(probeInfo.generator | 0);
1748- if (probeInfo.formType) {
1749- PdfJsTelemetry.onForm(probeInfo.formType === 'acroform');
1750- }
1751- this.telemetryState.documentInfo = true;
1752- }
1753- break;
1754- case 'pageInfo':
1755- if (!this.telemetryState.firstPageInfo) {
1756- var duration = Date.now() - this.telemetryState.startAt;
1757- PdfJsTelemetry.onTimeToView(duration);
1758- this.telemetryState.firstPageInfo = true;
1759- }
1760- break;
1761- case 'documentStats':
1762- // documentStats can be called several times for one documents.
1763- // if stream/font types are reported, trying not to submit the same
1764- // enumeration value multiple times.
1765- var documentStats = probeInfo.stats;
1766- if (!documentStats || typeof documentStats !== 'object') {
1767- break;
1768- }
1769- var i, streamTypes = documentStats.streamTypes;
1770- if (Array.isArray(streamTypes)) {
1771- var STREAM_TYPE_ID_LIMIT = 20;
1772- for (i = 0; i < STREAM_TYPE_ID_LIMIT; i++) {
1773- if (streamTypes[i] &&
1774- !this.telemetryState.streamTypesUsed[i]) {
1775- PdfJsTelemetry.onStreamType(i);
1776- this.telemetryState.streamTypesUsed[i] = true;
1777- }
1778- }
1779- }
1780- var fontTypes = documentStats.fontTypes;
1781- if (Array.isArray(fontTypes)) {
1782- var FONT_TYPE_ID_LIMIT = 20;
1783- for (i = 0; i < FONT_TYPE_ID_LIMIT; i++) {
1784- if (fontTypes[i] &&
1785- !this.telemetryState.fontTypesUsed[i]) {
1786- PdfJsTelemetry.onFontType(i);
1787- this.telemetryState.fontTypesUsed[i] = true;
1788- }
1789- }
1790- }
1791- break;
1792- case 'print':
1793- PdfJsTelemetry.onPrint();
1794- break;
1795- }
1796- },
1797 fallback: function(args, sendResponse) {
1798 var featureId = args.featureId;
1799 var url = args.url;
1800@@ -425,7 +359,6 @@ ChromeActions.prototype = {
1801 } else {
1802 message = getLocalizedString(strings, 'unsupported_feature');
1803 }
1804- PdfJsTelemetry.onFallback();
1805 PdfjsContentUtils.displayWarning(domWindow, message,
1806 getLocalizedString(strings, 'open_with_different_viewer'),
1807 getLocalizedString(strings, 'open_with_different_viewer', 'accessKey'));
1808@@ -940,9 +873,6 @@ PdfStreamConverter.prototype = {
1809 aRequest.setResponseHeader('Refresh', '', false);
1810 }
1811
1812- PdfJsTelemetry.onViewerIsUsed();
1813- PdfJsTelemetry.onDocumentSize(aRequest.contentLength);
1814-
1815 // Creating storage for PDF data
1816 var contentLength = aRequest.contentLength;
1817 this.dataListener = new PdfDataListener(contentLength);
1818@@ -996,7 +926,6 @@ PdfStreamConverter.prototype = {
1819 if (domWindow.frameElement) {
1820 var isObjectEmbed = domWindow.frameElement.tagName !== 'IFRAME' ||
1821 domWindow.frameElement.className === 'previewPluginContentFrame';
1822- PdfJsTelemetry.onEmbed(isObjectEmbed);
1823 }
1824 }
1825 };
1826diff --git a/application/basilisk/locales/en-US/chrome/browser/aboutDialog.dtd b/application/basilisk/locales/en-US/chrome/browser/aboutDialog.dtd
1827index e0c34692e..1f87b6046 100644
1828--- a/application/basilisk/locales/en-US/chrome/browser/aboutDialog.dtd
1829+++ b/application/basilisk/locales/en-US/chrome/browser/aboutDialog.dtd
1830@@ -16,8 +16,6 @@
1831
1832 <!-- LOCALIZATION NOTE (warningDesc.version): This is a warning about the experimental nature of Nightly and Aurora builds. It is only shown in those versions. -->
1833 <!ENTITY warningDesc.version "&brandShortName; is experimental and may be unstable.">
1834-<!-- 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. -->
1835-<!ENTITY warningDesc.telemetryDesc "It automatically sends information about performance, hardware, usage and customizations back to &vendorShortName; to help make &brandShortName; better.">
1836
1837 <!-- LOCALIZATION NOTE (community.exp.*) This paragraph is shown in "experimental" builds, i.e. Nightly and Aurora builds, instead of the other "community.*" strings below. -->
1838 <!ENTITY community.exp.start "">
1839diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/advanced.dtd b/application/basilisk/locales/en-US/chrome/browser/preferences/advanced.dtd
1840index 124c00d84..68250196d 100644
1841--- a/application/basilisk/locales/en-US/chrome/browser/preferences/advanced.dtd
1842+++ b/application/basilisk/locales/en-US/chrome/browser/preferences/advanced.dtd
1843@@ -28,23 +28,6 @@
1844 <!ENTITY checkSpelling.label "Check my spelling as I type">
1845 <!ENTITY checkSpelling.accesskey "t">
1846
1847-<!ENTITY dataChoicesTab.label "Data Choices">
1848-
1849-<!ENTITY healthReportDesc.label "Helps you understand your browser performance and shares data with &vendorShortName; about your browser health">
1850-<!ENTITY enableHealthReport.label "Enable &brandShortName; Health Report">
1851-<!ENTITY enableHealthReport.accesskey "R">
1852-<!ENTITY healthReportLearnMore.label "Learn More">
1853-
1854-<!ENTITY telemetryDesc.label "Shares performance, usage, hardware and customization data about your browser with &vendorShortName; to help us make &brandShortName; better">
1855-<!ENTITY enableTelemetryData.label "Share additional data (i.e., Telemetry)">
1856-<!ENTITY enableTelemetryData.accesskey "T">
1857-<!ENTITY telemetryLearnMore.label "Learn More">
1858-
1859-<!ENTITY crashReporterDesc2.label "Crash reports help &vendorShortName; fix problems and make your browser more stable and secure">
1860-<!ENTITY alwaysSubmitCrashReports.label "Allow &brandShortName; to send backlogged crash reports on your behalf">
1861-<!ENTITY alwaysSubmitCrashReports.accesskey "c">
1862-<!ENTITY crashReporterLearnMore.label "Learn More">
1863-
1864 <!ENTITY networkTab.label "Network">
1865
1866 <!ENTITY connection.label "Connection">
1867diff --git a/application/basilisk/modules/BrowserUsageTelemetry.jsm b/application/basilisk/modules/BrowserUsageTelemetry.jsm
1868deleted file mode 100644
1869index 39012d2ab..000000000
1870--- a/application/basilisk/modules/BrowserUsageTelemetry.jsm
1871+++ /dev/null
1872@@ -1,468 +0,0 @@
1873-/* -*- js-indent-level: 2; indent-tabs-mode: nil -*- */
1874-/* This Source Code Form is subject to the terms of the Mozilla Public
1875- * License, v. 2.0. If a copy of the MPL was not distributed with this
1876- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
1877-
1878-"use strict";
1879-
1880-this.EXPORTED_SYMBOLS = ["BrowserUsageTelemetry"];
1881-
1882-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
1883-
1884-Cu.import("resource://gre/modules/Services.jsm");
1885-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
1886-
1887-XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
1888- "resource://gre/modules/PrivateBrowsingUtils.jsm");
1889-
1890-// The upper bound for the count of the visited unique domain names.
1891-const MAX_UNIQUE_VISITED_DOMAINS = 100;
1892-
1893-// Observed topic names.
1894-const WINDOWS_RESTORED_TOPIC = "sessionstore-windows-restored";
1895-const TAB_RESTORING_TOPIC = "SSTabRestoring";
1896-const TELEMETRY_SUBSESSIONSPLIT_TOPIC = "internal-telemetry-after-subsession-split";
1897-const DOMWINDOW_OPENED_TOPIC = "domwindowopened";
1898-
1899-// Probe names.
1900-const MAX_TAB_COUNT_SCALAR_NAME = "browser.engagement.max_concurrent_tab_count";
1901-const MAX_WINDOW_COUNT_SCALAR_NAME = "browser.engagement.max_concurrent_window_count";
1902-const TAB_OPEN_EVENT_COUNT_SCALAR_NAME = "browser.engagement.tab_open_event_count";
1903-const WINDOW_OPEN_EVENT_COUNT_SCALAR_NAME = "browser.engagement.window_open_event_count";
1904-const UNIQUE_DOMAINS_COUNT_SCALAR_NAME = "browser.engagement.unique_domains_count";
1905-const TOTAL_URI_COUNT_SCALAR_NAME = "browser.engagement.total_uri_count";
1906-const UNFILTERED_URI_COUNT_SCALAR_NAME = "browser.engagement.unfiltered_uri_count";
1907-
1908-// A list of known search origins.
1909-const KNOWN_SEARCH_SOURCES = [
1910- "abouthome",
1911- "contextmenu",
1912- "newtab",
1913- "searchbar",
1914- "urlbar",
1915-];
1916-
1917-const KNOWN_ONEOFF_SOURCES = [
1918- "oneoff-urlbar",
1919- "oneoff-searchbar",
1920- "unknown", // Edge case: this is the searchbar (see bug 1195733 comment 7).
1921-];
1922-
1923-function getOpenTabsAndWinsCounts() {
1924- let tabCount = 0;
1925- let winCount = 0;
1926-
1927- let browserEnum = Services.wm.getEnumerator("navigator:browser");
1928- while (browserEnum.hasMoreElements()) {
1929- let win = browserEnum.getNext();
1930- winCount++;
1931- tabCount += win.gBrowser.tabs.length;
1932- }
1933-
1934- return { tabCount, winCount };
1935-}
1936-
1937-function getSearchEngineId(engine) {
1938- if (engine) {
1939- if (engine.identifier) {
1940- return engine.identifier;
1941- }
1942- // Due to bug 1222070, we can't directly check Services.telemetry.canRecordExtended
1943- // here.
1944- const extendedTelemetry = Services.prefs.getBoolPref("toolkit.telemetry.enabled");
1945- if (engine.name && extendedTelemetry) {
1946- // If it's a custom search engine only report the engine name
1947- // if extended Telemetry is enabled.
1948- return "other-" + engine.name;
1949- }
1950- }
1951- return "other";
1952-}
1953-
1954-let URICountListener = {
1955- // A set containing the visited domains, see bug 1271310.
1956- _domainSet: new Set(),
1957- // A map to keep track of the URIs loaded from the restored tabs.
1958- _restoredURIsMap: new WeakMap(),
1959-
1960- isHttpURI(uri) {
1961- // Only consider http(s) schemas.
1962- return uri.schemeIs("http") || uri.schemeIs("https");
1963- },
1964-
1965- addRestoredURI(browser, uri) {
1966- if (!this.isHttpURI(uri)) {
1967- return;
1968- }
1969-
1970- this._restoredURIsMap.set(browser, uri.spec);
1971- },
1972-
1973- onLocationChange(browser, webProgress, request, uri, flags) {
1974- // Don't count this URI if it's an error page.
1975- if (flags & Ci.nsIWebProgressListener.LOCATION_CHANGE_ERROR_PAGE) {
1976- return;
1977- }
1978-
1979- // We only care about top level loads.
1980- if (!webProgress.isTopLevel) {
1981- return;
1982- }
1983-
1984- // The SessionStore sets the URI of a tab first, firing onLocationChange the
1985- // first time, then manages content loading using its scheduler. Once content
1986- // loads, we will hit onLocationChange again.
1987- // We can catch the first case by checking for null requests: be advised that
1988- // this can also happen when navigating page fragments, so account for it.
1989- if (!request &&
1990- !(flags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT)) {
1991- return;
1992- }
1993-
1994- // Track URI loads, even if they're not http(s).
1995- let uriSpec = null;
1996- try {
1997- uriSpec = uri.spec;
1998- } catch (e) {
1999- // If we have troubles parsing the spec, still count this as
2000- // an unfiltered URI.
2001- Services.telemetry.scalarAdd(UNFILTERED_URI_COUNT_SCALAR_NAME, 1);
2002- return;
2003- }
2004-
2005-
2006- // Don't count about:blank and similar pages, as they would artificially
2007- // inflate the counts.
2008- if (browser.ownerDocument.defaultView.gInitialPages.includes(uriSpec)) {
2009- return;
2010- }
2011-
2012- // If the URI we're loading is in the _restoredURIsMap, then it comes from a
2013- // restored tab. If so, let's skip it and remove it from the map as we want to
2014- // count page refreshes.
2015- if (this._restoredURIsMap.get(browser) === uriSpec) {
2016- this._restoredURIsMap.delete(browser);
2017- return;
2018- }
2019-
2020- // The URI wasn't from a restored tab. Count it among the unfiltered URIs.
2021- // If this is an http(s) URI, this also gets counted by the "total_uri_count"
2022- // probe.
2023- Services.telemetry.scalarAdd(UNFILTERED_URI_COUNT_SCALAR_NAME, 1);
2024-
2025- if (!this.isHttpURI(uri)) {
2026- return;
2027- }
2028-
2029- // Update the URI counts.
2030- Services.telemetry.scalarAdd(TOTAL_URI_COUNT_SCALAR_NAME, 1);
2031-
2032- // We only want to count the unique domains up to MAX_UNIQUE_VISITED_DOMAINS.
2033- if (this._domainSet.size == MAX_UNIQUE_VISITED_DOMAINS) {
2034- return;
2035- }
2036-
2037- // Unique domains should be aggregated by (eTLD + 1): x.test.com and y.test.com
2038- // are counted once as test.com.
2039- try {
2040- // Even if only considering http(s) URIs, |getBaseDomain| could still throw
2041- // due to the URI containing invalid characters or the domain actually being
2042- // an ipv4 or ipv6 address.
2043- this._domainSet.add(Services.eTLD.getBaseDomain(uri));
2044- } catch (e) {
2045- return;
2046- }
2047-
2048- Services.telemetry.scalarSet(UNIQUE_DOMAINS_COUNT_SCALAR_NAME, this._domainSet.size);
2049- },
2050-
2051- /**
2052- * Reset the counts. This should be called when breaking a session in Telemetry.
2053- */
2054- reset() {
2055- this._domainSet.clear();
2056- },
2057-
2058- QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
2059- Ci.nsISupportsWeakReference]),
2060-};
2061-
2062-let BrowserUsageTelemetry = {
2063- init() {
2064- Services.obs.addObserver(this, WINDOWS_RESTORED_TOPIC, false);
2065- },
2066-
2067- /**
2068- * Handle subsession splits in the parent process.
2069- */
2070- afterSubsessionSplit() {
2071- // Scalars just got cleared due to a subsession split. We need to set the maximum
2072- // concurrent tab and window counts so that they reflect the correct value for the
2073- // new subsession.
2074- const counts = getOpenTabsAndWinsCounts();
2075- Services.telemetry.scalarSetMaximum(MAX_TAB_COUNT_SCALAR_NAME, counts.tabCount);
2076- Services.telemetry.scalarSetMaximum(MAX_WINDOW_COUNT_SCALAR_NAME, counts.winCount);
2077-
2078- // Reset the URI counter.
2079- URICountListener.reset();
2080- },
2081-
2082- uninit() {
2083- Services.obs.removeObserver(this, DOMWINDOW_OPENED_TOPIC, false);
2084- Services.obs.removeObserver(this, TELEMETRY_SUBSESSIONSPLIT_TOPIC, false);
2085- Services.obs.removeObserver(this, WINDOWS_RESTORED_TOPIC, false);
2086- },
2087-
2088- observe(subject, topic, data) {
2089- switch (topic) {
2090- case WINDOWS_RESTORED_TOPIC:
2091- this._setupAfterRestore();
2092- break;
2093- case DOMWINDOW_OPENED_TOPIC:
2094- this._onWindowOpen(subject);
2095- break;
2096- case TELEMETRY_SUBSESSIONSPLIT_TOPIC:
2097- this.afterSubsessionSplit();
2098- break;
2099- }
2100- },
2101-
2102- handleEvent(event) {
2103- switch (event.type) {
2104- case "TabOpen":
2105- this._onTabOpen();
2106- break;
2107- case "unload":
2108- this._unregisterWindow(event.target);
2109- break;
2110- case TAB_RESTORING_TOPIC:
2111- // We're restoring a new tab from a previous or crashed session.
2112- // We don't want to track the URIs from these tabs, so let
2113- // |URICountListener| know about them.
2114- let browser = event.target.linkedBrowser;
2115- URICountListener.addRestoredURI(browser, browser.currentURI);
2116- break;
2117- }
2118- },
2119-
2120- /**
2121- * The main entry point for recording search related Telemetry. This includes
2122- * search counts and engagement measurements.
2123- *
2124- * Telemetry records only search counts per engine and action origin, but
2125- * nothing pertaining to the search contents themselves.
2126- *
2127- * @param {nsISearchEngine} engine
2128- * The engine handling the search.
2129- * @param {String} source
2130- * Where the search originated from. See KNOWN_SEARCH_SOURCES for allowed
2131- * values.
2132- * @param {Object} [details] Options object.
2133- * @param {Boolean} [details.isOneOff=false]
2134- * true if this event was generated by a one-off search.
2135- * @param {Boolean} [details.isSuggestion=false]
2136- * true if this event was generated by a suggested search.
2137- * @param {Boolean} [details.isAlias=false]
2138- * true if this event was generated by a search using an alias.
2139- * @param {Object} [details.type=null]
2140- * The object describing the event that triggered the search.
2141- * @throws if source is not in the known sources list.
2142- */
2143- recordSearch(engine, source, details={}) {
2144- const isOneOff = !!details.isOneOff;
2145- const countId = getSearchEngineId(engine) + "." + source;
2146-
2147- if (isOneOff) {
2148- if (!KNOWN_ONEOFF_SOURCES.includes(source)) {
2149- // Silently drop the error if this bogus call
2150- // came from 'urlbar' or 'searchbar'. They're
2151- // calling |recordSearch| twice from two different
2152- // code paths because they want to record the search
2153- // in SEARCH_COUNTS.
2154- if (['urlbar', 'searchbar'].includes(source)) {
2155- Services.telemetry.getKeyedHistogramById("SEARCH_COUNTS").add(countId);
2156- return;
2157- }
2158- throw new Error("Unknown source for one-off search: " + source);
2159- }
2160- } else {
2161- if (!KNOWN_SEARCH_SOURCES.includes(source)) {
2162- throw new Error("Unknown source for search: " + source);
2163- }
2164- Services.telemetry.getKeyedHistogramById("SEARCH_COUNTS").add(countId);
2165- }
2166-
2167- // Dispatch the search signal to other handlers.
2168- this._handleSearchAction(engine, source, details);
2169- },
2170-
2171- _recordSearch(engine, source, action = null) {
2172- let scalarKey = action ? "search_" + action : "search";
2173- Services.telemetry.keyedScalarAdd("browser.engagement.navigation." + source,
2174- scalarKey, 1);
2175- Services.telemetry.recordEvent("navigation", "search", source, action,
2176- { engine: getSearchEngineId(engine) });
2177- },
2178-
2179- _handleSearchAction(engine, source, details) {
2180- switch (source) {
2181- case "urlbar":
2182- case "oneoff-urlbar":
2183- case "searchbar":
2184- case "oneoff-searchbar":
2185- case "unknown": // Edge case: this is the searchbar (see bug 1195733 comment 7).
2186- this._handleSearchAndUrlbar(engine, source, details);
2187- break;
2188- case "abouthome":
2189- this._recordSearch(engine, "about_home", "enter");
2190- break;
2191- case "newtab":
2192- this._recordSearch(engine, "about_newtab", "enter");
2193- break;
2194- case "contextmenu":
2195- this._recordSearch(engine, "contextmenu");
2196- break;
2197- }
2198- },
2199-
2200- /**
2201- * This function handles the "urlbar", "urlbar-oneoff", "searchbar" and
2202- * "searchbar-oneoff" sources.
2203- */
2204- _handleSearchAndUrlbar(engine, source, details) {
2205- // We want "urlbar" and "urlbar-oneoff" (and similar cases) to go in the same
2206- // scalar, but in a different key.
2207-
2208- // When using one-offs in the searchbar we get an "unknown" source. See bug
2209- // 1195733 comment 7 for the context. Fix-up the label here.
2210- const sourceName =
2211- (source === "unknown") ? "searchbar" : source.replace("oneoff-", "");
2212-
2213- const isOneOff = !!details.isOneOff;
2214- if (isOneOff) {
2215- // We will receive a signal from the "urlbar"/"searchbar" even when the
2216- // search came from "oneoff-urlbar". That's because both signals
2217- // are propagated from search.xml. Skip it if that's the case.
2218- // Moreover, we skip the "unknown" source that comes from the searchbar
2219- // when performing searches from the default search engine. See bug 1195733
2220- // comment 7 for context.
2221- if (["urlbar", "searchbar", "unknown"].includes(source)) {
2222- return;
2223- }
2224-
2225- // If that's a legit one-off search signal, record it using the relative key.
2226- this._recordSearch(engine, sourceName, "oneoff");
2227- return;
2228- }
2229-
2230- // The search was not a one-off. It was a search with the default search engine.
2231- if (details.isSuggestion) {
2232- // It came from a suggested search, so count it as such.
2233- this._recordSearch(engine, sourceName, "suggestion");
2234- return;
2235- } else if (details.isAlias) {
2236- // This one came from a search that used an alias.
2237- this._recordSearch(engine, sourceName, "alias");
2238- return;
2239- }
2240-
2241- // The search signal was generated by typing something and pressing enter.
2242- this._recordSearch(engine, sourceName, "enter");
2243- },
2244-
2245- /**
2246- * This gets called shortly after the SessionStore has finished restoring
2247- * windows and tabs. It counts the open tabs and adds listeners to all the
2248- * windows.
2249- */
2250- _setupAfterRestore() {
2251- // Make sure to catch new chrome windows and subsession splits.
2252- Services.obs.addObserver(this, DOMWINDOW_OPENED_TOPIC, false);
2253- Services.obs.addObserver(this, TELEMETRY_SUBSESSIONSPLIT_TOPIC, false);
2254-
2255- // Attach the tabopen handlers to the existing Windows.
2256- let browserEnum = Services.wm.getEnumerator("navigator:browser");
2257- while (browserEnum.hasMoreElements()) {
2258- this._registerWindow(browserEnum.getNext());
2259- }
2260-
2261- // Get the initial tab and windows max counts.
2262- const counts = getOpenTabsAndWinsCounts();
2263- Services.telemetry.scalarSetMaximum(MAX_TAB_COUNT_SCALAR_NAME, counts.tabCount);
2264- Services.telemetry.scalarSetMaximum(MAX_WINDOW_COUNT_SCALAR_NAME, counts.winCount);
2265- },
2266-
2267- /**
2268- * Adds listeners to a single chrome window.
2269- */
2270- _registerWindow(win) {
2271- win.addEventListener("unload", this);
2272- win.addEventListener("TabOpen", this, true);
2273-
2274- // Don't include URI and domain counts when in private mode.
2275- if (PrivateBrowsingUtils.isWindowPrivate(win)) {
2276- return;
2277- }
2278- win.gBrowser.tabContainer.addEventListener(TAB_RESTORING_TOPIC, this);
2279- win.gBrowser.addTabsProgressListener(URICountListener);
2280- },
2281-
2282- /**
2283- * Removes listeners from a single chrome window.
2284- */
2285- _unregisterWindow(win) {
2286- win.removeEventListener("unload", this);
2287- win.removeEventListener("TabOpen", this, true);
2288-
2289- // Don't include URI and domain counts when in private mode.
2290- if (PrivateBrowsingUtils.isWindowPrivate(win.defaultView)) {
2291- return;
2292- }
2293- win.defaultView.gBrowser.tabContainer.removeEventListener(TAB_RESTORING_TOPIC, this);
2294- win.defaultView.gBrowser.removeTabsProgressListener(URICountListener);
2295- },
2296-
2297- /**
2298- * Updates the tab counts.
2299- * @param {Number} [newTabCount=0] The count of the opened tabs across all windows. This
2300- * is computed manually if not provided.
2301- */
2302- _onTabOpen(tabCount = 0) {
2303- // Use the provided tab count if available. Otherwise, go on and compute it.
2304- tabCount = tabCount || getOpenTabsAndWinsCounts().tabCount;
2305- // Update the "tab opened" count and its maximum.
2306- Services.telemetry.scalarAdd(TAB_OPEN_EVENT_COUNT_SCALAR_NAME, 1);
2307- Services.telemetry.scalarSetMaximum(MAX_TAB_COUNT_SCALAR_NAME, tabCount);
2308- },
2309-
2310- /**
2311- * Tracks the window count and registers the listeners for the tab count.
2312- * @param{Object} win The window object.
2313- */
2314- _onWindowOpen(win) {
2315- // Make sure to have a |nsIDOMWindow|.
2316- if (!(win instanceof Ci.nsIDOMWindow)) {
2317- return;
2318- }
2319-
2320- let onLoad = () => {
2321- win.removeEventListener("load", onLoad, false);
2322-
2323- // Ignore non browser windows.
2324- if (win.document.documentElement.getAttribute("windowtype") != "navigator:browser") {
2325- return;
2326- }
2327-
2328- this._registerWindow(win);
2329- // Track the window open event and check the maximum.
2330- const counts = getOpenTabsAndWinsCounts();
2331- Services.telemetry.scalarAdd(WINDOW_OPEN_EVENT_COUNT_SCALAR_NAME, 1);
2332- Services.telemetry.scalarSetMaximum(MAX_WINDOW_COUNT_SCALAR_NAME, counts.winCount);
2333-
2334- // We won't receive the "TabOpen" event for the first tab within a new window.
2335- // Account for that.
2336- this._onTabOpen(counts.tabCount);
2337- };
2338- win.addEventListener("load", onLoad, false);
2339- },
2340-};
2341diff --git a/application/basilisk/modules/ContentCrashHandlers.jsm b/application/basilisk/modules/ContentCrashHandlers.jsm
2342index 488cc4f26..1021653b7 100644
2343--- a/application/basilisk/modules/ContentCrashHandlers.jsm
2344+++ b/application/basilisk/modules/ContentCrashHandlers.jsm
2345@@ -86,12 +86,6 @@ this.TabCrashHandler = {
2346 let childID = aSubject.get("childID");
2347 let dumpID = aSubject.get("dumpID");
2348
2349- if (!dumpID) {
2350- Services.telemetry
2351- .getHistogramById("FX_CONTENT_CRASH_DUMP_UNAVAILABLE")
2352- .add(1);
2353- }
2354-
2355 if (!this.flushCrashedBrowserQueue(childID)) {
2356 this.unseenCrashedChildIDs.push(childID);
2357 // The elements in unseenCrashedChildIDs will only be removed if
2358@@ -375,12 +369,6 @@ this.TabCrashHandler = {
2359 data.email = this.prefs.getCharPref("email", "");
2360 }
2361
2362- // Make sure to only count once even if there are multiple windows
2363- // that will all show about:tabcrashed.
2364- if (this._crashedTabCount == 1) {
2365- Services.telemetry.getHistogramById("FX_CONTENT_CRASH_PRESENTED").add(1);
2366- }
2367-
2368 message.target.sendAsyncMessage("SetCrashReportAvailable", data);
2369 },
2370
2371@@ -398,15 +386,6 @@ this.TabCrashHandler = {
2372 this.pageListener.sendAsyncMessage("UpdateCount", {
2373 count: this._crashedTabCount,
2374 });
2375-
2376- let browser = message.target.browser;
2377- let childID = this.browserMap.get(browser.permanentKey);
2378-
2379- // Make sure to only count once even if there are multiple windows
2380- // that will all show about:tabcrashed.
2381- if (this._crashedTabCount == 0 && childID) {
2382- Services.telemetry.getHistogramById("FX_CONTENT_CRASH_NOT_SUBMITTED").add(1);
2383- }
2384 },
2385
2386 /**
2387diff --git a/application/basilisk/modules/ContentLinkHandler.jsm b/application/basilisk/modules/ContentLinkHandler.jsm
2388index 443cae2da..76822e803 100644
2389--- a/application/basilisk/modules/ContentLinkHandler.jsm
2390+++ b/application/basilisk/modules/ContentLinkHandler.jsm
2391@@ -19,13 +19,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "Feeds",
2392 XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
2393 "resource://gre/modules/BrowserUtils.jsm");
2394
2395-const SIZES_TELEMETRY_ENUM = {
2396- NO_SIZES: 0,
2397- ANY: 1,
2398- DIMENSION: 2,
2399- INVALID: 3,
2400-};
2401-
2402 this.ContentLinkHandler = {
2403 init: function(chromeGlobal) {
2404 chromeGlobal.addEventListener("DOMLinkAdded", (event) => {
2405@@ -79,35 +72,6 @@ this.ContentLinkHandler = {
2406 if (!uri)
2407 break;
2408
2409- // Telemetry probes for measuring the sizes attribute
2410- // usage and available dimensions.
2411- let sizeHistogramTypes = Services.telemetry.
2412- getHistogramById("LINK_ICON_SIZES_ATTR_USAGE");
2413- let sizeHistogramDimension = Services.telemetry.
2414- getHistogramById("LINK_ICON_SIZES_ATTR_DIMENSION");
2415- let sizesType;
2416- if (link.sizes.length) {
2417- for (let size of link.sizes) {
2418- if (size.toLowerCase() == "any") {
2419- sizesType = SIZES_TELEMETRY_ENUM.ANY;
2420- break;
2421- } else {
2422- let re = /^([1-9][0-9]*)x[1-9][0-9]*$/i;
2423- let values = re.exec(size);
2424- if (values && values.length > 1) {
2425- sizesType = SIZES_TELEMETRY_ENUM.DIMENSION;
2426- sizeHistogramDimension.add(parseInt(values[1]));
2427- } else {
2428- sizesType = SIZES_TELEMETRY_ENUM.INVALID;
2429- break;
2430- }
2431- }
2432- }
2433- } else {
2434- sizesType = SIZES_TELEMETRY_ENUM.NO_SIZES;
2435- }
2436- sizeHistogramTypes.add(sizesType);
2437-
2438 chromeGlobal.sendAsyncMessage(
2439 "Link:SetIcon",
2440 {url: uri.spec, loadingPrincipal: link.ownerDocument.nodePrincipal});
2441diff --git a/application/basilisk/modules/PluginContent.jsm b/application/basilisk/modules/PluginContent.jsm
2442index 622d608bc..f9f4b0ef6 100644
2443--- a/application/basilisk/modules/PluginContent.jsm
2444+++ b/application/basilisk/modules/PluginContent.jsm
2445@@ -167,7 +167,6 @@ PluginContent.prototype = {
2446 return;
2447 }
2448
2449- this._finishRecordingFlashPluginTelemetry();
2450 this.clearPluginCaches();
2451 this.haveShownNotification = false;
2452 },
2453@@ -533,19 +532,11 @@ PluginContent.prototype = {
2454
2455 case "PluginInstantiated":
2456 let key = this._getPluginInfo(plugin).pluginTag.niceName;
2457- Services.telemetry.getKeyedHistogramById('PLUGIN_ACTIVATION_COUNT').add(key);
2458 shouldShowNotification = true;
2459 let pluginRect = plugin.getBoundingClientRect();
2460- if (pluginRect.width <= 5 && pluginRect.height <= 5) {
2461- Services.telemetry.getHistogramById('PLUGIN_TINY_CONTENT').add(1);
2462- }
2463 break;
2464 }
2465
2466- if (this._getPluginInfo(plugin).mimetype === FLASH_MIME_TYPE) {
2467- this._recordFlashPluginTelemetry(eventType, plugin);
2468- }
2469-
2470 // Show the in-content UI if it's not too big. The crashed plugin handler already did this.
2471 let overlay = this.getPluginUI(plugin, "main");
2472 if (eventType != "PluginCrashed") {
2473@@ -577,49 +568,6 @@ PluginContent.prototype = {
2474 }
2475 },
2476
2477- _recordFlashPluginTelemetry: function (eventType, plugin) {
2478- if (!Services.telemetry.canRecordExtended) {
2479- return;
2480- }
2481-
2482- if (!this.flashPluginStats) {
2483- this.flashPluginStats = {
2484- instancesCount: 0,
2485- plugins: new WeakSet()
2486- };
2487- }
2488-
2489- if (!this.flashPluginStats.plugins.has(plugin)) {
2490- // Reporting plugin instance and its dimensions only once.
2491- this.flashPluginStats.plugins.add(plugin);
2492-
2493- this.flashPluginStats.instancesCount++;
2494-
2495- let pluginRect = plugin.getBoundingClientRect();
2496- Services.telemetry.getHistogramById('FLASH_PLUGIN_WIDTH')
2497- .add(pluginRect.width);
2498- Services.telemetry.getHistogramById('FLASH_PLUGIN_HEIGHT')
2499- .add(pluginRect.height);
2500- Services.telemetry.getHistogramById('FLASH_PLUGIN_AREA')
2501- .add(pluginRect.width * pluginRect.height);
2502-
2503- let state = this._getPluginInfo(plugin).fallbackType;
2504- if (state === null) {
2505- state = Ci.nsIObjectLoadingContent.PLUGIN_UNSUPPORTED;
2506- }
2507- Services.telemetry.getHistogramById('FLASH_PLUGIN_STATES')
2508- .add(state);
2509- }
2510- },
2511-
2512- _finishRecordingFlashPluginTelemetry: function () {
2513- if (this.flashPluginStats) {
2514- Services.telemetry.getHistogramById('FLASH_PLUGIN_INSTANCES_ON_PAGE')
2515- .add(this.flashPluginStats.instancesCount);
2516- delete this.flashPluginStats;
2517- }
2518- },
2519-
2520 isKnownPlugin: function (objLoadingContent) {
2521 return (objLoadingContent.getContentTypeForMIMEType(objLoadingContent.actualType) ==
2522 Ci.nsIObjectLoadingContent.TYPE_PLUGIN);
2523diff --git a/application/basilisk/modules/ProcessHangMonitor.jsm b/application/basilisk/modules/ProcessHangMonitor.jsm
2524index 80c506ac7..1e4c192d8 100644
2525--- a/application/basilisk/modules/ProcessHangMonitor.jsm
2526+++ b/application/basilisk/modules/ProcessHangMonitor.jsm
2527@@ -364,17 +364,6 @@ var ProcessHangMonitor = {
2528 return;
2529 }
2530
2531- // On e10s this counts slow-script/hanged-plugin notice only once.
2532- // This code is not reached on non-e10s.
2533- if (report.hangType == report.SLOW_SCRIPT) {
2534- // On non-e10s, SLOW_SCRIPT_NOTICE_COUNT is probed at nsGlobalWindow.cpp
2535- Services.telemetry.getHistogramById("SLOW_SCRIPT_NOTICE_COUNT").add();
2536- } else if (report.hangType == report.PLUGIN_HANG) {
2537- // On non-e10s we have sufficient plugin telemetry probes,
2538- // so PLUGIN_HANG_NOTICE_COUNT is only probed on e10s.
2539- Services.telemetry.getHistogramById("PLUGIN_HANG_NOTICE_COUNT").add();
2540- }
2541-
2542 this._activeReports.add(report);
2543 this.updateWindows();
2544 },
2545diff --git a/application/basilisk/modules/moz.build b/application/basilisk/modules/moz.build
2546index cd8f2ce62..76aea5cdf 100644
2547--- a/application/basilisk/modules/moz.build
2548+++ b/application/basilisk/modules/moz.build
2549@@ -8,7 +8,6 @@ EXTRA_JS_MODULES += [
2550 'AboutHome.jsm',
2551 'AboutNewTab.jsm',
2552 'AttributionCode.jsm',
2553- 'BrowserUsageTelemetry.jsm',
2554 'CastingApps.jsm',
2555 'ContentClick.jsm',
2556 'ContentCrashHandlers.jsm',
2557diff --git a/application/basilisk/themes/shared/incontentprefs/preferences.inc.css b/application/basilisk/themes/shared/incontentprefs/preferences.inc.css
2558index 20ea98327..173904b1c 100644
2559--- a/application/basilisk/themes/shared/incontentprefs/preferences.inc.css
2560+++ b/application/basilisk/themes/shared/incontentprefs/preferences.inc.css
2561@@ -288,17 +288,6 @@ description > html|a {
2562 margin-inline-end: 4px; /* add the 4px end-margin of other elements */
2563 }
2564
2565-#telemetryLearnMore,
2566-#FHRLearnMore,
2567-#crashReporterLearnMore {
2568- /* provide some margin between the links and the label text */
2569- /* !important is needed to override the rules defined in common.css */
2570- margin-inline-start: 20px !important;
2571- /* center the links */
2572- margin-top: 8px;
2573- margin-bottom: 8px;
2574-}
2575-
2576 .indent {
2577 /* !important needed to override margin-inline-start:0 !important; rule
2578 define in common.css for labels */
2579diff --git a/application/palemoon/base/content/tabbrowser.xml b/application/palemoon/base/content/tabbrowser.xml
2580index b5edd54b7..53b9b1a2d 100644
2581--- a/application/palemoon/base/content/tabbrowser.xml
2582+++ b/application/palemoon/base/content/tabbrowser.xml
2583@@ -1753,8 +1753,6 @@
2584
2585 if (animate) {
2586 requestAnimationFrame(function () {
2587- this.tabContainer._handleTabTelemetryStart(t, aURI);
2588-
2589 // kick the animation off
2590 t.setAttribute("fadein", "true");
2591
2592@@ -1955,8 +1953,6 @@
2593 return;
2594 }
2595
2596- this.tabContainer._handleTabTelemetryStart(aTab);
2597-
2598 this._blurTab(aTab);
2599 aTab.style.maxWidth = ""; // ensure that fade-out transition happens
2600 aTab.removeAttribute("fadein");
2601@@ -4343,85 +4339,6 @@
2602 </body>
2603 </method>
2604
2605- <method name="_handleTabTelemetryStart">
2606- <parameter name="aTab"/>
2607- <parameter name="aURI"/>
2608- <body>
2609- <![CDATA[
2610- // Animation-smoothness telemetry/logging
2611- if (this._tabAnimationLoggingEnabled) {
2612- if (aURI == "about:newtab" && (aTab._tPos == 1 || aTab._tPos == 2)) {
2613- // Indicate newtab page animation where other tabs are unaffected
2614- // (for which case, the 2nd or 3rd tabs are good representatives, even if not absolute)
2615- aTab._recordingTabOpenPlain = true;
2616- }
2617- aTab._recordingHandle = window.QueryInterface(Ci.nsIInterfaceRequestor)
2618- .getInterface(Ci.nsIDOMWindowUtils)
2619- .startFrameTimeRecording();
2620- }
2621-
2622- // Overall animation duration
2623- aTab._animStartTime = Date.now();
2624- ]]>
2625- </body>
2626- </method>
2627-
2628- <method name="_handleTabTelemetryEnd">
2629- <parameter name="aTab"/>
2630- <body>
2631- <![CDATA[
2632- if (!aTab._animStartTime) {
2633- return;
2634- }
2635-
2636- aTab._animStartTime = 0;
2637-
2638- // Handle tab animation smoothness telemetry/logging of frame intervals and paint times
2639- if (!("_recordingHandle" in aTab)) {
2640- return;
2641- }
2642-
2643- let paints = {};
2644- let intervals = window.QueryInterface(Ci.nsIInterfaceRequestor)
2645- .getInterface(Ci.nsIDOMWindowUtils)
2646- .stopFrameTimeRecording(aTab._recordingHandle, paints);
2647- delete aTab._recordingHandle;
2648- paints = paints.value; // The result array itself.
2649- let frameCount = intervals.length;
2650-
2651- if (this._tabAnimationLoggingEnabled) {
2652- let msg = "Tab " + (aTab.closing ? "close" : "open") + " (Frame-interval / paint-processing):\n";
2653- for (let i = 0; i < frameCount; i++) {
2654- msg += Math.round(intervals[i]) + " / " + Math.round(paints[i]) + "\n";
2655- }
2656- Services.console.logStringMessage(msg);
2657- }
2658-
2659- // For telemetry, the first frame interval is not useful since it may represent an interval
2660- // to a relatively old frame (prior to recording start). So we'll ignore it for the average.
2661- // But if we recorded only 1 frame (very rare), then the first paint duration is a good
2662- // representative of the first frame interval for our cause (indicates very bad animation).
2663- // First paint duration is always useful for us.
2664- if (frameCount > 0) {
2665- let averageInterval = 0;
2666- let averagePaint = paints[0];
2667- for (let i = 1; i < frameCount; i++) {
2668- averageInterval += intervals[i];
2669- averagePaint += paints[i];
2670- };
2671- averagePaint /= frameCount;
2672- averageInterval = (frameCount == 1)
2673- ? averagePaint
2674- : averageInterval / (frameCount - 1);
2675-
2676- if (aTab._recordingTabOpenPlain) {
2677- delete aTab._recordingTabOpenPlain;
2678- }
2679- }
2680- ]]>
2681- </body>
2682- </method>
2683-
2684 <!-- Deprecated stuff, implemented for backwards compatibility. -->
2685 <property name="mTabstripClosebutton" readonly="true"
2686 onget="return document.getElementById('tabs-closebutton');"/>
2687@@ -4438,8 +4355,6 @@
2688
2689 var tab = event.target;
2690
2691- this._handleTabTelemetryEnd(tab);
2692-
2693 if (tab.getAttribute("fadein") == "true") {
2694 if (tab._fullyOpen)
2695 this.adjustTabstrip();
2696diff --git a/application/palemoon/components/newtab/page.js b/application/palemoon/components/newtab/page.js
2697index 34387fd44..977d04979 100644
2698--- a/application/palemoon/components/newtab/page.js
2699+++ b/application/palemoon/components/newtab/page.js
2700@@ -212,9 +212,6 @@ var gPage = {
2701 },
2702
2703 onPageFirstVisible: function () {
2704- // Record another page impression.
2705- Services.telemetry.getHistogramById("NEWTAB_PAGE_SHOWN").add(true);
2706-
2707 for (let site of gGrid.sites) {
2708 if (site) {
2709 // The site may need to modify and/or re-render itself if
2710diff --git a/application/palemoon/components/newtab/sites.js b/application/palemoon/components/newtab/sites.js
2711index cb5675238..9345f8b03 100644
2712--- a/application/palemoon/components/newtab/sites.js
2713+++ b/application/palemoon/components/newtab/sites.js
2714@@ -269,21 +269,6 @@ Site.prototype = {
2715 } catch (e) {}
2716 },
2717
2718- /**
2719- * Record interaction with site using telemetry.
2720- */
2721- _recordSiteClicked: function Site_recordSiteClicked(aIndex) {
2722- if (Services.prefs.prefHasUserValue("browser.newtabpage.rows") ||
2723- Services.prefs.prefHasUserValue("browser.newtabpage.columns") ||
2724- aIndex > 8) {
2725- // We only want to get indices for the default configuration, everything
2726- // else goes in the same bucket.
2727- aIndex = 9;
2728- }
2729- Services.telemetry.getHistogramById("NEWTAB_PAGE_SITE_CLICKED")
2730- .add(aIndex);
2731- },
2732-
2733 _toggleLegalText: function(buttonClass, explanationTextClass) {
2734 let button = this._querySelector(buttonClass);
2735 if (button.hasAttribute("active")) {
2736diff --git a/toolkit/components/addoncompat/CompatWarning.jsm b/toolkit/components/addoncompat/CompatWarning.jsm
2737index b32409a46..c4d45adee 100644
2738--- a/toolkit/components/addoncompat/CompatWarning.jsm
2739+++ b/toolkit/components/addoncompat/CompatWarning.jsm
2740@@ -47,11 +47,6 @@ var CompatWarning = {
2741 }
2742 alreadyWarned = true;
2743
2744- if (addon) {
2745- let histogram = Services.telemetry.getKeyedHistogramById("ADDON_SHIM_USAGE");
2746- histogram.add(addon, warning ? warning.number : 0);
2747- }
2748-
2749 if (!Preferences.get("dom.ipc.shims.enabledWarnings", false))
2750 return;
2751
2752diff --git a/toolkit/components/alerts/resources/content/alert.js b/toolkit/components/alerts/resources/content/alert.js
2753index 12068b548..396fb8ba4 100644
2754--- a/toolkit/components/alerts/resources/content/alert.js
2755+++ b/toolkit/components/alerts/resources/content/alert.js
2756@@ -325,8 +325,6 @@ function doNotDisturb() {
2757 .getService(Ci.nsIAlertsService)
2758 .QueryInterface(Ci.nsIAlertsDoNotDisturb);
2759 alertService.manualDoNotDisturb = true;
2760- Services.telemetry.getHistogramById("WEB_NOTIFICATION_MENU")
2761- .add(0);
2762 onAlertClose();
2763 }
2764
2765diff --git a/toolkit/components/asyncshutdown/AsyncShutdown.jsm b/toolkit/components/asyncshutdown/AsyncShutdown.jsm
2766index 9cdf9e126..ca4f21ab0 100644
2767--- a/toolkit/components/asyncshutdown/AsyncShutdown.jsm
2768+++ b/toolkit/components/asyncshutdown/AsyncShutdown.jsm
2769@@ -1001,7 +1001,6 @@ if (!isContent) {
2770 this.AsyncShutdown.profileChangeTeardown = getPhase("profile-change-teardown");
2771 this.AsyncShutdown.profileBeforeChange = getPhase("profile-before-change");
2772 this.AsyncShutdown.placesClosingInternalConnection = getPhase("places-will-close-connection");
2773- this.AsyncShutdown.sendTelemetry = getPhase("profile-before-change-telemetry");
2774 }
2775
2776 // Notifications that fire in the parent and content process, but should
2777diff --git a/toolkit/components/blocklist/nsBlocklistService.js b/toolkit/components/blocklist/nsBlocklistService.js
2778index 788ce192f..77adca67e 100644
2779--- a/toolkit/components/blocklist/nsBlocklistService.js
2780+++ b/toolkit/components/blocklist/nsBlocklistService.js
2781@@ -749,10 +749,7 @@ Blocklist.prototype = {
2782 return;
2783 }
2784
2785- let telemetry = Services.telemetry;
2786-
2787 if (this._isBlocklistPreloaded()) {
2788- telemetry.getHistogramById("BLOCKLIST_SYNC_FILE_LOAD").add(false);
2789 this._loadBlocklistFromString(this._preloadedBlocklistContent);
2790 delete this._preloadedBlocklistContent;
2791 return;
2792@@ -763,8 +760,6 @@ Blocklist.prototype = {
2793 return;
2794 }
2795
2796- telemetry.getHistogramById("BLOCKLIST_SYNC_FILE_LOAD").add(true);
2797-
2798 let text = "";
2799 let fstream = null;
2800 let cstream = null;
2801diff --git a/toolkit/components/contextualidentity/ContextualIdentityService.jsm b/toolkit/components/contextualidentity/ContextualIdentityService.jsm
2802index 6aae3673d..dfc72e617 100644
2803--- a/toolkit/components/contextualidentity/ContextualIdentityService.jsm
2804+++ b/toolkit/components/contextualidentity/ContextualIdentityService.jsm
2805@@ -45,7 +45,6 @@ _ContextualIdentityService.prototype = {
2806 color: "blue",
2807 l10nID: "userContextPersonal.label",
2808 accessKey: "userContextPersonal.accesskey",
2809- telemetryId: 1,
2810 },
2811 { userContextId: 2,
2812 public: true,
2813@@ -53,7 +52,6 @@ _ContextualIdentityService.prototype = {
2814 color: "orange",
2815 l10nID: "userContextWork.label",
2816 accessKey: "userContextWork.accesskey",
2817- telemetryId: 2,
2818 },
2819 { userContextId: 3,
2820 public: true,
2821@@ -61,7 +59,6 @@ _ContextualIdentityService.prototype = {
2822 color: "green",
2823 l10nID: "userContextBanking.label",
2824 accessKey: "userContextBanking.accesskey",
2825- telemetryId: 3,
2826 },
2827 { userContextId: 4,
2828 public: true,
2829@@ -69,7 +66,6 @@ _ContextualIdentityService.prototype = {
2830 color: "pink",
2831 l10nID: "userContextShopping.label",
2832 accessKey: "userContextShopping.accesskey",
2833- telemetryId: 4,
2834 },
2835 { userContextId: 5,
2836 public: false,
2837@@ -314,27 +310,6 @@ _ContextualIdentityService.prototype = {
2838 }
2839 },
2840
2841- telemetry(userContextId) {
2842- let identity = this.getIdentityFromId(userContextId);
2843-
2844- // Let's ignore unknown identities for now.
2845- if (!identity || !identity.public) {
2846- return;
2847- }
2848-
2849- if (!this._openedIdentities.has(userContextId)) {
2850- this._openedIdentities.add(userContextId);
2851- Services.telemetry.getHistogramById("UNIQUE_CONTAINERS_OPENED").add(1);
2852- }
2853-
2854- Services.telemetry.getHistogramById("TOTAL_CONTAINERS_OPENED").add(1);
2855-
2856- if (identity.telemetryId) {
2857- Services.telemetry.getHistogramById("CONTAINER_USED")
2858- .add(identity.telemetryId);
2859- }
2860- },
2861-
2862 createNewInstanceForTesting(path) {
2863 return new _ContextualIdentityService(path);
2864 },
2865diff --git a/toolkit/components/gfx/SanityTest.js b/toolkit/components/gfx/SanityTest.js
2866index a563ec361..8e0cde1de 100644
2867--- a/toolkit/components/gfx/SanityTest.js
2868+++ b/toolkit/components/gfx/SanityTest.js
2869@@ -56,20 +56,10 @@ function testPixel(ctx, x, y, r, g, b, a, fuzz) {
2870 }
2871
2872 function reportResult(val) {
2873- try {
2874- let histogram = Services.telemetry.getHistogramById("GRAPHICS_SANITY_TEST");
2875- histogram.add(val);
2876- } catch (e) {}
2877-
2878 Preferences.set(RUNNING_PREF, false);
2879 Services.prefs.savePrefFile(null);
2880 }
2881
2882-function reportTestReason(val) {
2883- let histogram = Services.telemetry.getHistogramById("GRAPHICS_SANITY_TEST_REASON");
2884- histogram.add(val);
2885-}
2886-
2887 function annotateCrashReport(value) {
2888 try {
2889 // "1" if we're annotating the crash report, "" to remove the annotation.
2890@@ -257,11 +247,6 @@ SanityTest.prototype = {
2891 if (prefValue == value) {
2892 return true;
2893 }
2894- if (prefValue === undefined) {
2895- reportTestReason(REASON_FIRST_RUN);
2896- } else {
2897- reportTestReason(reason);
2898- }
2899 return false;
2900 }
2901
2902diff --git a/toolkit/components/osfile/modules/osfile_async_front.jsm b/toolkit/components/osfile/modules/osfile_async_front.jsm
2903index 9f3b7fb21..e68157378 100644
2904--- a/toolkit/components/osfile/modules/osfile_async_front.jsm
2905+++ b/toolkit/components/osfile/modules/osfile_async_front.jsm
2906@@ -434,34 +434,10 @@ var Scheduler = this.Scheduler = {
2907 Scheduler.Debugging.latestReceived = [Date.now(), error.message, error.fileName, error.lineNumber];
2908 throw error;
2909 } finally {
2910- if (firstLaunch) {
2911- Scheduler._updateTelemetry();
2912- }
2913 Scheduler.restartTimer();
2914 }
2915 }.bind(this)));
2916 },
2917-
2918- /**
2919- * Post Telemetry statistics.
2920- *
2921- * This is only useful on first launch.
2922- */
2923- _updateTelemetry: function() {
2924- let worker = this.worker;
2925- let workerTimeStamps = worker.workerTimeStamps;
2926- if (!workerTimeStamps) {
2927- // If the first call to OS.File results in an uncaught errors,
2928- // the timestamps are absent. As this case is a developer error,
2929- // let's not waste time attempting to extract telemetry from it.
2930- return;
2931- }
2932- let HISTOGRAM_LAUNCH = Services.telemetry.getHistogramById("OSFILE_WORKER_LAUNCH_MS");
2933- HISTOGRAM_LAUNCH.add(worker.workerTimeStamps.entered - worker.launchTimeStamp);
2934-
2935- let HISTOGRAM_READY = Services.telemetry.getHistogramById("OSFILE_WORKER_READY_MS");
2936- HISTOGRAM_READY.add(worker.workerTimeStamps.loaded - worker.launchTimeStamp);
2937- }
2938 };
2939
2940 const PREF_OSFILE_LOG = "toolkit.osfile.log";
2941diff --git a/toolkit/components/osfile/modules/osfile_async_worker.js b/toolkit/components/osfile/modules/osfile_async_worker.js
2942index 84287c75e..8a03e6535 100644
2943--- a/toolkit/components/osfile/modules/osfile_async_worker.js
2944+++ b/toolkit/components/osfile/modules/osfile_async_worker.js
2945@@ -12,14 +12,6 @@ if (this.Components) {
2946 (function(exports) {
2947 "use strict";
2948
2949- // Timestamps, for use in Telemetry.
2950- // The object is set to |null| once it has been sent
2951- // to the main thread.
2952- let timeStamps = {
2953- entered: Date.now(),
2954- loaded: null
2955- };
2956-
2957 importScripts("resource://gre/modules/osfile.jsm");
2958
2959 let PromiseWorker = require("resource://gre/modules/workers/PromiseWorker.js");
2960diff --git a/toolkit/components/parentalcontrols/nsIParentalControlsService.idl b/toolkit/components/parentalcontrols/nsIParentalControlsService.idl
2961index 45d349add..5bba6cb29 100644
2962--- a/toolkit/components/parentalcontrols/nsIParentalControlsService.idl
2963+++ b/toolkit/components/parentalcontrols/nsIParentalControlsService.idl
2964@@ -36,7 +36,6 @@ interface nsIParentalControlsService : nsISupports
2965 const short ADVANCED_SETTINGS = 17; // Advanced settings
2966 const short CAMERA_MICROPHONE = 18; // Camera and microphone (WebRTC)
2967 const short BLOCK_LIST = 19; // Block websites that include sensitive content
2968- const short TELEMETRY = 20; // Submit telemetry data
2969 const short HEALTH_REPORT = 21; // Submit FHR data
2970 const short DEFAULT_THEME = 22; // Use default theme or a special parental controls theme
2971
2972diff --git a/toolkit/components/passwordmgr/InsecurePasswordUtils.jsm b/toolkit/components/passwordmgr/InsecurePasswordUtils.jsm
2973index 5351e45b2..68e4de759 100644
2974--- a/toolkit/components/passwordmgr/InsecurePasswordUtils.jsm
2975+++ b/toolkit/components/passwordmgr/InsecurePasswordUtils.jsm
2976@@ -144,7 +144,5 @@ this.InsecurePasswordUtils = {
2977 } else {
2978 passwordSafety = 5;
2979 }
2980-
2981- Services.telemetry.getHistogramById("PWMGR_LOGIN_PAGE_SAFETY").add(passwordSafety);
2982 },
2983 };
2984diff --git a/toolkit/components/passwordmgr/LoginManagerContent.jsm b/toolkit/components/passwordmgr/LoginManagerContent.jsm
2985index 60805530d..2d93a6b11 100644
2986--- a/toolkit/components/passwordmgr/LoginManagerContent.jsm
2987+++ b/toolkit/components/passwordmgr/LoginManagerContent.jsm
2988@@ -1235,7 +1235,6 @@ var LoginManagerContent = {
2989
2990 if (!userTriggered) {
2991 // Ignore fills as a result of user action for this probe.
2992- Services.telemetry.getHistogramById("PWMGR_FORM_AUTOFILL_RESULT").add(autofillResult);
2993
2994 if (usernameField) {
2995 let focusedElement = this._formFillService.focusedInput;
2996diff --git a/toolkit/components/passwordmgr/content/passwordManager.js b/toolkit/components/passwordmgr/content/passwordManager.js
2997index 327ebbdf8..37d1c6a0e 100644
2998--- a/toolkit/components/passwordmgr/content/passwordManager.js
2999+++ b/toolkit/components/passwordmgr/content/passwordManager.js
3000@@ -91,7 +91,6 @@ function Startup() {
3001 }
3002
3003 SignonColumnSort(sortField);
3004- Services.telemetry.getKeyedHistogramById("PWMGR_MANAGE_SORTED").add(sortField);
3005 });
3006
3007 LoadSignons();
3008@@ -101,9 +100,6 @@ function Startup() {
3009 window.arguments[0] &&
3010 window.arguments[0].filterString) {
3011 setFilter(window.arguments[0].filterString);
3012- Services.telemetry.getHistogramById("PWMGR_MANAGE_OPENED").add(1);
3013- } else {
3014- Services.telemetry.getHistogramById("PWMGR_MANAGE_OPENED").add(0);
3015 }
3016
3017 FocusFilterBox();
3018@@ -435,7 +431,6 @@ function DeleteAllSignons() {
3019 removeButton.setAttribute("disabled", "true");
3020 removeAllButton.setAttribute("disabled", "true");
3021 FinalizeSignonDeletions(syncNeeded);
3022- Services.telemetry.getHistogramById("PWMGR_MANAGE_DELETED_ALL").add(1);
3023 }
3024
3025 function TogglePasswordVisible() {
3026@@ -450,7 +445,6 @@ function TogglePasswordVisible() {
3027 // Notify observers that the password visibility toggling is
3028 // completed. (Mostly useful for tests)
3029 Services.obs.notifyObservers(null, "passwordmgr-password-toggle-complete", null);
3030- Services.telemetry.getHistogramById("PWMGR_MANAGE_VISIBILITY_TOGGLED").add(showingPasswords);
3031 }
3032
3033 function AskUserShowPasswords() {
3034@@ -467,7 +461,6 @@ function AskUserShowPasswords() {
3035 function FinalizeSignonDeletions(syncNeeded) {
3036 for (let s = 0; s < deletedSignons.length; s++) {
3037 Services.logins.removeLogin(deletedSignons[s]);
3038- Services.telemetry.getHistogramById("PWMGR_MANAGE_DELETED").add(1);
3039 }
3040 // If the deletion has been performed in a filtered view, reflect the deletion in the unfiltered table.
3041 // See bug 405389.
3042@@ -642,7 +635,6 @@ function CopyPassword() {
3043 let row = signonsTree.currentIndex;
3044 let password = signonsTreeView.getCellText(row, {id : "passwordCol" });
3045 clipboard.copyString(password);
3046- Services.telemetry.getHistogramById("PWMGR_MANAGE_COPIED_PASSWORD").add(1);
3047 }
3048
3049 function CopyUsername() {
3050@@ -652,7 +644,6 @@ function CopyUsername() {
3051 let row = signonsTree.currentIndex;
3052 let username = signonsTreeView.getCellText(row, {id : "userCol" });
3053 clipboard.copyString(username);
3054- Services.telemetry.getHistogramById("PWMGR_MANAGE_COPIED_USERNAME").add(1);
3055 }
3056
3057 function EditCellInSelectedRow(columnName) {
3058diff --git a/toolkit/components/passwordmgr/nsLoginManager.js b/toolkit/components/passwordmgr/nsLoginManager.js
3059index 514351fa5..24e0f50c5 100644
3060--- a/toolkit/components/passwordmgr/nsLoginManager.js
3061+++ b/toolkit/components/passwordmgr/nsLoginManager.js
3062@@ -107,8 +107,6 @@ LoginManager.prototype = {
3063 // Initialize storage so that asynchronous data loading can start.
3064 this._initStorage();
3065 }
3066-
3067- Services.obs.addObserver(this._observer, "gather-telemetry", false);
3068 },
3069
3070
3071@@ -173,85 +171,12 @@ LoginManager.prototype = {
3072 Services.obs.notifyObservers(null,
3073 "passwordmgr-storage-replace-complete", null);
3074 }.bind(this));
3075- } else if (topic == "gather-telemetry") {
3076- // When testing, the "data" parameter is a string containing the
3077- // reference time in milliseconds for time-based statistics.
3078- this._pwmgr._gatherTelemetry(data ? parseInt(data)
3079- : new Date().getTime());
3080 } else {
3081 log.debug("Oops! Unexpected notification:", topic);
3082 }
3083 }
3084 },
3085
3086- /**
3087- * Collects statistics about the current logins and settings. The telemetry
3088- * histograms used here are not accumulated, but are reset each time this
3089- * function is called, since it can be called multiple times in a session.
3090- *
3091- * This function might also not be called at all in the current session.
3092- *
3093- * @param referenceTimeMs
3094- * Current time used to calculate time-based statistics, expressed as
3095- * the number of milliseconds since January 1, 1970, 00:00:00 UTC.
3096- * This is set to a fake value during unit testing.
3097- */
3098- _gatherTelemetry(referenceTimeMs) {
3099- function clearAndGetHistogram(histogramId) {
3100- let histogram = Services.telemetry.getHistogramById(histogramId);
3101- histogram.clear();
3102- return histogram;
3103- }
3104-
3105- clearAndGetHistogram("PWMGR_BLOCKLIST_NUM_SITES").add(
3106- this.getAllDisabledHosts({}).length
3107- );
3108- clearAndGetHistogram("PWMGR_NUM_SAVED_PASSWORDS").add(
3109- this.countLogins("", "", "")
3110- );
3111- clearAndGetHistogram("PWMGR_NUM_HTTPAUTH_PASSWORDS").add(
3112- this.countLogins("", null, "")
3113- );
3114-
3115- // This is a boolean histogram, and not a flag, because we don't want to
3116- // record any value if _gatherTelemetry is not called.
3117- clearAndGetHistogram("PWMGR_SAVING_ENABLED").add(this._remember);
3118-
3119- // Don't try to get logins if MP is enabled, since we don't want to show a MP prompt.
3120- if (!this.isLoggedIn) {
3121- return;
3122- }
3123-
3124- let logins = this.getAllLogins({});
3125-
3126- let usernamePresentHistogram = clearAndGetHistogram("PWMGR_USERNAME_PRESENT");
3127- let loginLastUsedDaysHistogram = clearAndGetHistogram("PWMGR_LOGIN_LAST_USED_DAYS");
3128-
3129- let hostnameCount = new Map();
3130- for (let login of logins) {
3131- usernamePresentHistogram.add(!!login.username);
3132-
3133- let hostname = login.hostname;
3134- hostnameCount.set(hostname, (hostnameCount.get(hostname) || 0 ) + 1);
3135-
3136- login.QueryInterface(Ci.nsILoginMetaInfo);
3137- let timeLastUsedAgeMs = referenceTimeMs - login.timeLastUsed;
3138- if (timeLastUsedAgeMs > 0) {
3139- loginLastUsedDaysHistogram.add(
3140- Math.floor(timeLastUsedAgeMs / MS_PER_DAY)
3141- );
3142- }
3143- }
3144-
3145- let passwordsCountHistogram = clearAndGetHistogram("PWMGR_NUM_PASSWORDS_PER_HOSTNAME");
3146- for (let count of hostnameCount.values()) {
3147- passwordsCountHistogram.add(count);
3148- }
3149- },
3150-
3151-
3152-
3153-
3154
3155 /* ---------- Primary Public interfaces ---------- */
3156
3157diff --git a/toolkit/components/passwordmgr/nsLoginManagerPrompter.js b/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
3158index c4be39e31..9792e1088 100644
3159--- a/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
3160+++ b/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
3161@@ -18,14 +18,6 @@ const LoginInfo =
3162
3163 const BRAND_BUNDLE = "chrome://branding/locale/brand.properties";
3164
3165-/**
3166- * Constants for password prompt telemetry.
3167- * Mirrored in mobile/android/components/LoginManagerPrompter.js */
3168-const PROMPT_DISPLAYED = 0;
3169-
3170-const PROMPT_ADD_OR_UPDATE = 1;
3171-const PROMPT_NOTNOW = 2;
3172-const PROMPT_NEVER = 3;
3173
3174 /**
3175 * Implements nsIPromptFactory
3176@@ -856,11 +848,6 @@ LoginManagerPrompter.prototype = {
3177 let promptMsg = type == "password-save" ? this._getLocalizedString(saveMsgNames.prompt, [brandShortName])
3178 : this._getLocalizedString(changeMsgNames.prompt);
3179
3180- let histogramName = type == "password-save" ? "PWMGR_PROMPT_REMEMBER_ACTION"
3181- : "PWMGR_PROMPT_UPDATE_ACTION";
3182- let histogram = Services.telemetry.getHistogramById(histogramName);
3183- histogram.add(PROMPT_DISPLAYED);
3184-
3185 let chromeDoc = browser.ownerDocument;
3186
3187 let currentNotification;
3188diff --git a/toolkit/components/places/BookmarkHTMLUtils.jsm b/toolkit/components/places/BookmarkHTMLUtils.jsm
3189index c10ef85d6..6b4ea7934 100644
3190--- a/toolkit/components/places/BookmarkHTMLUtils.jsm
3191+++ b/toolkit/components/places/BookmarkHTMLUtils.jsm
3192@@ -220,14 +220,6 @@ this.BookmarkHTMLUtils = Object.freeze({
3193 let exporter = new BookmarkExporter(bookmarks);
3194 yield exporter.exportToFile(aFilePath);
3195
3196- try {
3197- Services.telemetry
3198- .getHistogramById("PLACES_EXPORT_TOHTML_MS")
3199- .add(Date.now() - startTime);
3200- } catch (ex) {
3201- Components.utils.reportError("Unable to report telemetry.");
3202- }
3203-
3204 return count;
3205 });
3206 },
3207diff --git a/toolkit/components/places/PlacesDBUtils.jsm b/toolkit/components/places/PlacesDBUtils.jsm
3208index 4ac6ea261..baeb17a2b 100644
3209--- a/toolkit/components/places/PlacesDBUtils.jsm
3210+++ b/toolkit/components/places/PlacesDBUtils.jsm
3211@@ -50,14 +50,6 @@ this.PlacesDBUtils = {
3212 task.call(PlacesDBUtils, aTasks);
3213 }
3214 else {
3215- // All tasks have been completed.
3216- // Telemetry the time it took for maintenance, if a start time exists.
3217- if (aTasks._telemetryStart) {
3218- Services.telemetry.getHistogramById("PLACES_IDLE_MAINTENANCE_TIME_MS")
3219- .add(Date.now() - aTasks._telemetryStart);
3220- aTasks._telemetryStart = 0;
3221- }
3222-
3223 if (aTasks.callback) {
3224 let scope = aTasks.scope || Cu.getGlobalForObject(aTasks.callback);
3225 aTasks.callback.call(scope, aTasks.messages);
3226@@ -89,7 +81,6 @@ this.PlacesDBUtils = {
3227 , this.checkCoherence
3228 , this._refreshUI
3229 ]);
3230- tasks._telemetryStart = Date.now();
3231 tasks.callback = function() {
3232 Services.prefs.setIntPref("places.database.lastMaintenance",
3233 parseInt(Date.now() / 1000));
3234@@ -856,181 +847,6 @@ this.PlacesDBUtils = {
3235 PlacesDBUtils._executeTasks(tasks);
3236 },
3237
3238- /**
3239- * Collects telemetry data and reports it to Telemetry.
3240- *
3241- * @param [optional] aTasks
3242- * Tasks object to execute.
3243- */
3244- telemetry: function PDBU_telemetry(aTasks)
3245- {
3246- let tasks = new Tasks(aTasks);
3247-
3248- // This will be populated with one integer property for each probe result,
3249- // using the histogram name as key.
3250- let probeValues = {};
3251-
3252- // The following array contains an ordered list of entries that are
3253- // processed to collect telemetry data. Each entry has these properties:
3254- //
3255- // histogram: Name of the telemetry histogram to update.
3256- // query: This is optional. If present, contains a database command
3257- // that will be executed asynchronously, and whose result will
3258- // be added to the telemetry histogram.
3259- // callback: This is optional. If present, contains a function that must
3260- // return the value that will be added to the telemetry
3261- // histogram. If a query is also present, its result is passed
3262- // as the first argument of the function. If the function
3263- // raises an exception, no data is added to the histogram.
3264- //
3265- // Since all queries are executed in order by the database backend, the
3266- // callbacks can also use the result of previous queries stored in the
3267- // probeValues object.
3268- let probes = [
3269- { histogram: "PLACES_PAGES_COUNT",
3270- query: "SELECT count(*) FROM moz_places" },
3271-
3272- { histogram: "PLACES_BOOKMARKS_COUNT",
3273- query: `SELECT count(*) FROM moz_bookmarks b
3274- JOIN moz_bookmarks t ON t.id = b.parent
3275- AND t.parent <> :tags_folder
3276- WHERE b.type = :type_bookmark` },
3277-
3278- { histogram: "PLACES_TAGS_COUNT",
3279- query: `SELECT count(*) FROM moz_bookmarks
3280- WHERE parent = :tags_folder` },
3281-
3282- { histogram: "PLACES_KEYWORDS_COUNT",
3283- query: "SELECT count(*) FROM moz_keywords" },
3284-
3285- { histogram: "PLACES_SORTED_BOOKMARKS_PERC",
3286- query: `SELECT IFNULL(ROUND((
3287- SELECT count(*) FROM moz_bookmarks b
3288- JOIN moz_bookmarks t ON t.id = b.parent
3289- AND t.parent <> :tags_folder AND t.parent > :places_root
3290- WHERE b.type = :type_bookmark
3291- ) * 100 / (
3292- SELECT count(*) FROM moz_bookmarks b
3293- JOIN moz_bookmarks t ON t.id = b.parent
3294- AND t.parent <> :tags_folder
3295- WHERE b.type = :type_bookmark
3296- )), 0)` },
3297-
3298- { histogram: "PLACES_TAGGED_BOOKMARKS_PERC",
3299- query: `SELECT IFNULL(ROUND((
3300- SELECT count(*) FROM moz_bookmarks b
3301- JOIN moz_bookmarks t ON t.id = b.parent
3302- AND t.parent = :tags_folder
3303- ) * 100 / (
3304- SELECT count(*) FROM moz_bookmarks b
3305- JOIN moz_bookmarks t ON t.id = b.parent
3306- AND t.parent <> :tags_folder
3307- WHERE b.type = :type_bookmark
3308- )), 0)` },
3309-
3310- { histogram: "PLACES_DATABASE_FILESIZE_MB",
3311- callback: function () {
3312- let DBFile = Services.dirsvc.get("ProfD", Ci.nsILocalFile);
3313- DBFile.append("places.sqlite");
3314- return parseInt(DBFile.fileSize / BYTES_PER_MEBIBYTE);
3315- }
3316- },
3317-
3318- { histogram: "PLACES_DATABASE_PAGESIZE_B",
3319- query: "PRAGMA page_size /* PlacesDBUtils.jsm PAGESIZE_B */" },
3320-
3321- { histogram: "PLACES_DATABASE_SIZE_PER_PAGE_B",
3322- query: "PRAGMA page_count",
3323- callback: function (aDbPageCount) {
3324- // Note that the database file size would not be meaningful for this
3325- // calculation, because the file grows in fixed-size chunks.
3326- let dbPageSize = probeValues.PLACES_DATABASE_PAGESIZE_B;
3327- let placesPageCount = probeValues.PLACES_PAGES_COUNT;
3328- return Math.round((dbPageSize * aDbPageCount) / placesPageCount);
3329- }
3330- },
3331-
3332- { histogram: "PLACES_ANNOS_BOOKMARKS_COUNT",
3333- query: "SELECT count(*) FROM moz_items_annos" },
3334-
3335- { histogram: "PLACES_ANNOS_PAGES_COUNT",
3336- query: "SELECT count(*) FROM moz_annos" },
3337-
3338- { histogram: "PLACES_MAINTENANCE_DAYSFROMLAST",
3339- callback: function () {
3340- try {
3341- let lastMaintenance = Services.prefs.getIntPref("places.database.lastMaintenance");
3342- let nowSeconds = parseInt(Date.now() / 1000);
3343- return parseInt((nowSeconds - lastMaintenance) / 86400);
3344- } catch (ex) {
3345- return 60;
3346- }
3347- }
3348- },
3349- ];
3350-
3351- let params = {
3352- tags_folder: PlacesUtils.tagsFolderId,
3353- type_folder: PlacesUtils.bookmarks.TYPE_FOLDER,
3354- type_bookmark: PlacesUtils.bookmarks.TYPE_BOOKMARK,
3355- places_root: PlacesUtils.placesRootId
3356- };
3357-
3358- for (let i = 0; i < probes.length; i++) {
3359- let probe = probes[i];
3360-
3361- let promiseDone = new Promise((resolve, reject) => {
3362- if (!("query" in probe)) {
3363- resolve([probe]);
3364- return;
3365- }
3366-
3367- let stmt = DBConn.createAsyncStatement(probe.query);
3368- for (let param in params) {
3369- if (probe.query.indexOf(":" + param) > 0) {
3370- stmt.params[param] = params[param];
3371- }
3372- }
3373-
3374- try {
3375- stmt.executeAsync({
3376- handleError: reject,
3377- handleResult: function (aResultSet) {
3378- let row = aResultSet.getNextRow();
3379- resolve([probe, row.getResultByIndex(0)]);
3380- },
3381- handleCompletion: function () {}
3382- });
3383- } finally {
3384- stmt.finalize();
3385- }
3386- });
3387-
3388- // Report the result of the probe through Telemetry.
3389- // The resulting promise cannot reject.
3390- promiseDone.then(
3391- // On success
3392- ([aProbe, aValue]) => {
3393- let value = aValue;
3394- try {
3395- if ("callback" in aProbe) {
3396- value = aProbe.callback(value);
3397- }
3398- probeValues[aProbe.histogram] = value;
3399- Services.telemetry.getHistogramById(aProbe.histogram).add(value);
3400- } catch (ex) {
3401- Components.utils.reportError("Error adding value " + value +
3402- " to histogram " + aProbe.histogram +
3403- ": " + ex);
3404- }
3405- },
3406- // On failure
3407- this._handleError);
3408- }
3409-
3410- PlacesDBUtils._executeTasks(tasks);
3411- },
3412-
3413 /**
3414 * Runs a list of tasks, notifying log messages to the callback.
3415 *
3416@@ -1068,7 +884,6 @@ function Tasks(aTasks)
3417 this._log = aTasks.messages;
3418 this.callback = aTasks.callback;
3419 this.scope = aTasks.scope;
3420- this._telemetryStart = aTasks._telemetryStart;
3421 }
3422 }
3423 }
3424@@ -1078,7 +893,6 @@ Tasks.prototype = {
3425 _log: [],
3426 callback: null,
3427 scope: null,
3428- _telemetryStart: 0,
3429
3430 /**
3431 * Adds a task to the top of the list.
3432diff --git a/toolkit/components/places/nsPlacesExpiration.js b/toolkit/components/places/nsPlacesExpiration.js
3433index 767a4d345..e5c5f873f 100644
3434--- a/toolkit/components/places/nsPlacesExpiration.js
3435+++ b/toolkit/components/places/nsPlacesExpiration.js
3436@@ -709,7 +709,6 @@ nsPlacesExpiration.prototype = {
3437 },
3438
3439 // Number of expiration steps needed to reach a CLEAN status.
3440- _telemetrySteps: 1,
3441 handleCompletion: function PEX_handleCompletion(aReason)
3442 {
3443 if (aReason == Ci.mozIStorageStatementCallback.REASON_FINISHED) {
3444@@ -730,29 +729,9 @@ nsPlacesExpiration.prototype = {
3445 // Adapt the aggressivity of steps based on the status of history.
3446 // A dirty history will return all the entries we are expecting bringing
3447 // our countdown to zero, while a clean one will not.
3448- let oldStatus = this.status;
3449 this.status = this._expectedResultsCount == 0 ? STATUS.DIRTY
3450 : STATUS.CLEAN;
3451
3452- // Collect or send telemetry data.
3453- if (this.status == STATUS.DIRTY) {
3454- this._telemetrySteps++;
3455- }
3456- else {
3457- // Avoid reporting the common cases where the database is clean, or
3458- // a single step is needed.
3459- if (oldStatus == STATUS.DIRTY) {
3460- try {
3461- Services.telemetry
3462- .getHistogramById("PLACES_EXPIRATION_STEPS_TO_CLEAN2")
3463- .add(this._telemetrySteps);
3464- } catch (ex) {
3465- Components.utils.reportError("Unable to report telemetry.");
3466- }
3467- }
3468- this._telemetrySteps = 1;
3469- }
3470-
3471 delete this._expectedResultsCount;
3472 }
3473
3474diff --git a/toolkit/components/printing/content/printUtils.js b/toolkit/components/printing/content/printUtils.js
3475index 416954188..62602396c 100644
3476--- a/toolkit/components/printing/content/printUtils.js
3477+++ b/toolkit/components/printing/content/printUtils.js
3478@@ -198,9 +198,6 @@ var PrintUtils = {
3479 this._sourceBrowser = aListenerObj.getSourceBrowser();
3480 this._originalTitle = this._sourceBrowser.contentTitle;
3481 this._originalURL = this._sourceBrowser.currentURI.spec;
3482-
3483- // Here we log telemetry data for when the user enters print preview.
3484- this.logTelemetry("PRINT_PREVIEW_OPENED_COUNT");
3485 } else {
3486 // collapse the browser here -- it will be shown in
3487 // enterPrintPreview; this forces a reflow which fixes display
3488@@ -536,9 +533,6 @@ var PrintUtils = {
3489 URL: this._originalURL,
3490 windowID: this._sourceBrowser.outerWindowID,
3491 });
3492-
3493- // Here we log telemetry data for when the user enters simplify mode.
3494- this.logTelemetry("PRINT_PREVIEW_SIMPLIFY_PAGE_OPENED_COUNT");
3495 }
3496 } else {
3497 sendEnterPreviewMessage(this._sourceBrowser, false);
3498@@ -597,7 +591,6 @@ var PrintUtils = {
3499 if (this._sourceBrowser.isArticle) {
3500 printPreviewTB.enableSimplifyPage();
3501 } else {
3502- this.logTelemetry("PRINT_PREVIEW_SIMPLIFY_PAGE_UNAVAILABLE_COUNT");
3503 printPreviewTB.disableSimplifyPage();
3504 }
3505
3506@@ -652,12 +645,6 @@ var PrintUtils = {
3507 this._listener.onExit();
3508 },
3509
3510- logTelemetry: function (ID)
3511- {
3512- let histogram = Services.telemetry.getHistogramById(ID);
3513- histogram.add(true);
3514- },
3515-
3516 onKeyDownPP: function (aEvent)
3517 {
3518 // Esc exits the PP
3519diff --git a/toolkit/components/terminator/moz.build b/toolkit/components/terminator/moz.build
3520index 7e230ed4d..943a7369c 100644
3521--- a/toolkit/components/terminator/moz.build
3522+++ b/toolkit/components/terminator/moz.build
3523@@ -15,7 +15,6 @@ EXPORTS += [
3524 ]
3525
3526 EXTRA_COMPONENTS += [
3527- 'nsTerminatorTelemetry.js',
3528 'terminator.manifest',
3529 ]
3530
3531diff --git a/toolkit/components/terminator/nsTerminatorTelemetry.js b/toolkit/components/terminator/nsTerminatorTelemetry.js
3532deleted file mode 100644
3533index ed017da78..000000000
3534--- a/toolkit/components/terminator/nsTerminatorTelemetry.js
3535+++ /dev/null
3536@@ -1,105 +0,0 @@
3537-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
3538-/* vim: set ts=2 et sw=2 tw=80 filetype=javascript: */
3539-/* This Source Code Form is subject to the terms of the Mozilla Public
3540- * License, v. 2.0. If a copy of the MPL was not distributed with this
3541- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
3542-
3543-"use strict";
3544-
3545-/**
3546- * Read the data saved by nsTerminator during shutdown and feed it to the
3547- * relevant telemetry histograms.
3548- */
3549-
3550-const Cc = Components.classes;
3551-const Ci = Components.interfaces;
3552-const Cu = Components.utils;
3553-const Cr = Components.results;
3554-
3555-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
3556-
3557-XPCOMUtils.defineLazyModuleGetter(this, "OS",
3558- "resource://gre/modules/osfile.jsm");
3559-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
3560- "resource://gre/modules/Promise.jsm");
3561-XPCOMUtils.defineLazyModuleGetter(this, "Task",
3562- "resource://gre/modules/Task.jsm");
3563-XPCOMUtils.defineLazyModuleGetter(this, "setTimeout",
3564- "resource://gre/modules/Timer.jsm");
3565-XPCOMUtils.defineLazyModuleGetter(this, "Services",
3566- "resource://gre/modules/Services.jsm");
3567-
3568-function nsTerminatorTelemetry() {}
3569-
3570-var HISTOGRAMS = {
3571- "quit-application": "SHUTDOWN_PHASE_DURATION_TICKS_QUIT_APPLICATION",
3572- "profile-change-teardown": "SHUTDOWN_PHASE_DURATION_TICKS_PROFILE_CHANGE_TEARDOWN",
3573- "profile-before-change": "SHUTDOWN_PHASE_DURATION_TICKS_PROFILE_BEFORE_CHANGE",
3574- "xpcom-will-shutdown": "SHUTDOWN_PHASE_DURATION_TICKS_XPCOM_WILL_SHUTDOWN",
3575-};
3576-
3577-nsTerminatorTelemetry.prototype = {
3578- classID: Components.ID("{3f78ada1-cba2-442a-82dd-d5fb300ddea7}"),
3579-
3580- _xpcom_factory: XPCOMUtils.generateSingletonFactory(nsTerminatorTelemetry),
3581-
3582- // nsISupports
3583-
3584- QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
3585-
3586- // nsIObserver
3587-
3588- observe: function DS_observe(aSubject, aTopic, aData)
3589- {
3590- Task.spawn(function*() {
3591- //
3592- // This data is hardly critical, reading it can wait for a few seconds.
3593- //
3594- yield new Promise(resolve => setTimeout(resolve, 3000));
3595-
3596- let PATH = OS.Path.join(OS.Constants.Path.localProfileDir,
3597- "ShutdownDuration.json");
3598- let raw;
3599- try {
3600- raw = yield OS.File.read(PATH, { encoding: "utf-8" });
3601- } catch (ex) {
3602- if (!ex.becauseNoSuchFile) {
3603- throw ex;
3604- }
3605- return;
3606- }
3607- // Let other errors be reported by Promise's error-reporting.
3608-
3609- // Clean up
3610- OS.File.remove(PATH);
3611- OS.File.remove(PATH + ".tmp");
3612-
3613- let data = JSON.parse(raw);
3614- for (let k of Object.keys(data)) {
3615- let id = HISTOGRAMS[k];
3616- try {
3617- let histogram = Services.telemetry.getHistogramById(id);
3618- if (!histogram) {
3619- throw new Error("Unknown histogram " + id);
3620- }
3621-
3622- histogram.add(Number.parseInt(data[k]));
3623- } catch (ex) {
3624- // Make sure that the error is reported and causes test failures,
3625- // but otherwise, ignore it.
3626- Promise.reject(ex);
3627- continue;
3628- }
3629- }
3630-
3631- // Inform observers that we are done.
3632- Services.obs.notifyObservers(null,
3633- "shutdown-terminator-telemetry-updated",
3634- "");
3635- });
3636- },
3637-};
3638-
3639-// Module
3640-
3641-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsTerminatorTelemetry]);
3642diff --git a/toolkit/components/thumbnails/BackgroundPageThumbs.jsm b/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
3643index 3ed32665d..21d051950 100644
3644--- a/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
3645+++ b/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
3646@@ -10,8 +10,6 @@ const DEFAULT_CAPTURE_TIMEOUT = 30000; // ms
3647 const DESTROY_BROWSER_TIMEOUT = 60000; // ms
3648 const FRAME_SCRIPT_URL = "chrome://global/content/backgroundPageThumbsContent.js";
3649
3650-const TELEMETRY_HISTOGRAM_ID_PREFIX = "FX_THUMBNAILS_BG_";
3651-
3652 const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
3653 const HTML_NS = "http://www.w3.org/1999/xhtml";
3654
3655@@ -22,19 +20,6 @@ Cu.import("resource://gre/modules/PageThumbs.jsm");
3656 Cu.import("resource://gre/modules/Services.jsm");
3657 Cu.import("resource://gre/modules/Task.jsm");
3658
3659-// possible FX_THUMBNAILS_BG_CAPTURE_DONE_REASON_2 telemetry values
3660-const TEL_CAPTURE_DONE_OK = 0;
3661-const TEL_CAPTURE_DONE_TIMEOUT = 1;
3662-// 2 and 3 were used when we had special handling for private-browsing.
3663-const TEL_CAPTURE_DONE_CRASHED = 4;
3664-const TEL_CAPTURE_DONE_BAD_URI = 5;
3665-
3666-// These are looked up on the global as properties below.
3667-XPCOMUtils.defineConstant(this, "TEL_CAPTURE_DONE_OK", TEL_CAPTURE_DONE_OK);
3668-XPCOMUtils.defineConstant(this, "TEL_CAPTURE_DONE_TIMEOUT", TEL_CAPTURE_DONE_TIMEOUT);
3669-XPCOMUtils.defineConstant(this, "TEL_CAPTURE_DONE_CRASHED", TEL_CAPTURE_DONE_CRASHED);
3670-XPCOMUtils.defineConstant(this, "TEL_CAPTURE_DONE_BAD_URI", TEL_CAPTURE_DONE_BAD_URI);
3671-
3672 const global = this;
3673
3674 // contains base64 version of a placeholder thumbnail
3675@@ -67,8 +52,6 @@ const BackgroundPageThumbs = {
3676 this._captureQueue = this._captureQueue || [];
3677 this._capturesByURL = this._capturesByURL || new Map();
3678
3679- tel("QUEUE_SIZE_ON_CAPTURE", this._captureQueue.length);
3680-
3681 // We want to avoid duplicate captures for the same URL. If there is an
3682 // existing one, we just add the callback to that one and we are done.
3683 let existing = this._capturesByURL.get(url);
3684@@ -322,7 +305,6 @@ function Capture(url, captureCallback, options) {
3685 this.captureCallback = captureCallback;
3686 this.options = options;
3687 this.id = Capture.nextID++;
3688- this.creationDate = new Date();
3689 this.doneCallbacks = [];
3690 this.doneReason;
3691 if (options.onDone)
3692@@ -341,8 +323,6 @@ Capture.prototype = {
3693 * @param messageManager The nsIMessageSender of the thumbnail browser.
3694 */
3695 start: function (messageManager) {
3696- this.startDate = new Date();
3697- tel("CAPTURE_QUEUE_TIME_MS", this.startDate - this.creationDate);
3698
3699 // timeout timer
3700 let timeout;
3701@@ -419,13 +399,6 @@ Capture.prototype = {
3702 if (typeof(reason) != "number") {
3703 throw new Error("A done reason must be given.");
3704 }
3705- tel("CAPTURE_DONE_REASON_2", reason);
3706- if (data && data.telemetry) {
3707- // Telemetry is currently disabled in the content process (bug 680508).
3708- for (let id in data.telemetry) {
3709- tel(id, data.telemetry[id]);
3710- }
3711- }
3712
3713 let done = () => {
3714 captureCallback(this);
3715@@ -454,17 +427,6 @@ Capture.prototype = {
3716
3717 Capture.nextID = 0;
3718
3719-/**
3720- * Adds a value to one of this module's telemetry histograms.
3721- *
3722- * @param histogramID This is prefixed with this module's ID.
3723- * @param value The value to add.
3724- */
3725-function tel(histogramID, value) {
3726- let id = TELEMETRY_HISTOGRAM_ID_PREFIX + histogramID;
3727- Services.telemetry.getHistogramById(id).add(value);
3728-}
3729-
3730 function schedule(callback) {
3731 Services.tm.mainThread.dispatch(callback, Ci.nsIThread.DISPATCH_NORMAL);
3732 }
3733diff --git a/toolkit/components/thumbnails/PageThumbs.jsm b/toolkit/components/thumbnails/PageThumbs.jsm
3734index b0affee92..714bbbb77 100644
3735--- a/toolkit/components/thumbnails/PageThumbs.jsm
3736+++ b/toolkit/components/thumbnails/PageThumbs.jsm
3737@@ -215,14 +215,10 @@ this.PageThumbs = {
3738 * fullScale - request that a non-downscaled image be returned.
3739 */
3740 captureToCanvas: function (aBrowser, aCanvas, aCallback, aArgs) {
3741- let telemetryCaptureTime = new Date();
3742 let args = {
3743 fullScale: aArgs ? aArgs.fullScale : false
3744 };
3745 this._captureToCanvas(aBrowser, aCanvas, args, (aCanvas) => {
3746- Services.telemetry
3747- .getHistogramById("FX_THUMBNAILS_CAPTURE_TIME_MS")
3748- .add(new Date() - telemetryCaptureTime);
3749 if (aCallback) {
3750 aCallback(aCanvas);
3751 }
3752@@ -450,10 +446,7 @@ this.PageThumbs = {
3753 */
3754 _store: function PageThumbs__store(aOriginalURL, aFinalURL, aData, aNoOverwrite) {
3755 return Task.spawn(function* () {
3756- let telemetryStoreTime = new Date();
3757 yield PageThumbsStorage.writeData(aFinalURL, aData, aNoOverwrite);
3758- Services.telemetry.getHistogramById("FX_THUMBNAILS_STORE_TIME_MS")
3759- .add(new Date() - telemetryStoreTime);
3760
3761 Services.obs.notifyObservers(null, "page-thumbnail:create", aFinalURL);
3762 // We've been redirected. Create a copy of the current thumbnail for
3763diff --git a/toolkit/components/thumbnails/content/backgroundPageThumbsContent.js b/toolkit/components/thumbnails/content/backgroundPageThumbsContent.js
3764index 2103833b7..ab39e73f7 100644
3765--- a/toolkit/components/thumbnails/content/backgroundPageThumbsContent.js
3766+++ b/toolkit/components/thumbnails/content/backgroundPageThumbsContent.js
3767@@ -169,10 +169,6 @@ const backgroundPageThumbsContent = {
3768 id: capture.id,
3769 imageData: fileReader.result,
3770 finalURL: capture.finalURL,
3771- telemetry: {
3772- CAPTURE_PAGE_LOAD_TIME_MS: capture.pageLoadTime,
3773- CAPTURE_CANVAS_DRAW_TIME_MS: capture.canvasDrawTime,
3774- },
3775 });
3776 };
3777 fileReader.readAsArrayBuffer(capture.imageBlob);
3778diff --git a/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js b/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js
3779index 5d462c90d..27e9c6b89 100644
3780--- a/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js
3781+++ b/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js
3782@@ -30,115 +30,6 @@ function log(...stuff) {
3783 dump(Services.urlFormatter.trimSensitiveURLs(msg) + "\n");
3784 }
3785
3786-// Map the HTTP response code to a Telemetry bucket
3787-// https://developers.google.com/safe-browsing/developers_guide_v2?hl=en
3788-function httpStatusToBucket(httpStatus) {
3789- var statusBucket;
3790- switch (httpStatus) {
3791- case 100:
3792- case 101:
3793- // Unexpected 1xx return code
3794- statusBucket = 0;
3795- break;
3796- case 200:
3797- // OK - Data is available in the HTTP response body.
3798- statusBucket = 1;
3799- break;
3800- case 201:
3801- case 202:
3802- case 203:
3803- case 205:
3804- case 206:
3805- // Unexpected 2xx return code
3806- statusBucket = 2;
3807- break;
3808- case 204:
3809- // No Content - There are no full-length hashes with the requested prefix.
3810- statusBucket = 3;
3811- break;
3812- case 300:
3813- case 301:
3814- case 302:
3815- case 303:
3816- case 304:
3817- case 305:
3818- case 307:
3819- case 308:
3820- // Unexpected 3xx return code
3821- statusBucket = 4;
3822- break;
3823- case 400:
3824- // Bad Request - The HTTP request was not correctly formed.
3825- // The client did not provide all required CGI parameters.
3826- statusBucket = 5;
3827- break;
3828- case 401:
3829- case 402:
3830- case 405:
3831- case 406:
3832- case 407:
3833- case 409:
3834- case 410:
3835- case 411:
3836- case 412:
3837- case 414:
3838- case 415:
3839- case 416:
3840- case 417:
3841- case 421:
3842- case 426:
3843- case 428:
3844- case 429:
3845- case 431:
3846- case 451:
3847- // Unexpected 4xx return code
3848- statusBucket = 6;
3849- break;
3850- case 403:
3851- // Forbidden - The client id is invalid.
3852- statusBucket = 7;
3853- break;
3854- case 404:
3855- // Not Found
3856- statusBucket = 8;
3857- break;
3858- case 408:
3859- // Request Timeout
3860- statusBucket = 9;
3861- break;
3862- case 413:
3863- // Request Entity Too Large - Bug 1150334
3864- statusBucket = 10;
3865- break;
3866- case 500:
3867- case 501:
3868- case 510:
3869- // Unexpected 5xx return code
3870- statusBucket = 11;
3871- break;
3872- case 502:
3873- case 504:
3874- case 511:
3875- // Local network errors, we'll ignore these.
3876- statusBucket = 12;
3877- break;
3878- case 503:
3879- // Service Unavailable - The server cannot handle the request.
3880- // Clients MUST follow the backoff behavior specified in the
3881- // Request Frequency section.
3882- statusBucket = 13;
3883- break;
3884- case 505:
3885- // HTTP Version Not Supported - The server CANNOT handle the requested
3886- // protocol major version.
3887- statusBucket = 14;
3888- break;
3889- default:
3890- statusBucket = 15;
3891- };
3892- return statusBucket;
3893-}
3894-
3895 function HashCompleter() {
3896 // The current HashCompleterRequest in flight. Once it is started, it is set
3897 // to null. It may be used by multiple calls to |complete| in succession to
3898@@ -321,7 +212,6 @@ HashCompleterRequest.prototype = {
3899 // channel.
3900 if (this._channel && this._channel.isPending()) {
3901 log("cancelling request to " + this.gethashUrl + "\n");
3902- Services.telemetry.getHistogramById("URLCLASSIFIER_COMPLETE_TIMEOUT").add(1);
3903 this._channel.cancel(Cr.NS_BINDING_ABORTED);
3904 }
3905 },
3906@@ -529,11 +419,6 @@ HashCompleterRequest.prototype = {
3907 let success = Components.isSuccessCode(aStatusCode);
3908 log('Received a ' + httpStatus + ' status code from the gethash server (success=' + success + ').');
3909
3910- let histogram =
3911- Services.telemetry.getHistogramById("URLCLASSIFIER_COMPLETE_REMOTE_STATUS");
3912- histogram.add(httpStatusToBucket(httpStatus));
3913- Services.telemetry.getHistogramById("URLCLASSIFIER_COMPLETE_TIMEOUT").add(0);
3914-
3915 // Notify the RequestBackoff once a response is received.
3916 this._completer.finishRequest(this.gethashUrl, httpStatus);
3917
3918diff --git a/toolkit/components/viewsource/content/viewSourceUtils.js b/toolkit/components/viewsource/content/viewSourceUtils.js
3919index 11b39ca54..72f5dd787 100644
3920--- a/toolkit/components/viewsource/content/viewSourceUtils.js
3921+++ b/toolkit/components/viewsource/content/viewSourceUtils.js
3922@@ -90,9 +90,6 @@ var gViewSourceUtils = {
3923 * The line number to focus on once the source is loaded.
3924 */
3925 viewSourceInBrowser: function(aArgs) {
3926- Services.telemetry
3927- .getHistogramById("VIEW_SOURCE_IN_BROWSER_OPENED_BOOLEAN")
3928- .add(true);
3929 let viewSourceBrowser = new ViewSourceBrowser(aArgs.viewSourceBrowser);
3930 viewSourceBrowser.loadViewSource(aArgs);
3931 },
3932@@ -160,9 +157,6 @@ var gViewSourceUtils = {
3933 } catch (ex) {
3934 }
3935 }
3936- Services.telemetry
3937- .getHistogramById("VIEW_SOURCE_IN_WINDOW_OPENED_BOOLEAN")
3938- .add(true);
3939 openDialog("chrome://global/content/viewSource.xul",
3940 "_blank",
3941 "all,dialog=no",
3942@@ -347,9 +341,6 @@ var gViewSourceUtils = {
3943 // Calls the callback, keeping in mind undefined or null values.
3944 handleCallBack: function(aCallBack, result, data)
3945 {
3946- Services.telemetry
3947- .getHistogramById("VIEW_SOURCE_EXTERNAL_RESULT_BOOLEAN")
3948- .add(result);
3949 // if callback is undefined, default to the internal viewer
3950 if (aCallBack === undefined) {
3951 this.internalViewerFallback(result, data);
3952--
39532.24.0