Bug 1482091: Part 2 - Remove TelemetryStopwatch.jsm in favor of native implementation. r=chutten
☠☠ backed out by b82f3434f70c ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Thu, 25 Oct 2018 19:04:01 -0700
changeset 500729 bc03f101937e373fdaca735f3f356960a5239bc0
parent 500728 28a19b7290ab288a1cb2cbf6d49f905cecc9682b
child 500730 b2b79634580761f4219bd3e9ca3efc544925a6f0
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschutten
bugs1482091
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1482091: Part 2 - Remove TelemetryStopwatch.jsm in favor of native implementation. r=chutten Differential Revision: https://phabricator.services.mozilla.com/D9888
browser/base/content/browser.js
browser/base/content/test/performance/browser_startup_content.js
browser/components/customizableui/test/browser_panelUINotifications_fullscreen_noAutoHideToolbar.js
browser/components/migration/MigrationUtils.jsm
browser/components/places/content/historySidebar.js
browser/components/places/content/places.js
browser/components/sessionstore/ContentSessionStore.jsm
browser/components/sessionstore/SessionSaver.jsm
browser/components/sessionstore/SessionStore.jsm
browser/modules/AsyncTabSwitcher.jsm
browser/modules/Sanitizer.jsm
browser/modules/SchedulePressure.jsm
devtools/client/shared/telemetry.js
dom/html/test/browser_fullscreen-newtab.js
mobile/android/chrome/content/aboutLogins.js
mobile/android/chrome/content/browser.js
mobile/android/components/SessionStore.js
mobile/android/modules/Sanitizer.jsm
toolkit/components/extensions/ExtensionTelemetry.jsm
toolkit/components/narrate/NarrateControls.jsm
toolkit/components/osfile/modules/osfile_async_front.jsm
toolkit/components/places/UnifiedComplete.js
toolkit/components/search/nsSearchService.js
toolkit/components/telemetry/app/TelemetryStopwatch.jsm
toolkit/components/telemetry/docs/collection/histograms.rst
toolkit/components/telemetry/docs/collection/measuring-time.rst
toolkit/components/telemetry/moz.build
toolkit/components/telemetry/tests/unit/test_TelemetrySend.js
toolkit/content/widgets/tabbox.xml
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -59,17 +59,16 @@ XPCOMUtils.defineLazyModuleGetters(this,
   SessionStore: "resource:///modules/sessionstore/SessionStore.jsm",
   SchedulePressure: "resource:///modules/SchedulePressure.jsm",
   ShortcutUtils: "resource://gre/modules/ShortcutUtils.jsm",
   SimpleServiceDiscovery: "resource://gre/modules/SimpleServiceDiscovery.jsm",
   SiteDataManager: "resource:///modules/SiteDataManager.jsm",
   SitePermissions: "resource:///modules/SitePermissions.jsm",
   TabCrashHandler: "resource:///modules/ContentCrashHandlers.jsm",
   TelemetryEnvironment: "resource://gre/modules/TelemetryEnvironment.jsm",
-  TelemetryStopwatch: "resource://gre/modules/TelemetryStopwatch.jsm",
   Translation: "resource:///modules/translation/Translation.jsm",
   UITour: "resource:///modules/UITour.jsm",
   UpdateUtils: "resource://gre/modules/UpdateUtils.jsm",
   UrlbarInput: "resource:///modules/UrlbarInput.jsm",
   UrlbarPrefs: "resource:///modules/UrlbarPrefs.jsm",
   UrlbarUtils: "resource:///modules/UrlbarUtils.jsm",
   UrlbarValueFormatter: "resource:///modules/UrlbarValueFormatter.jsm",
   Utils: "resource://gre/modules/sessionstore/Utils.jsm",
--- a/browser/base/content/test/performance/browser_startup_content.js
+++ b/browser/base/content/test/performance/browser_startup_content.js
@@ -77,17 +77,16 @@ const whitelist = {
 // required, as opposed to items in the main whitelist,
 // which are all required.
 const intermittently_loaded_whitelist = {
   components: new Set([
     "nsAsyncShutdown.js",
   ]),
   modules: new Set([
     "resource://gre/modules/sessionstore/Utils.jsm",
-    "resource://gre/modules/TelemetryStopwatch.jsm",
   ]),
 };
 
 const blacklist = {
   services: new Set([
     "@mozilla.org/base/telemetry-startup;1",
     "@mozilla.org/embedcomp/default-tooltiptextprovider;1",
     "@mozilla.org/push/Service;1",
--- a/browser/components/customizableui/test/browser_panelUINotifications_fullscreen_noAutoHideToolbar.js
+++ b/browser/components/customizableui/test/browser_panelUINotifications_fullscreen_noAutoHideToolbar.js
@@ -1,10 +1,16 @@
 "use strict";
 
+// This test tends to trigger a race in the fullscreen time telemetry,
+// where the fullscreen enter and fullscreen exit events (which use the
+// same histogram ID) overlap. That causes TelemetryStopwatch to log an
+// error.
+SimpleTest.ignoreAllUncaughtExceptions(true);
+
 ChromeUtils.import("resource://gre/modules/AppMenuNotifications.jsm");
 
 function waitForDocshellActivated() {
   return ContentTask.spawn(gBrowser.selectedBrowser, null, async function() {
     // Setting docshell activated/deactivated will trigger visibility state
     // changes to relevant state ("visible" or "hidden"). AFAIK, there is no
     // such event notifying docshell is being activated, so I use
     // "visibilitychange" event rather than polling the docShell.isActive.
--- a/browser/components/migration/MigrationUtils.jsm
+++ b/browser/components/migration/MigrationUtils.jsm
@@ -23,18 +23,16 @@ ChromeUtils.defineModuleGetter(this, "Lo
 ChromeUtils.defineModuleGetter(this, "PlacesUtils",
                                "resource://gre/modules/PlacesUtils.jsm");
 ChromeUtils.defineModuleGetter(this, "PromiseUtils",
                                "resource://gre/modules/PromiseUtils.jsm");
 ChromeUtils.defineModuleGetter(this, "ResponsivenessMonitor",
                                "resource://gre/modules/ResponsivenessMonitor.jsm");
 ChromeUtils.defineModuleGetter(this, "Sqlite",
                                "resource://gre/modules/Sqlite.jsm");
-ChromeUtils.defineModuleGetter(this, "TelemetryStopwatch",
-                               "resource://gre/modules/TelemetryStopwatch.jsm");
 ChromeUtils.defineModuleGetter(this, "WindowsRegistry",
                                "resource://gre/modules/WindowsRegistry.jsm");
 ChromeUtils.defineModuleGetter(this, "setTimeout",
                                "resource://gre/modules/Timer.jsm");
 
 var gMigrators = null;
 var gProfileStartup = null;
 var gMigrationBundle = null;
--- a/browser/components/places/content/historySidebar.js
+++ b/browser/components/places/content/historySidebar.js
@@ -15,18 +15,16 @@ XPCOMUtils.defineLazyModuleGetters(this,
 });
 XPCOMUtils.defineLazyScriptGetter(this, "PlacesTreeView",
                                   "chrome://browser/content/places/treeView.js");
 XPCOMUtils.defineLazyScriptGetter(this, ["PlacesInsertionPoint", "PlacesController",
                                          "PlacesControllerDragHelper"],
                                   "chrome://browser/content/places/controller.js");
 /* End Shared Places Import */
 
-ChromeUtils.import("resource://gre/modules/TelemetryStopwatch.jsm");
-
 var gHistoryTree;
 var gSearchBox;
 var gHistoryGrouping = "";
 var gSearching = false;
 
 function HistorySidebarInit() {
   let uidensity = window.top.document.documentElement.getAttribute("uidensity");
   if (uidensity) {
--- a/browser/components/places/content/places.js
+++ b/browser/components/places/content/places.js
@@ -19,17 +19,16 @@ XPCOMUtils.defineLazyModuleGetters(this,
 XPCOMUtils.defineLazyScriptGetter(this, "PlacesTreeView",
                                   "chrome://browser/content/places/treeView.js");
 XPCOMUtils.defineLazyScriptGetter(this, ["PlacesInsertionPoint", "PlacesController",
                                          "PlacesControllerDragHelper"],
                                   "chrome://browser/content/places/controller.js");
 /* End Shared Places Import */
 
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
-ChromeUtils.import("resource://gre/modules/TelemetryStopwatch.jsm");
 ChromeUtils.defineModuleGetter(this, "MigrationUtils",
                                "resource:///modules/MigrationUtils.jsm");
 ChromeUtils.defineModuleGetter(this, "BookmarkJSONUtils",
                                "resource://gre/modules/BookmarkJSONUtils.jsm");
 ChromeUtils.defineModuleGetter(this, "PlacesBackups",
                                "resource://gre/modules/PlacesBackups.jsm");
 ChromeUtils.defineModuleGetter(this, "DownloadUtils",
                                "resource://gre/modules/DownloadUtils.jsm");
--- a/browser/components/sessionstore/ContentSessionStore.jsm
+++ b/browser/components/sessionstore/ContentSessionStore.jsm
@@ -5,19 +5,16 @@
 "use strict";
 
 var EXPORTED_SYMBOLS = ["ContentSessionStore"];
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm", this);
 ChromeUtils.import("resource://gre/modules/Timer.jsm", this);
 ChromeUtils.import("resource://gre/modules/Services.jsm", this);
 
-ChromeUtils.defineModuleGetter(this, "TelemetryStopwatch",
-  "resource://gre/modules/TelemetryStopwatch.jsm");
-
 function debug(msg) {
   Services.console.logStringMessage("SessionStoreContent: " + msg);
 }
 
 ChromeUtils.defineModuleGetter(this, "FormData",
   "resource://gre/modules/FormData.jsm");
 
 ChromeUtils.defineModuleGetter(this, "ContentRestore",
--- a/browser/components/sessionstore/SessionSaver.jsm
+++ b/browser/components/sessionstore/SessionSaver.jsm
@@ -4,17 +4,16 @@
 
 "use strict";
 
 var EXPORTED_SYMBOLS = ["SessionSaver"];
 
 ChromeUtils.import("resource://gre/modules/Timer.jsm", this);
 ChromeUtils.import("resource://gre/modules/Services.jsm", this);
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm", this);
-ChromeUtils.import("resource://gre/modules/TelemetryStopwatch.jsm", this);
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   AppConstants: "resource://gre/modules/AppConstants.jsm",
   PrivacyFilter: "resource://gre/modules/sessionstore/PrivacyFilter.jsm",
   RunState: "resource:///modules/sessionstore/RunState.jsm",
   SessionStore: "resource:///modules/sessionstore/SessionStore.jsm",
   SessionFile: "resource:///modules/sessionstore/SessionFile.jsm",
   PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -151,17 +151,16 @@ const RESTORE_TAB_CONTENT_REASON = {
    * We're restoring this tab's content because a navigation caused
    * us to do a remoteness-flip.
    */
   NAVIGATE_AND_RESTORE: 1,
 };
 
 ChromeUtils.import("resource://gre/modules/PrivateBrowsingUtils.jsm", this);
 ChromeUtils.import("resource://gre/modules/Services.jsm", this);
-ChromeUtils.import("resource://gre/modules/TelemetryStopwatch.jsm", this);
 ChromeUtils.import("resource://gre/modules/TelemetryTimestamps.jsm", this);
 ChromeUtils.import("resource://gre/modules/Timer.jsm", this);
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm", this);
 ChromeUtils.import("resource://gre/modules/osfile.jsm", this);
 
 XPCOMUtils.defineLazyServiceGetters(this, {
   gScreenManager: ["@mozilla.org/gfx/screenmanager;1", "nsIScreenManager"],
   Telemetry: ["@mozilla.org/base/telemetry;1", "nsITelemetry"],
--- a/browser/modules/AsyncTabSwitcher.jsm
+++ b/browser/modules/AsyncTabSwitcher.jsm
@@ -6,17 +6,16 @@
 "use strict";
 
 var EXPORTED_SYMBOLS = ["AsyncTabSwitcher"];
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 XPCOMUtils.defineLazyModuleGetters(this, {
   AppConstants: "resource://gre/modules/AppConstants.jsm",
   Services: "resource://gre/modules/Services.jsm",
-  TelemetryStopwatch: "resource://gre/modules/TelemetryStopwatch.jsm",
 });
 
 XPCOMUtils.defineLazyPreferenceGetter(this, "gTabWarmingEnabled",
   "browser.tabs.remote.warmup.enabled");
 XPCOMUtils.defineLazyPreferenceGetter(this, "gTabWarmingMax",
   "browser.tabs.remote.warmup.maxTabs");
 XPCOMUtils.defineLazyPreferenceGetter(this, "gTabWarmingUnloadDelayMs",
   "browser.tabs.remote.warmup.unloadDelayMs");
--- a/browser/modules/Sanitizer.jsm
+++ b/browser/modules/Sanitizer.jsm
@@ -7,17 +7,16 @@ var EXPORTED_SYMBOLS = ["Sanitizer"];
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   AppConstants: "resource://gre/modules/AppConstants.jsm",
   PlacesUtils: "resource://gre/modules/PlacesUtils.jsm",
   FormHistory: "resource://gre/modules/FormHistory.jsm",
-  TelemetryStopwatch: "resource://gre/modules/TelemetryStopwatch.jsm",
   ContextualIdentityService: "resource://gre/modules/ContextualIdentityService.jsm",
 });
 
 XPCOMUtils.defineLazyServiceGetter(this, "quotaManagerService",
                                    "@mozilla.org/dom/quota-manager-service;1",
                                    "nsIQuotaManagerService");
 XPCOMUtils.defineLazyServiceGetter(this, "serviceWorkerManager",
                                    "@mozilla.org/serviceworkers/manager;1",
--- a/browser/modules/SchedulePressure.jsm
+++ b/browser/modules/SchedulePressure.jsm
@@ -2,18 +2,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 var EXPORTED_SYMBOLS = ["SchedulePressure"];
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-ChromeUtils.defineModuleGetter(this, "TelemetryStopwatch",
-  "resource://gre/modules/TelemetryStopwatch.jsm");
 XPCOMUtils.defineLazyPreferenceGetter(this, "SCHEDULE_PRESSURE_ENABLED",
   "browser.schedulePressure.enabled", true);
 XPCOMUtils.defineLazyPreferenceGetter(this, "TIMEOUT_AMOUNT",
   "browser.schedulePressure.timeoutMs", 300);
 
 /**
  * The SchedulePressure object provides the ability to alter
  * the behavior of a program based on the idle activity of the
--- a/devtools/client/shared/telemetry.js
+++ b/devtools/client/shared/telemetry.js
@@ -6,17 +6,17 @@
  * This is the telemetry module to report metrics for tools.
  *
  * Comprehensive documentation is in docs/frontend/telemetry.md
  */
 
 "use strict";
 
 const Services = require("Services");
-const { TelemetryStopwatch } = require("resource://gre/modules/TelemetryStopwatch.jsm");
+const TelemetryStopwatch = require("TelemetryStopwatch");
 const { getNthPathExcluding } = require("devtools/shared/platform/stack");
 const { TelemetryEnvironment } = require("resource://gre/modules/TelemetryEnvironment.jsm");
 const WeakMapMap = require("devtools/client/shared/WeakMapMap");
 
 const CATEGORY = "devtools.main";
 
 // Object to be shared among all instances.
 const PENDING_EVENT_PROPERTIES = new WeakMapMap();
--- a/dom/html/test/browser_fullscreen-newtab.js
+++ b/dom/html/test/browser_fullscreen-newtab.js
@@ -1,10 +1,16 @@
 "use strict";
 
+// This test tends to trigger a race in the fullscreen time telemetry,
+// where the fullscreen enter and fullscreen exit events (which use the
+// same histogram ID) overlap. That causes TelemetryStopwatch to log an
+// error.
+SimpleTest.ignoreAllUncaughtExceptions(true);
+
 const kPage = "http://example.org/browser/" +
               "dom/html/test/file_fullscreen-newtab.html";
 
 function getSizeMode() {
   return document.documentElement.getAttribute("sizemode");
 }
 
 async function runTest() {
--- a/mobile/android/chrome/content/aboutLogins.js
+++ b/mobile/android/chrome/content/aboutLogins.js
@@ -1,16 +1,15 @@
 /* Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 ChromeUtils.import("resource://services-common/utils.js"); /* global: CommonUtils */
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-ChromeUtils.import("resource://gre/modules/TelemetryStopwatch.jsm");
 
 XPCOMUtils.defineLazyGetter(window, "gChromeWin", () =>
   window.docShell.rootTreeItem.domWindow
     .QueryInterface(Ci.nsIDOMChromeWindow));
 
 ChromeUtils.defineModuleGetter(this, "EventDispatcher",
                                "resource://gre/modules/Messaging.jsm");
 ChromeUtils.defineModuleGetter(this, "Snackbars", "resource://gre/modules/Snackbars.jsm");
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -100,18 +100,16 @@ ChromeUtils.defineModuleGetter(this, "No
 ChromeUtils.defineModuleGetter(this, "ReaderMode", "resource://gre/modules/ReaderMode.jsm");
 
 ChromeUtils.defineModuleGetter(this, "Snackbars", "resource://gre/modules/Snackbars.jsm");
 
 ChromeUtils.defineModuleGetter(this, "RuntimePermissions", "resource://gre/modules/RuntimePermissions.jsm");
 
 ChromeUtils.defineModuleGetter(this, "WebsiteMetadata", "resource://gre/modules/WebsiteMetadata.jsm");
 
-ChromeUtils.defineModuleGetter(this, "TelemetryStopwatch", "resource://gre/modules/TelemetryStopwatch.jsm");
-
 XPCOMUtils.defineLazyServiceGetter(this, "FontEnumerator",
   "@mozilla.org/gfx/fontenumerator;1",
   "nsIFontEnumerator");
 
 ChromeUtils.defineModuleGetter(this, "Utils", "resource://gre/modules/sessionstore/Utils.jsm");
 
 ChromeUtils.defineModuleGetter(this, "FormLikeFactory",
                                "resource://gre/modules/FormLikeFactory.jsm");
--- a/mobile/android/components/SessionStore.js
+++ b/mobile/android/components/SessionStore.js
@@ -11,17 +11,16 @@ XPCOMUtils.defineLazyModuleGetters(this,
   EventDispatcher: "resource://gre/modules/Messaging.jsm",
   FormData: "resource://gre/modules/FormData.jsm",
   OS: "resource://gre/modules/osfile.jsm",
   PrivacyFilter: "resource://gre/modules/sessionstore/PrivacyFilter.jsm",
   PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
   SessionHistory: "resource://gre/modules/sessionstore/SessionHistory.jsm",
   SharedPreferences: "resource://gre/modules/SharedPreferences.jsm",
   Task: "resource://gre/modules/Task.jsm",
-  TelemetryStopwatch: "resource://gre/modules/TelemetryStopwatch.jsm",
   Utils: "resource://gre/modules/sessionstore/Utils.jsm",
 });
 
 XPCOMUtils.defineLazyModuleGetter(this, "Log", "resource://gre/modules/AndroidLog.jsm", "AndroidLog");
 
 const ssu = Cc["@mozilla.org/browser/sessionstore/utils;1"]
               .getService(Ci.nsISessionStoreUtils);
 
--- a/mobile/android/modules/Sanitizer.jsm
+++ b/mobile/android/modules/Sanitizer.jsm
@@ -12,17 +12,16 @@ XPCOMUtils.defineLazyModuleGetters(this,
   Accounts: "resource://gre/modules/Accounts.jsm",
   Downloads: "resource://gre/modules/Downloads.jsm",
   EventDispatcher: "resource://gre/modules/Messaging.jsm",
   FormHistory: "resource://gre/modules/FormHistory.jsm",
   OfflineAppCacheHelper: "resource://gre/modules/offlineAppCache.jsm",
   OS: "resource://gre/modules/osfile.jsm",
   ServiceWorkerCleanUp: "resource://gre/modules/ServiceWorkerCleanUp.jsm",
   Task: "resource://gre/modules/Task.jsm",
-  TelemetryStopwatch: "resource://gre/modules/TelemetryStopwatch.jsm",
 });
 
 XPCOMUtils.defineLazyServiceGetters(this, {
   quotaManagerService: ["@mozilla.org/dom/quota-manager-service;1", "nsIQuotaManagerService"],
 });
 
 /* global DownloadIntegration */
 Integration.downloads.defineModuleGetter(this, "DownloadIntegration",
--- a/toolkit/components/extensions/ExtensionTelemetry.jsm
+++ b/toolkit/components/extensions/ExtensionTelemetry.jsm
@@ -4,18 +4,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 var EXPORTED_SYMBOLS = ["ExtensionTelemetry", "getTrimmedString"];
 
 ChromeUtils.defineModuleGetter(this, "Services",
                                "resource://gre/modules/Services.jsm");
-ChromeUtils.defineModuleGetter(this, "TelemetryStopwatch",
-                               "resource://gre/modules/TelemetryStopwatch.jsm");
 
 // Map of the base histogram ids for the metrics recorded for the extensions.
 const histograms = {
   "extensionStartup": "WEBEXT_EXTENSION_STARTUP_MS",
   "backgroundPageLoad": "WEBEXT_BACKGROUND_PAGE_LOAD_MS",
   "browserActionPopupOpen": "WEBEXT_BROWSERACTION_POPUP_OPEN_MS",
   "browserActionPreloadResult": "WEBEXT_BROWSERACTION_POPUP_PRELOAD_RESULT_COUNT",
   "contentScriptInjection": "WEBEXT_CONTENT_SCRIPT_INJECTION_MS",
--- a/toolkit/components/narrate/NarrateControls.jsm
+++ b/toolkit/components/narrate/NarrateControls.jsm
@@ -3,17 +3,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 ChromeUtils.import("resource://gre/modules/narrate/VoiceSelect.jsm");
 ChromeUtils.import("resource://gre/modules/narrate/Narrator.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/AsyncPrefs.jsm");
-ChromeUtils.import("resource://gre/modules/TelemetryStopwatch.jsm");
 
 var EXPORTED_SYMBOLS = ["NarrateControls"];
 
 var gStrings = Services.strings.createBundle("chrome://global/locale/narrate.properties");
 
 function NarrateControls(mm, win, languagePromise) {
   this._mm = mm;
   this._winRef = Cu.getWeakReference(win);
--- a/toolkit/components/osfile/modules/osfile_async_front.jsm
+++ b/toolkit/components/osfile/modules/osfile_async_front.jsm
@@ -49,17 +49,16 @@ ChromeUtils.import("resource://gre/modul
 ChromeUtils.defineModuleGetter(this, "PromiseUtils",
                                "resource://gre/modules/PromiseUtils.jsm");
 ChromeUtils.defineModuleGetter(this, "Task",
                                "resource://gre/modules/Task.jsm");
 
 // The implementation of communications
 ChromeUtils.import("resource://gre/modules/PromiseWorker.jsm", this);
 ChromeUtils.import("resource://gre/modules/Services.jsm", this);
-ChromeUtils.import("resource://gre/modules/TelemetryStopwatch.jsm", this);
 ChromeUtils.import("resource://gre/modules/AsyncShutdown.jsm", this);
 var Native = ChromeUtils.import("resource://gre/modules/osfile/osfile_native.jsm", {});
 
 
 // It's possible for osfile.jsm to get imported before the profile is
 // set up. In this case, some path constants aren't yet available.
 // Here, we make them lazy loaders.
 
--- a/toolkit/components/places/UnifiedComplete.js
+++ b/toolkit/components/places/UnifiedComplete.js
@@ -322,17 +322,16 @@ XPCOMUtils.defineLazyModuleGetters(this,
   ExtensionSearchHandler: "resource://gre/modules/ExtensionSearchHandler.jsm",
   ObjectUtils: "resource://gre/modules/ObjectUtils.jsm",
   OS: "resource://gre/modules/osfile.jsm",
   PlacesRemoteTabsAutocompleteProvider: "resource://gre/modules/PlacesRemoteTabsAutocompleteProvider.jsm",
   PlacesSearchAutocompleteProvider: "resource://gre/modules/PlacesSearchAutocompleteProvider.jsm",
   PlacesUtils: "resource://gre/modules/PlacesUtils.jsm",
   ProfileAge: "resource://gre/modules/ProfileAge.jsm",
   Sqlite: "resource://gre/modules/Sqlite.jsm",
-  TelemetryStopwatch: "resource://gre/modules/TelemetryStopwatch.jsm",
   UrlbarPrefs: "resource:///modules/UrlbarPrefs.jsm",
   UrlbarProviderOpenTabs: "resource:///modules/UrlbarProviderOpenTabs.jsm",
   UrlbarProvidersManager: "resource:///modules/UrlbarProvidersManager.jsm",
   UrlbarTokenizer: "resource:///modules/UrlbarTokenizer.jsm",
   UrlbarUtils: "resource:///modules/UrlbarUtils.jsm",
 });
 
 XPCOMUtils.defineLazyPreferenceGetter(this, "syncUsernamePref",
--- a/toolkit/components/search/nsSearchService.js
+++ b/toolkit/components/search/nsSearchService.js
@@ -6,17 +6,16 @@ ChromeUtils.import("resource://gre/modul
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/PromiseUtils.jsm");
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   AsyncShutdown: "resource://gre/modules/AsyncShutdown.jsm",
   DeferredTask: "resource://gre/modules/DeferredTask.jsm",
   OS: "resource://gre/modules/osfile.jsm",
-  TelemetryStopwatch: "resource://gre/modules/TelemetryStopwatch.jsm",
   Deprecated: "resource://gre/modules/Deprecated.jsm",
   SearchStaticData: "resource://gre/modules/SearchStaticData.jsm",
   setTimeout: "resource://gre/modules/Timer.jsm",
   clearTimeout: "resource://gre/modules/Timer.jsm",
   Lz4: "resource://gre/modules/lz4.js",
   NetUtil: "resource://gre/modules/NetUtil.jsm",
   ExtensionParent: "resource://gre/modules/ExtensionParent.jsm",
 });
deleted file mode 100644
--- a/toolkit/components/telemetry/app/TelemetryStopwatch.jsm
+++ /dev/null
@@ -1,434 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
- "use strict";
-
-var EXPORTED_SYMBOLS = ["TelemetryStopwatch"];
-
-ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.defineModuleGetter(this, "Log",
-  "resource://gre/modules/Log.jsm");
-
-// Weak map does not allow using null objects as keys. These objects are used
-// as 'null' placeholders.
-const NULL_OBJECT = {};
-const NULL_KEY = {};
-
-/**
- * Timers is a variation of a Map used for storing information about running
- * Stopwatches. Timers has the following data structure:
- *
- * {
- *    "HISTOGRAM_NAME": WeakMap {
- *      Object || NULL_OBJECT: Map {
- *        "KEY" || NULL_KEY: startTime
- *        ...
- *      }
- *      ...
- *    }
- *    ...
- * }
- *
- *
- * @example
- * // Stores current time for a keyed histogram "PLAYING_WITH_CUTE_ANIMALS".
- * Timers.put("PLAYING_WITH_CUTE_ANIMALS", null, "CATS", Date.now());
- *
- * @example
- * // Returns information about a simple Stopwatch.
- * let startTime = Timers.get("PLAYING_WITH_CUTE_ANIMALS", null, "CATS");
- */
-const Timers = {
-  _timers: new Map(),
-
-  _inSeconds: new Set(),
-
-  _validTypes(histogram, obj, key) {
-    const nonEmptyString = value => {
-      return typeof value === "string" && value !== "" && value.length > 0;
-    };
-    return nonEmptyString(histogram) &&
-            typeof obj == "object" &&
-           (key === NULL_KEY || nonEmptyString(key));
-  },
-
-  get(histogram, obj, key) {
-    key = key === null ? NULL_KEY : key;
-    obj = obj || NULL_OBJECT;
-
-    if (!this.has(histogram, obj, key)) {
-      return null;
-    }
-
-    return this._timers.get(histogram).get(obj).get(key);
-  },
-
-  put(histogram, obj, key, startTime, {inSeconds} = {}) {
-    key = key === null ? NULL_KEY : key;
-    obj = obj || NULL_OBJECT;
-
-    if (!this._validTypes(histogram, obj, key)) {
-      return false;
-    }
-
-    if (inSeconds) {
-      this._inSeconds.add(histogram);
-    }
-
-    const objectMap = this._timers.get(histogram) || new WeakMap();
-    const keyedInfo = objectMap.get(obj) || new Map();
-    keyedInfo.set(key, startTime);
-    objectMap.set(obj, keyedInfo);
-    this._timers.set(histogram, objectMap);
-    return true;
-  },
-
-  has(histogram, obj, key) {
-    key = key === null ? NULL_KEY : key;
-    obj = obj || NULL_OBJECT;
-
-    return this._timers.has(histogram) &&
-      this._timers.get(histogram).has(obj) &&
-      this._timers.get(histogram).get(obj).has(key);
-  },
-
-  delete(histogram, obj, key) {
-    key = key === null ? NULL_KEY : key;
-    obj = obj || NULL_OBJECT;
-
-    if (!this.has(histogram, obj, key)) {
-      return false;
-    }
-
-    this._inSeconds.delete(histogram);
-
-    const objectMap = this._timers.get(histogram);
-    const keyedInfo = objectMap.get(obj);
-    if (keyedInfo.size > 1) {
-      keyedInfo.delete(key);
-      return true;
-    }
-    objectMap.delete(obj);
-    // NOTE:
-    // We never delete empty objecMaps from this._timers because there is no
-    // nice solution for tracking the number of objects in a WeakMap.
-    // WeakMap is not enumerable, so we can't deterministically say when it's
-    // empty. We accept that trade-off here, given that entries for short-lived
-    // objects will go away when they are no longer referenced
-    return true;
-  },
-};
-
-var TelemetryStopwatch = {
-  /**
-   * Starts a timer associated with a telemetry histogram. The timer can be
-   * directly associated with a histogram, or with a pair of a histogram and
-   * an object.
-   *
-   * @param {String} aHistogram - a string which must be a valid histogram name.
-   *
-   * @param {Object} aObj - Optional parameter. If specified, the timer is
-   *                        associated with this object, meaning that multiple
-   *                        timers for the same histogram may be run
-   *                        concurrently, as long as they are associated with
-   *                        different objects.
-   * @param {Object}  [options.inSeconds=false] - Record elapsed time for this
-   *                  histogram in seconds instead of milliseconds. Defaults to
-   *                  false.
-   *
-   * @returns {Boolean} True if the timer was successfully started, false
-   *                    otherwise. If a timer already exists, it can't be
-   *                    started again, and the existing one will be cleared in
-   *                    order to avoid measurements errors.
-   */
-  start(aHistogram, aObj, {inSeconds} = {}) {
-    return TelemetryStopwatchImpl.start(aHistogram, aObj, null, {inSeconds});
-  },
-
-  /**
-   * Returns whether a timer associated with a telemetry histogram is currently
-   * running. The timer can be directly associated with a histogram, or with a
-   * pair of a histogram and an object.
-   *
-   * @param {String} aHistogram - a string which must be a valid histogram name.
-   *
-   * @param {Object} aObj - Optional parameter. If specified, the timer is
-   *                        associated with this object, meaning that multiple
-   *                        timers for the same histogram may be run
-   *                        concurrently, as long as they are associated with
-   *                        different objects.
-   *
-   * @returns {Boolean} True if the timer exists and is currently running.
-   */
-  running(aHistogram, aObj) {
-    return TelemetryStopwatchImpl.running(aHistogram, aObj, null);
-  },
-
-  /**
-   * Deletes the timer associated with a telemetry histogram. The timer can be
-   * directly associated with a histogram, or with a pair of a histogram and
-   * an object. Important: Only use this method when a legitimate cancellation
-   * should be done.
-   *
-   * @param {String} aHistogram - a string which must be a valid histogram name.
-   *
-   * @param {Object} aObj - Optional parameter. If specified, the timer is
-   *                        associated with this object, meaning that multiple
-   *                        timers or a same histogram may be run concurrently,
-   *                        as long as they are associated with different
-   *                        objects.
-   *
-   * @returns {Boolean} True if the timer exist and it was cleared, False
-   *                   otherwise.
-   */
-  cancel(aHistogram, aObj) {
-    return TelemetryStopwatchImpl.cancel(aHistogram, aObj, null);
-  },
-
-  /**
-   * Returns the elapsed time for a particular stopwatch. Primarily for
-   * debugging purposes. Must be called prior to finish.
-   *
-   * @param {String} aHistogram - a string which must be a valid histogram name.
-   *                              If an invalid name is given, the function will
-   *                              throw.
-   *
-   * @param (Object) aObj - Optional parameter which associates the histogram
-   *                        timer with the given object.
-   *
-   * @param {Boolean} aCanceledOkay - Optional parameter which will suppress any
-   *                                  warnings that normally fire when a stopwatch
-   *                                  is finished after being cancelled. Defaults
-   *                                  to false.
-   *
-   * @returns {Integer} time in milliseconds or -1 if the stopwatch was not
-   *                   found.
-   */
-  timeElapsed(aHistogram, aObj, aCanceledOkay) {
-    return TelemetryStopwatchImpl.timeElapsed(aHistogram, aObj, null,
-                                              aCanceledOkay);
-  },
-
-  /**
-   * Stops the timer associated with the given histogram (and object),
-   * calculates the time delta between start and finish, and adds the value
-   * to the histogram.
-   *
-   * @param {String} aHistogram - a string which must be a valid histogram name.
-   *
-   * @param {Object} aObj - Optional parameter which associates the histogram
-   *                        timer with the given object.
-   *
-   * @param {Boolean} aCanceledOkay - Optional parameter which will suppress any
-   *                                  warnings that normally fire when a stopwatch
-   *                                  is finished after being cancelled. Defaults
-   *                                  to false.
-   *
-   * @returns {Boolean} True if the timer was succesfully stopped and the data
-   *                    was added to the histogram, False otherwise.
-   */
-  finish(aHistogram, aObj, aCanceledOkay) {
-    return TelemetryStopwatchImpl.finish(aHistogram, aObj, null, aCanceledOkay);
-  },
-
-  /**
-   * Starts a timer associated with a keyed telemetry histogram. The timer can
-   * be directly associated with a histogram and its key. Similarly to
-   * @see{TelemetryStopwatch.stat} the histogram and its key can be associated
-   * with an object. Each key may have multiple associated objects and each
-   * object can be associated with multiple keys.
-   *
-   * @param {String} aHistogram - a string which must be a valid histogram name.
-   *
-   * @param {String} aKey - a string which must be a valid histgram key.
-   *
-   * @param {Object} aObj - Optional parameter. If specified, the timer is
-   *                        associated with this object, meaning that multiple
-   *                        timers for the same histogram may be run
-   *                        concurrently,as long as they are associated with
-   *                        different objects.
-   * @param {Object}  [options.inSeconds=false] - Record elapsed time for this
-   *                  histogram in seconds instead of milliseconds. Defaults to
-   *                  false.
-   *
-   * @returns {Boolean} True if the timer was successfully started, false
-   *                    otherwise. If a timer already exists, it can't be
-   *                    started again, and the existing one will be cleared in
-   *                    order to avoid measurements errors.
-   */
-  startKeyed(aHistogram, aKey, aObj, {inSeconds} = {}) {
-    return TelemetryStopwatchImpl.start(aHistogram, aObj, aKey, {inSeconds});
-  },
-
-  /**
-   * Returns whether a timer associated with a telemetry histogram is currently
-   * running. Similarly to @see{TelemetryStopwatch.running} the timer and its
-   * key can be associated with an object. Each key may have multiple associated
-   * objects and each object can be associated with multiple keys.
-   *
-   * @param {String} aHistogram - a string which must be a valid histogram name.
-   *
-   * @param {String} aKey - a string which must be a valid histgram key.
-   *
-   * @param {Object} aObj - Optional parameter. If specified, the timer is
-   *                        associated with this object, meaning that multiple
-   *                        timers for the same histogram may be run
-   *                        concurrently, as long as they are associated with
-   *                        different objects.
-   *
-   * @returns {Boolean} True if the timer exists and is currently running.
-   */
-  runningKeyed(aHistogram, aKey, aObj) {
-    return TelemetryStopwatchImpl.running(aHistogram, aObj, aKey);
-  },
-
-  /**
-   * Deletes the timer associated with a keyed histogram. Important: Only use
-   * this method when a legitimate cancellation should be done.
-   *
-   * @param {String} aHistogram - a string which must be a valid histogram name.
-   *
-   * @param {String} aKey - a string which must be a valid histgram key.
-   *
-   * @param {Object} aObj - Optional parameter. If specified, the timer
-   *                        associated with this object is deleted.
-   *
-   * @return {Boolean} True if the timer exist and it was cleared, False
-   *                   otherwise.
-   */
-  cancelKeyed(aHistogram, aKey, aObj) {
-    return TelemetryStopwatchImpl.cancel(aHistogram, aObj, aKey);
-  },
-
-  /**
-   * Returns the elapsed time for a particular stopwatch. Primarily for
-   * debugging purposes. Must be called prior to finish.
-   *
-   * @param {String} aHistogram - a string which must be a valid histogram name.
-   *
-   * @param {String} aKey - a string which must be a valid histgram key.
-   *
-   * @param {Object} aObj - Optional parameter. If specified, the timer
-   *                        associated with this object is used to calculate
-   *                        the elapsed time.
-   *
-   * @return {Integer} time in milliseconds or -1 if the stopwatch was not
-   *                   found.
-   */
-  timeElapsedKeyed(aHistogram, aKey, aObj, aCanceledOkay) {
-    return TelemetryStopwatchImpl.timeElapsed(aHistogram, aObj, aKey,
-                                              aCanceledOkay);
-  },
-
-  /**
-   * Stops the timer associated with the given keyed histogram (and object),
-   * calculates the time delta between start and finish, and adds the value
-   * to the keyed histogram.
-   *
-   * @param {String} aHistogram - a string which must be a valid histogram name.
-   *
-   * @param {String} aKey - a string which must be a valid histgram key.
-   *
-   * @param {Object} aObj - optional parameter which associates the histogram
-   *                        timer with the given object.
-   *
-   * @param {Boolean} aCanceledOkay - Optional parameter which will suppress any
-   *                                  warnings that normally fire when a stopwatch
-   *                                  is finished after being cancelled. Defaults
-   *                                  to false.
-   *
-   * @returns {Boolean} True if the timer was succesfully stopped and the data
-   *                   was added to the histogram, False otherwise.
-   */
-  finishKeyed(aHistogram, aKey, aObj, aCanceledOkay) {
-    return TelemetryStopwatchImpl.finish(aHistogram, aObj, aKey, aCanceledOkay);
-  },
-
-  /**
-   * Set the testing mode. Used by tests.
-   */
-  setTestModeEnabled(testing = true) {
-    TelemetryStopwatchImpl.suppressErrors(testing);
-  },
-};
-
-var TelemetryStopwatchImpl = {
-  // Suppress errors. Used when testing.
-  _suppressErrors: false,
-
-  suppressErrors(suppress) {
-    this._suppressErrors = suppress;
-  },
-
-  start(histogram, object, key, {inSeconds} = {}) {
-    if (Timers.has(histogram, object, key)) {
-      Timers.delete(histogram, object, key);
-      if (!this._suppressErrors) {
-        Cu.reportError(`TelemetryStopwatch: key "${histogram}" was already ` +
-                       "initialized");
-      }
-      return false;
-    }
-
-    return Timers.put(histogram, object, key, Cu.now(), {inSeconds});
-  },
-
-  running(histogram, object, key) {
-    return Timers.has(histogram, object, key);
-  },
-
-  cancel(histogram, object, key) {
-    return Timers.delete(histogram, object, key);
-  },
-
-  timeElapsed(histogram, object, key, aCanceledOkay) {
-    const startTime = Timers.get(histogram, object, key);
-    if (startTime === null) {
-      if (!aCanceledOkay && !this._suppressErrors) {
-        Cu.reportError("TelemetryStopwatch: requesting elapsed time for " +
-                       `nonexisting stopwatch. Histogram: "${histogram}", ` +
-                       `key: "${key}"`);
-      }
-      return -1;
-    }
-
-    try {
-      const delta = Cu.now() - startTime;
-      if (Timers._inSeconds.has(histogram)) {
-        return Math.round(delta / 1000);
-      }
-      return Math.round(delta);
-    } catch (e) {
-      if (!this._suppressErrors) {
-        Cu.reportError("TelemetryStopwatch: failed to calculate elapsed time " +
-                       `for Histogram: "${histogram}", key: "${key}", ` +
-                       `exception: ${Log.exceptionStr(e)}`);
-      }
-      return -1;
-    }
-  },
-
-  finish(histogram, object, key, aCanceledOkay) {
-    const delta = this.timeElapsed(histogram, object, key, aCanceledOkay);
-    if (delta == -1) {
-      return false;
-    }
-
-    try {
-      if (key) {
-        Services.telemetry.getKeyedHistogramById(histogram).add(key, delta);
-      } else {
-        Services.telemetry.getHistogramById(histogram).add(delta);
-      }
-    } catch (e) {
-      if (!this._suppressErrors) {
-        Cu.reportError("TelemetryStopwatch: failed to update the Histogram " +
-                       `"${histogram}", using key: "${key}", ` +
-                       `exception: ${Log.exceptionStr(e)}`);
-      }
-      return false;
-    }
-
-    return Timers.delete(histogram, object, key);
-  },
-};
--- a/toolkit/components/telemetry/docs/collection/histograms.rst
+++ b/toolkit/components/telemetry/docs/collection/histograms.rst
@@ -267,17 +267,17 @@ A Telemetry probe is the code that measu
   keyed.add("blink");
 
 Note that ``nsITelemetry.getHistogramById()`` will throw an ``NS_ERROR_FAILURE`` JavaScript exception if it is called with an invalid histogram ID. The ``add()`` function will not throw if it fails, instead it prints an error in the browser console.
 
 .. warning::
 
   Adding a new Telemetry probe is not possible with Artifact builds. A full build is needed.
 
-For histograms measuring time, `TelemetryStopwatch <https://dxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry/TelemetryStopwatch.jsm>`_ can be used to avoid working with Dates manually:
+For histograms measuring time, TelemetryStopwatch can be used to avoid working with Dates manually:
 
 .. code-block:: js
 
   TelemetryStopwatch.start("SEARCH_SERVICE_INIT_MS");
   TelemetryStopwatch.finish("SEARCH_SERVICE_INIT_MS");
 
   TelemetryStopwatch.start("FX_TAB_SWITCH_TOTAL_MS");
   TelemetryStopwatch.cancel("FX_TAB_SWITCH_TOTAL_MS");
--- a/toolkit/components/telemetry/docs/collection/measuring-time.rst
+++ b/toolkit/components/telemetry/docs/collection/measuring-time.rst
@@ -2,17 +2,17 @@
 Measuring elapsed time
 ======================
 
 To make it easier to measure how long operations take, we have helpers for both JavaScript and C++.
 These helpers record the elapsed time into histograms, so you have to create suitable :doc:`histograms` for them first.
 
 From JavaScript
 ===============
-JavaScript can measure elapsed time using `TelemetryStopwatch.jsm <https://dxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry/TelemetryStopwatch.jsm>`_.
+JavaScript can measure elapsed time using TelemetryStopwatch.
 
 ``TelemetryStopwatch`` is a helper that simplifies recording elapsed time (in milliseconds) into histograms (plain or keyed).
 
 API:
 
 .. code-block:: js
 
     TelemetryStopwatch = {
--- a/toolkit/components/telemetry/moz.build
+++ b/toolkit/components/telemetry/moz.build
@@ -98,17 +98,16 @@ EXTRA_COMPONENTS += [
 ]
 
 EXTRA_JS_MODULES += [
     'app/TelemetryArchive.jsm',
     'app/TelemetryController.jsm',
     'app/TelemetryEnvironment.jsm',
     'app/TelemetryReportingPolicy.jsm',
     'app/TelemetrySend.jsm',
-    'app/TelemetryStopwatch.jsm',
     'app/TelemetryStorage.jsm',
     'app/TelemetryTimestamps.jsm',
     'app/TelemetryUtils.jsm',
     'other/GCTelemetry.jsm',
     'other/MemoryTelemetry.jsm',
     'other/UITelemetry.jsm',
     'pings/CoveragePing.jsm',
     'pings/EventPing.jsm',
--- a/toolkit/components/telemetry/tests/unit/test_TelemetrySend.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetrySend.js
@@ -12,18 +12,16 @@ ChromeUtils.import("resource://testing-c
 ChromeUtils.import("resource://gre/modules/TelemetrySession.jsm", this);
 ChromeUtils.import("resource://gre/modules/TelemetrySend.jsm", this);
 ChromeUtils.import("resource://gre/modules/TelemetryStorage.jsm", this);
 ChromeUtils.import("resource://gre/modules/TelemetryUtils.jsm", this);
 ChromeUtils.import("resource://gre/modules/Services.jsm", this);
 ChromeUtils.import("resource://gre/modules/osfile.jsm", this);
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm", this);
 
-ChromeUtils.import("resource://gre/modules/TelemetryStopwatch.jsm", this);
-
 ChromeUtils.defineModuleGetter(this, "TelemetryHealthPing",
   "resource://gre/modules/HealthPing.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(Services, "cookies", "@mozilla.org/cookieService;1", "nsICookieService");
 
 const MS_IN_A_MINUTE = 60 * 1000;
 
 function countPingTypes(pings) {
--- a/toolkit/content/widgets/tabbox.xml
+++ b/toolkit/content/widgets/tabbox.xml
@@ -416,43 +416,30 @@
       </property>
 
       <property name="linkedPanel" onget="return this.getAttribute('linkedpanel')"
                                    onset="this.setAttribute('linkedpanel', val); return val;"/>
 
       <field name="arrowKeysShouldWrap" readonly="true">
         /Mac/.test(navigator.platform)
       </field>
-      <property name="TelemetryStopwatch" readonly="true">
-        <getter><![CDATA[
-          let module = {};
-          ChromeUtils.import("resource://gre/modules/TelemetryStopwatch.jsm", module);
-          Object.defineProperty(this, "TelemetryStopwatch", {
-            configurable: true,
-            enumerable: true,
-            writable: true,
-            value: module.TelemetryStopwatch,
-          });
-          return module.TelemetryStopwatch;
-        ]]></getter>
-      </property>
     </implementation>
 
     <handlers>
       <handler event="mousedown" button="0">
       <![CDATA[
         if (this.disabled)
           return;
 
         this.parentNode.ariaFocusedItem = null;
 
         if (this != this.parentNode.selectedItem) { // Not selected yet
           let stopwatchid = this.parentNode.getAttribute("stopwatchid");
           if (stopwatchid) {
-            this.TelemetryStopwatch.start(stopwatchid);
+            TelemetryStopwatch.start(stopwatchid);
           }
 
           // Call this before setting the 'ignorefocus' attribute because this
           // will pass on focus if the formerly selected tab was focused as well.
           this.parentNode._selectNewTab(this);
 
           var isTabFocused = false;
           try {
@@ -464,17 +451,17 @@
           // they are already focused. After a short timeout we'll reset
           // '-moz-user-focus' so that tabs can be focused by keyboard again.
           if (!isTabFocused) {
             this.setAttribute("ignorefocus", "true");
             setTimeout(tab => tab.removeAttribute("ignorefocus"), 0, this);
           }
 
           if (stopwatchid) {
-            this.TelemetryStopwatch.finish(stopwatchid);
+            TelemetryStopwatch.finish(stopwatchid);
           }
         }
         // Otherwise this tab is already selected and we will fall
         // through to mousedown behavior which sets focus on the current tab,
         // Only a click on an already selected tab should focus the tab itself.
       ]]>
       </handler>