Backed out 2 changesets (bug 1412029) for ESLint failure "/devtools/shim/aboutdevtools/aboutdevtools.js" r=backout on a CLOSED TREE
authorNarcis Beleuzu <nbeleuzu@mozilla.com>
Wed, 08 Nov 2017 13:38:10 +0200
changeset 444038 06538a745211663edaf19646b989095b36343bfa
parent 444037 76ef1d896013fb1097e55d0656f3f5fb3f0e395d
child 444039 5359b9edc63d7469c1fd993ad49fb78560924b1f
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1412029
milestone58.0a1
backs outab41b0060a87d88dce1d3019435788ad2ee8b149
d3a84e128c3cb0cca658b78847c5c68b05356866
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
Backed out 2 changesets (bug 1412029) for ESLint failure "/devtools/shim/aboutdevtools/aboutdevtools.js" r=backout on a CLOSED TREE Backed out changeset ab41b0060a87 (bug 1412029) Backed out changeset d3a84e128c3c (bug 1412029)
devtools/shim/aboutdevtools/aboutdevtools.js
devtools/shim/devtools-startup.js
toolkit/components/telemetry/Histograms.json
toolkit/components/telemetry/Scalars.yaml
--- a/devtools/shim/aboutdevtools/aboutdevtools.js
+++ b/devtools/shim/aboutdevtools/aboutdevtools.js
@@ -4,22 +4,16 @@
 
 "use strict";
 
 const { utils: Cu } = Components;
 const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 const DEVTOOLS_ENABLED_PREF = "devtools.enabled";
 
-const TELEMETRY_OPENED_KEY = "DEVTOOLS_ABOUT_DEVTOOLS_OPENED_KEY";
-const TELEMETRY_OPENED_REASON = "DEVTOOLS_ABOUT_DEVTOOLS_OPENED_REASON";
-const TELEMETRY_OPENED = "devtools.aboutdevtools.opened";
-const TELEMETRY_INSTALLED = "devtools.aboutdevtools.installed";
-const TELEMETRY_NOINSTALL_EXITS = "devtools.aboutdevtools.noinstall_exits";
-
 const MESSAGES = {
   AboutDebugging: "about-debugging-message",
   ContextMenu: "inspect-element-message",
   HamburgerMenu: "menu-message",
   KeyShortcut: "key-shortcut-message",
   SystemMenu: "menu-message",
 };
 
@@ -28,35 +22,25 @@ const aboutDevtoolsBundle = Services.str
 
 const KEY_SHORTCUTS_STRINGS = "chrome://devtools-shim/locale/key-shortcuts.properties";
 const keyShortcutsBundle = Services.strings.createBundle(KEY_SHORTCUTS_STRINGS);
 
 // URL constructor doesn't support about: scheme,
 // we have to use http in order to have working searchParams.
 let url = new URL(window.location.href.replace("about:", "http://"));
 let reason = url.searchParams.get("reason");
-let keyid = url.searchParams.get("keyid");
 let tabid = parseInt(url.searchParams.get("tabid"), 10);
 
-// Keep track of the initial devtools.enabled value to track exits in telemetry.
-let isEnabledOnLoad;
-
 function getToolboxShortcut() {
   const modifier = Services.appinfo.OS == "Darwin" ? "Cmd+Opt+" : "Ctrl+Shift+";
   return modifier + keyShortcutsBundle.GetStringFromName("toggleToolbox.commandkey");
 }
 
 function onInstallButtonClick() {
   Services.prefs.setBoolPref("devtools.enabled", true);
-
-  try {
-    Services.telemetry.scalarAdd(TELEMETRY_INSTALLED, 1);
-  } catch (e) {
-    dump("about:devtools oninstall telemetry failed: " + e + "\n");
-  }
 }
 
 function onCloseButtonClick() {
   window.close();
 }
 
 function updatePage() {
   const installPage = document.getElementById("install-page");
@@ -180,30 +164,16 @@ window.addEventListener("load", function
 
   let featuresContainer = document.querySelector(".features-list");
   for (let feature of features) {
     featuresContainer.appendChild(createFeatureEl(feature));
   }
 
   // Update the current page based on the current value of DEVTOOLS_ENABLED_PREF.
   updatePage();
-
-  try {
-    if (reason) {
-      Services.telemetry.getHistogramById(TELEMETRY_OPENED_REASON).add(reason);
-    }
-
-    if (key) {
-      Services.telemetry.getHistogramById(TELEMETRY_OPENED_KEY).add(keyid);
-    }
-
-    Services.telemetry.scalarAdd(TELEMETRY_OPENED, 1);
-  } catch (e) {
-    dump("about:devtools onload telemetry failed: " + e + "\n");
-  }
 }, { once: true });
 
 window.addEventListener("beforeunload", function () {
   // Focus the tab that triggered the DevTools onboarding.
   if (document.visibilityState != "visible") {
     // Only try to focus the correct tab if the current tab is the about:devtools page.
     return;
   }
@@ -219,18 +189,9 @@ window.addEventListener("beforeunload", 
     gBrowser.selectedTab = originalTab;
   }
 }, {once: true});
 
 window.addEventListener("unload", function () {
   document.getElementById("install").removeEventListener("click", onInstallButtonClick);
   document.getElementById("close").removeEventListener("click", onCloseButtonClick);
   Services.prefs.removeObserver(DEVTOOLS_ENABLED_PREF, updatePage);
-
-  const isEnabled = Services.prefs.getBoolPref("devtools.enabled");
-  if (!isEnabledOnLoad && !isEnabled) {
-    try {
-      Services.telemetry.scalarAdd(TELEMETRY_NOINSTALL_EXITS, 1);
-    } catch (e) {
-      dump("about:devtools onunload telemetry failed: " + e + "\n");
-    }
-  }
 }, {once: true});
--- a/devtools/shim/devtools-startup.js
+++ b/devtools/shim/devtools-startup.js
@@ -460,25 +460,24 @@ DevToolsStartup.prototype = {
     // Appending a <key> element is not always enough. The <keyset> needs
     // to be detached and reattached to make sure the <key> is taken into
     // account (see bug 832984).
     let mainKeyset = doc.getElementById("mainKeyset");
     mainKeyset.parentNode.insertBefore(keyset, mainKeyset);
   },
 
   onKey(window, key) {
-    if (!Services.prefs.getBoolPref(DEVTOOLS_ENABLED_PREF)) {
-      let id = key.toolId || key.id;
-      this.openInstallPage("KeyShortcut", id);
-    } else {
-      // Record the timing at which this event started in order to compute later in
-      // gDevTools.showToolbox, the complete time it takes to open the toolbox.
-      // i.e. especially take `initDevTools` into account.
-      let startTime = window.performance.now();
-      let require = this.initDevTools("KeyShortcut");
+    // Record the timing at which this event started in order to compute later in
+    // gDevTools.showToolbox, the complete time it takes to open the toolbox.
+    // i.e. especially take `initDevTools` into account.
+
+    let startTime = window.performance.now();
+    let require = this.initDevTools("KeyShortcut");
+    if (require) {
+      // require might be null if initDevTools was called while DevTools are disabled.
       let { gDevToolsBrowser } = require("devtools/client/framework/devtools-browser");
       gDevToolsBrowser.onKeyShortcut(window, key, startTime);
     }
   },
 
   // Create a <xul:key> DOM Element
   createKey(doc, { id, toolId, shortcut, modifiers: mod }, oncommand) {
     let k = doc.createElement("key");
@@ -524,27 +523,17 @@ DevToolsStartup.prototype = {
     this.initialized = true;
     let { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
     // Ensure loading main devtools module that hooks up into browser UI
     // and initialize all devtools machinery.
     require("devtools/client/framework/devtools-browser");
     return require;
   },
 
-  /**
-   * Open about:devtools to start the onboarding flow.
-   *
-   * @param {String} reason
-   *        One of "KeyShortcut", "SystemMenu", "HamburgerMenu", "ContextMenu",
-   *        "CommandLine".
-   * @param {String} keyId
-   *        Optional. If the onboarding flow was triggered by a keyboard shortcut, pass
-   *        the shortcut key id (or toolId) to about:devtools.
-   */
-  openInstallPage: function (reason, keyId) {
+  openInstallPage: function (reason) {
     let { gBrowser } = Services.wm.getMostRecentWindow("navigator:browser");
 
     // Focus about:devtools tab if there is already one opened in the current window.
     for (let tab of gBrowser.tabs) {
       let browser = tab.linkedBrowser;
       // browser.documentURI might be undefined if the browser tab is still loading.
       let location = browser.documentURI ? browser.documentURI.spec : "";
       if (location.startsWith("about:devtools") &&
@@ -562,20 +551,16 @@ DevToolsStartup.prototype = {
       params.push("reason=" + encodeURIComponent(reason));
     }
 
     let selectedBrowser = gBrowser.selectedBrowser;
     if (selectedBrowser) {
       params.push("tabid=" + selectedBrowser.outerWindowID);
     }
 
-    if (keyId) {
-      params.push("keyid=" + keyId);
-    }
-
     if (params.length > 0) {
       url += "?" + params.join("&");
     }
 
     // Set relatedToCurrent: true to open the tab next to the current one.
     gBrowser.selectedTab = gBrowser.addTab(url, {relatedToCurrent: true});
   },
 
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -8499,34 +8499,16 @@
   "DEVTOOLS_DEBUGGER_DISPLAY_SOURCE_REMOTE_MS": {
     "record_in_processes": ["main", "content"],
     "expires_in_version": "never",
     "kind": "exponential",
     "high": 10000,
     "n_buckets": 1000,
     "description": "The time (in milliseconds) that it took to display a selected source to the user."
   },
-  "DEVTOOLS_ABOUT_DEVTOOLS_OPENED_KEY": {
-    "record_in_processes": ["main"],
-    "alert_emails": ["dev-developer-tools@lists.mozilla.org", "hkirschner@mozilla.com"],
-    "bug_numbers": [1412029],
-    "expires_in_version": "60",
-    "kind": "categorical",
-    "labels": ["toggleToolbox", "toggleToolboxF12", "inspector", "webconsole", "jsdebugger", "netmonitor", "toggleToolbar", "webide", "browserToolbox", "browserConsole", "responsiveDesignMode", "scratchpad", "styleeditor", "performance", "storage", "dom"],
-    "description": "Records the key shortcut passed to open the about:devtools page."
-  },
-  "DEVTOOLS_ABOUT_DEVTOOLS_OPENED_REASON": {
-    "record_in_processes": ["main"],
-    "alert_emails": ["dev-developer-tools@lists.mozilla.org", "hkirschner@mozilla.com"],
-    "bug_numbers": [1412029],
-    "expires_in_version": "60",
-    "kind": "categorical",
-    "labels": ["KeyShortcut", "SystemMenu", "HamburgerMenu", "ContextMenu", "CommandLine"],
-    "description": "Records the reason for opening the about:devtools page."
-  },
   "MEDIA_RUST_MP4PARSE_SUCCESS": {
     "record_in_processes": ["main", "content"],
     "alert_emails": ["giles@mozilla.com", "kinetik@flim.org"],
     "expires_in_version": "60",
     "kind": "boolean",
     "bug_numbers": [1220885],
     "description": "Whether the rust mp4 demuxer successfully parsed a stream segment."
   },
--- a/toolkit/components/telemetry/Scalars.yaml
+++ b/toolkit/components/telemetry/Scalars.yaml
@@ -916,51 +916,16 @@ devtools:
     kind: uint
     keyed: true
     notification_emails:
       - dev-developer-tools@lists.mozilla.org
     release_channel_collection: opt-out
     record_in_processes:
       - 'main'
 
-devtools.aboutdevtools:
-  opened:
-    bug_numbers:
-      - 1412029
-    description: >
-      Number of times about:devtools was opened.
-    expires: "60"
-    kind: uint
-    notification_emails:
-      - dev-developer-tools@lists.mozilla.org, jdescottes@mozilla.com
-    record_in_processes:
-      - 'main'
-  installed:
-    bug_numbers:
-      - 1412029
-    description: >
-      Number of times devtools were enabled/installed in about:devtools.
-    expires: "60"
-    kind: uint
-    notification_emails:
-      - dev-developer-tools@lists.mozilla.org, jdescottes@mozilla.com
-    record_in_processes:
-      - 'main'
-  noinstall_exits:
-    bug_numbers:
-      - 1412029
-    description: >
-      Number of times the user left about:devtools without enabling devtools.
-    expires: "60"
-    kind: uint
-    notification_emails:
-      - dev-developer-tools@lists.mozilla.org, jdescottes@mozilla.com
-    record_in_processes:
-      - 'main'
-
 navigator.storage:
   estimate_count:
     bug_numbers:
       - 1359708
     description: >
       Number of times navigator.storage.estimate has been used.
     expires: "60"
     kind: uint