Bug 1457226 - Revert Savant Shield study commits; r=rhelmer
authorBianca Danforth <bdanforth@mozilla.com>
Mon, 27 Aug 2018 18:17:43 +0000
changeset 491281 febddb5a4dc21c7b09b02efc39568a03588d893b
parent 491280 6589349f130310ecaea7a085ac1457d357c7b395
child 491282 f4739ab0ece1b6014242b7b0c49e88d46ec2146f
push id1815
push userffxbld-merge
push dateMon, 15 Oct 2018 10:40:45 +0000
treeherdermozilla-release@18d4c09e9378 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrhelmer
bugs1457226
milestone63.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 1457226 - Revert Savant Shield study commits; r=rhelmer The Savant pref flip Shield study was ended on 08-20-18 (https://bugzilla.mozilla.org/show_bug.cgi?id=1457226#c28), so this patch removes all temporary study code from Firefox. Differential Revision: https://phabricator.services.mozilla.com/D4285
browser/app/profile/firefox.js
browser/base/content/tabbrowser.js
browser/components/nsBrowserGlue.js
browser/modules/BrowserUsageTelemetry.jsm
browser/modules/SavantShieldStudy.jsm
browser/modules/moz.build
toolkit/components/passwordmgr/LoginManagerContent.jsm
toolkit/components/passwordmgr/LoginManagerParent.jsm
toolkit/components/passwordmgr/nsLoginManagerPrompter.js
toolkit/components/reader/ReaderMode.jsm
toolkit/components/telemetry/Events.yaml
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1733,19 +1733,15 @@ pref("app.normandy.logging.level", 50); 
 pref("app.normandy.run_interval_seconds", 21600); // 6 hours
 pref("app.normandy.shieldLearnMoreUrl", "https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/shield");
 #ifdef MOZ_DATA_REPORTING
 pref("app.shield.optoutstudies.enabled", true);
 #else
 pref("app.shield.optoutstudies.enabled", false);
 #endif
 
-// Savant Shield study preferences
-pref("shield.savant.enabled", false);
-pref("shield.savant.loglevel", "warn");
-
 // Multi-lingual preferences
 pref("intl.multilingual.enabled", false);
 
 // Prio preferences
 // Curve25519 public keys for Prio servers
 pref("prio.publicKeyA", "35AC1C7576C7C6EDD7FED6BCFC337B34D48CB4EE45C86BEEFB40BD8875707733");
 pref("prio.publicKeyB", "26E6674E65425B823F1F1D5F96E3BB3EF9E406EC7FBA7DEF8B08A35DD135AF50");
--- a/browser/base/content/tabbrowser.js
+++ b/browser/base/content/tabbrowser.js
@@ -1009,17 +1009,16 @@ window._gBrowser = {
       let event = new CustomEvent("TabSelect", {
         bubbles: true,
         cancelable: false,
         detail: {
           previousTab: oldTab
         }
       });
       newTab.dispatchEvent(event);
-      Services.telemetry.recordEvent("savant", "tab", "select", null, { subcategory: "frame" });
 
       this._tabAttrModified(oldTab, ["selected"]);
       this._tabAttrModified(newTab, ["selected"]);
 
       if (oldBrowser != newBrowser &&
           oldBrowser.getInPermitUnload) {
         oldBrowser.getInPermitUnload(inPermitUnload => {
           if (!inPermitUnload) {
@@ -2467,17 +2466,16 @@ window._gBrowser = {
       this.setIcon(t, FAVICON_DEFAULTS[aURI]);
     }
 
     // Dispatch a new tab notification.  We do this once we're
     // entirely done, so that things are in a consistent state
     // even if the event listener opens or closes tabs.
     let evt = new CustomEvent("TabOpen", { bubbles: true, detail: eventDetail || {} });
     t.dispatchEvent(evt);
-    Services.telemetry.recordEvent("savant", "tab", "open", null, { subcategory: "frame" });
 
     if (!usingPreloadedContent && originPrincipal && aURI) {
       let { URI_INHERITS_SECURITY_CONTEXT } = Ci.nsIProtocolHandler;
       // Unless we know for sure we're not inheriting principals,
       // force the about:blank viewer to have the right principal:
       if (!aURIObject ||
           (doGetProtocolFlags(aURIObject) & URI_INHERITS_SECURITY_CONTEXT)) {
         b.createAboutBlankContentViewer(originPrincipal);
@@ -2881,17 +2879,16 @@ window._gBrowser = {
       TabBarVisibility.update();
 
     // We're committed to closing the tab now.
     // Dispatch a notification.
     // We dispatch it before any teardown so that event listeners can
     // inspect the tab that's about to close.
     var evt = new CustomEvent("TabClose", { bubbles: true, detail: { adoptedBy: aAdoptedByTab } });
     aTab.dispatchEvent(evt);
-    Services.telemetry.recordEvent("savant", "tab", "close", null, { subcategory: "frame" });
 
     if (this.tabs.length == 2) {
       // We're closing one of our two open tabs, inform the other tab that its
       // sibling is going away.
       window.messageManager
             .broadcastAsyncMessage("Browser:HasSiblings", false);
     }
 
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -424,17 +424,16 @@ XPCOMUtils.defineLazyModuleGetters(this,
   PluralForm: "resource://gre/modules/PluralForm.jsm",
   PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
   ProcessHangMonitor: "resource:///modules/ProcessHangMonitor.jsm",
   ReaderParent: "resource:///modules/ReaderParent.jsm",
   RemotePrompt: "resource:///modules/RemotePrompt.jsm",
   RemoteSettings: "resource://services-settings/remote-settings.js",
   SafeBrowsing: "resource://gre/modules/SafeBrowsing.jsm",
   Sanitizer: "resource:///modules/Sanitizer.jsm",
-  SavantShieldStudy: "resource:///modules/SavantShieldStudy.jsm",
   SessionStartup: "resource:///modules/sessionstore/SessionStartup.jsm",
   SessionStore: "resource:///modules/sessionstore/SessionStore.jsm",
   ShellService: "resource:///modules/ShellService.jsm",
   TabCrashHandler: "resource:///modules/ContentCrashHandlers.jsm",
   UIState: "resource://services-sync/UIState.jsm",
   UITour: "resource:///modules/UITour.jsm",
   WebChannel: "resource://gre/modules/WebChannel.jsm",
   WindowsRegistry: "resource://gre/modules/WindowsRegistry.jsm",
@@ -520,19 +519,16 @@ const listeners = {
     "Reader:UpdateReaderButton": ["ReaderParent"],
     // PLEASE KEEP THIS LIST IN SYNC WITH THE MOBILE LISTENERS IN BrowserCLH.js
     "RemoteLogins:findLogins": ["LoginManagerParent"],
     "RemoteLogins:findRecipes": ["LoginManagerParent"],
     "RemoteLogins:onFormSubmit": ["LoginManagerParent"],
     "RemoteLogins:autoCompleteLogins": ["LoginManagerParent"],
     "RemoteLogins:removeLogin": ["LoginManagerParent"],
     "RemoteLogins:insecureLoginFormPresent": ["LoginManagerParent"],
-    // For Savant Shield study, bug 1465685. Study on desktop only.
-    "LoginStats:LoginFillSuccessful": ["LoginManagerParent"],
-    "LoginStats:LoginEncountered": ["LoginManagerParent"],
     // PLEASE KEEP THIS LIST IN SYNC WITH THE MOBILE LISTENERS IN BrowserCLH.js
     "WCCR:registerProtocolHandler": ["Feeds"],
     "rtcpeer:CancelRequest": ["webrtcUI"],
     "rtcpeer:Request": ["webrtcUI"],
     "webrtc:CancelRequest": ["webrtcUI"],
     "webrtc:Request": ["webrtcUI"],
     "webrtc:StopRecording": ["webrtcUI"],
     "webrtc:UpdateBrowserIndicators": ["webrtcUI"],
@@ -1395,18 +1391,16 @@ BrowserGlue.prototype = {
 
     // Browser errors are only collected on Nightly, but telemetry for
     // them is collected on all channels.
     if (AppConstants.MOZ_DATA_REPORTING) {
       this.browserErrorReporter.uninit();
     }
 
     Normandy.uninit();
-
-    SavantShieldStudy.uninit();
   },
 
   // All initial windows have opened.
   _onWindowsRestored: function BG__onWindowsRestored() {
     if (this._windowsWereRestored) {
       return;
     }
     this._windowsWereRestored = true;
@@ -1553,20 +1547,16 @@ BrowserGlue.prototype = {
 
     Services.tm.idleDispatchToMainThread(() => {
       LanguagePrompt.init();
     });
 
     Services.tm.idleDispatchToMainThread(() => {
       Blocklist.loadBlocklistAsync();
     });
-
-    Services.tm.idleDispatchToMainThread(() => {
-      SavantShieldStudy.init();
-    });
   },
 
   /**
    * Use this function as an entry point to schedule tasks that need
    * to run once per session, at any arbitrary point in time.
    * This function will be called from an idle observer. Check the value of
    * LATE_TASKS_IDLE_TIME_SEC to see the current value for this idle
    * observer.
--- a/browser/modules/BrowserUsageTelemetry.jsm
+++ b/browser/modules/BrowserUsageTelemetry.jsm
@@ -361,20 +361,16 @@ let urlbarListener = {
     // Otherwise you'll break our data.
     if (actionType in URLBAR_SELECTED_RESULT_TYPES) {
       Services.telemetry
               .getHistogramById("FX_URLBAR_SELECTED_RESULT_TYPE")
               .add(URLBAR_SELECTED_RESULT_TYPES[actionType]);
       Services.telemetry
               .getKeyedHistogramById("FX_URLBAR_SELECTED_RESULT_INDEX_BY_TYPE")
               .add(actionType, idx);
-      if (actionType === "bookmark" || actionType === "history") {
-        Services.telemetry.recordEvent("savant", "follow_urlbar_link", actionType, null,
-                                      { subcategory: "navigation" });
-      }
     } else {
       Cu.reportError("Unknown FX_URLBAR_SELECTED_RESULT_TYPE type: " +
                      actionType);
     }
   },
 
   QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
                                           Ci.nsISupportsWeakReference]),
@@ -498,19 +494,16 @@ let BrowserUsageTelemetry = {
   },
 
   _recordSearch(engine, source, action = null) {
     let scalarKey = action ? "search_" + action : "search";
     Services.telemetry.keyedScalarAdd("browser.engagement.navigation." + source,
                                       scalarKey, 1);
     Services.telemetry.recordEvent("navigation", "search", source, action,
                                    { engine: getSearchEngineId(engine) });
-    Services.telemetry.recordEvent("savant", "search", source, action,
-                                   { subcategory: "navigation",
-                                   engine: getSearchEngineId(engine) });
   },
 
   _handleSearchAction(engine, source, details) {
     switch (source) {
       case "urlbar":
       case "oneoff-urlbar":
       case "searchbar":
       case "oneoff-searchbar":
deleted file mode 100644
--- a/browser/modules/SavantShieldStudy.jsm
+++ /dev/null
@@ -1,530 +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/. */
-
-/* eslint semi: error */
-
-"use strict";
-
-var EXPORTED_SYMBOLS = ["SavantShieldStudy"];
-
-ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-ChromeUtils.import("resource://gre/modules/Services.jsm");
-
-XPCOMUtils.defineLazyModuleGetters(this, {
-  AddonManager: "resource://gre/modules/AddonManager.jsm",
-  PlacesUtils: "resource://gre/modules/PlacesUtils.jsm"
-});
-
-// See LOG_LEVELS in Console.jsm. Examples: "all", "info", "warn", & "error".
-const PREF_LOG_LEVEL = "shield.savant.loglevel";
-
-// Create a new instance of the ConsoleAPI so we can control the maxLogLevel with a pref.
-XPCOMUtils.defineLazyGetter(this, "log", () => {
-  let ConsoleAPI = ChromeUtils.import("resource://gre/modules/Console.jsm", {}).ConsoleAPI;
-  let consoleOptions = {
-    maxLogLevelPref: PREF_LOG_LEVEL,
-    prefix: "SavantShieldStudy",
-  };
-  return new ConsoleAPI(consoleOptions);
-});
-
-class SavantShieldStudyClass {
-  constructor() {
-    this.STUDY_PREF = "shield.savant.enabled";
-    this.STUDY_TELEMETRY_CATEGORY = "savant";
-    this.ALWAYS_PRIVATE_BROWSING_PREF = "browser.privatebrowsing.autostart";
-    this.STUDY_DURATION_OVERRIDE_PREF = "shield.savant.duration_override";
-    this.STUDY_EXPIRATION_DATE_PREF = "shield.savant.expiration_date";
-    // ms = 'x' weeks * 7 days/week * 24 hours/day * 60 minutes/hour
-    // * 60 seconds/minute * 1000 milliseconds/second
-    this.DEFAULT_STUDY_DURATION_MS = 4 * 7 * 24 * 60 * 60 * 1000;
-    // If on startupStudy(), user is ineligible or study has expired,
-    // no probe listeners from this module have been added yet
-    this.shouldRemoveListeners = true;
-  }
-
-  init() {
-    this.telemetryEvents = new TelemetryEvents(this.STUDY_TELEMETRY_CATEGORY);
-    this.addonListener = new AddonListener(this.STUDY_TELEMETRY_CATEGORY);
-    this.bookmarkObserver = new BookmarkObserver(this.STUDY_TELEMETRY_CATEGORY);
-    this.menuListener = new MenuListener(this.STUDY_TELEMETRY_CATEGORY);
-
-    // check the pref in case Normandy flipped it on before we could add the pref listener
-    this.shouldCollect = Services.prefs.getBoolPref(this.STUDY_PREF);
-    if (this.shouldCollect) {
-      this.startupStudy();
-    }
-    Services.prefs.addObserver(this.STUDY_PREF, this);
-  }
-
-  observe(subject, topic, data) {
-    if (topic === "nsPref:changed" && data === this.STUDY_PREF) {
-      // toggle state of the pref
-      this.shouldCollect = !this.shouldCollect;
-      if (this.shouldCollect) {
-        this.startupStudy();
-      } else {
-        // The pref has been turned off
-        this.endStudy("study_disable");
-      }
-    }
-  }
-
-  startupStudy() {
-    // enable before any possible calls to endStudy, since it sends an 'end_study' event
-    this.telemetryEvents.enableCollection();
-
-    if (!this.isEligible()) {
-      this.shouldRemoveListeners = false;
-      this.endStudy("ineligible");
-      return;
-    }
-
-    this.initStudyDuration();
-
-    if (this.isStudyExpired()) {
-      log.debug("Study expired in between this and the previous session.");
-      this.shouldRemoveListeners = false;
-      this.endStudy("expired");
-    }
-
-    this.addonListener.init();
-    this.bookmarkObserver.init();
-    this.menuListener.init();
-  }
-
-  isEligible() {
-    const isAlwaysPrivateBrowsing = Services.prefs.getBoolPref(this.ALWAYS_PRIVATE_BROWSING_PREF);
-    if (isAlwaysPrivateBrowsing) {
-      return false;
-    }
-
-    return true;
-  }
-
-  initStudyDuration() {
-    if (Services.prefs.getStringPref(this.STUDY_EXPIRATION_DATE_PREF, "")) {
-      return;
-    }
-    Services.prefs.setStringPref(
-      this.STUDY_EXPIRATION_DATE_PREF,
-      this.getExpirationDateString()
-    );
-  }
-
-  getDurationFromPref() {
-    return Services.prefs.getIntPref(this.STUDY_DURATION_OVERRIDE_PREF, 0);
-  }
-
-  getExpirationDateString() {
-    const now = Date.now();
-    const studyDurationInMs =
-    this.getDurationFromPref()
-      || this.DEFAULT_STUDY_DURATION_MS;
-    const expirationDateInt = now + studyDurationInMs;
-    return new Date(expirationDateInt).toISOString();
-  }
-
-  isStudyExpired() {
-    const expirationDateInt =
-      Date.parse(Services.prefs.getStringPref(
-        this.STUDY_EXPIRATION_DATE_PREF,
-        this.getExpirationDateString()
-      ));
-
-    if (isNaN(expirationDateInt)) {
-      log.error(
-        `The value for the preference ${this.STUDY_EXPIRATION_DATE_PREF} is invalid.`
-      );
-      return false;
-    }
-
-    if (Date.now() > expirationDateInt) {
-      return true;
-    }
-    return false;
-  }
-
-  endStudy(reason) {
-    log.debug(`Ending the study due to reason: ${ reason }`);
-    const isStudyEnding = true;
-    Services.telemetry.recordEvent(this.STUDY_TELEMETRY_CATEGORY, "end_study", reason, null,
-                                  { subcategory: "shield" });
-    this.telemetryEvents.disableCollection();
-    this.uninit(isStudyEnding);
-    // These prefs needs to persist between restarts, so only reset on endStudy
-    Services.prefs.clearUserPref(this.STUDY_PREF);
-    Services.prefs.clearUserPref(this.STUDY_EXPIRATION_DATE_PREF);
-  }
-
-  // Called on every Firefox shutdown and endStudy
-  uninit(isStudyEnding = false) {
-    // if just shutting down, check for expiration, so the endStudy event can
-    // be sent along with this session's main ping.
-    if (!isStudyEnding && this.isStudyExpired()) {
-      log.debug("Study expired during this session.");
-      this.endStudy("expired");
-      return;
-    }
-
-    this.addonListener.uninit();
-    this.bookmarkObserver.uninit();
-    this.menuListener.uninit();
-
-    Services.prefs.removeObserver(this.ALWAYS_PRIVATE_BROWSING_PREF, this);
-    Services.prefs.removeObserver(this.STUDY_PREF, this);
-    Services.prefs.removeObserver(this.STUDY_DURATION_OVERRIDE_PREF, this);
-    Services.prefs.clearUserPref(PREF_LOG_LEVEL);
-    Services.prefs.clearUserPref(this.STUDY_DURATION_OVERRIDE_PREF);
-  }
-}
-
-// References:
-// - https://hg.mozilla.org/mozilla-central/file/tip/toolkit/components/normandy/lib/TelemetryEvents.jsm
-// - https://hg.mozilla.org/mozilla-central/file/tip/toolkit/components/normandy/lib/PreferenceExperiments.jsm#l357
-class TelemetryEvents {
-  constructor(studyCategory) {
-    this.STUDY_TELEMETRY_CATEGORY = studyCategory;
-  }
-
-  enableCollection() {
-    log.debug("Study has been enabled; turning ON data collection.");
-    Services.telemetry.setEventRecordingEnabled(this.STUDY_TELEMETRY_CATEGORY, true);
-  }
-
-  disableCollection() {
-    log.debug("Study has been disabled; turning OFF data collection.");
-    Services.telemetry.setEventRecordingEnabled(this.STUDY_TELEMETRY_CATEGORY, false);
-  }
-}
-
-class AddonListener {
-  constructor(studyCategory) {
-    this.STUDY_TELEMETRY_CATEGORY = studyCategory;
-    this.METHOD = "addon";
-    this.EXTRA_SUBCATEGORY = "customize";
-  }
-
-  init() {
-    this.listener = {
-      onInstalling: (addon, needsRestart) => {
-        const addon_id = addon.id;
-        this.recordEvent("install_start", addon_id);
-      },
-
-      onInstalled: (addon) => {
-        const addon_id = addon.id;
-        this.recordEvent("install_finish", addon_id);
-      },
-
-      onEnabled: (addon) => {
-        const addon_id = addon.id;
-        this.recordEvent("enable", addon_id);
-      },
-
-      onDisabled: (addon) => {
-        const addon_id = addon.id;
-        this.recordEvent("disable", addon_id);
-      },
-
-      onUninstalling: (addon, needsRestart) => {
-        const addon_id = addon.id;
-        this.recordEvent("remove_start", addon_id);
-      },
-
-      onUninstalled: (addon) => {
-        const addon_id = addon.id;
-        this.recordEvent("remove_finish", addon_id);
-      }
-    };
-    this.addListeners();
-  }
-
-  addListeners() {
-    AddonManager.addAddonListener(this.listener);
-  }
-
-  recordEvent(event, addon_id) {
-    log.debug(`Addon ID: ${addon_id}; event: ${ event }`);
-    Services.telemetry.recordEvent(this.STUDY_TELEMETRY_CATEGORY,
-                                  this.METHOD,
-                                  event,
-                                  addon_id,
-                                  { subcategory: this.EXTRA_SUBCATEGORY });
-  }
-
-  removeListeners() {
-    AddonManager.removeAddonListener(this.listener);
-  }
-
-  uninit() {
-    if (SavantShieldStudy.shouldRemoveListeners) {
-      this.removeListeners();
-    }
-  }
-}
-
-class BookmarkObserver {
-  constructor(studyCategory) {
-    this.STUDY_TELEMETRY_CATEGORY = studyCategory;
-    // there are two probes: bookmark and follow_bookmark
-    this.METHOD_1 = "bookmark";
-    this.EXTRA_SUBCATEGORY_1 = "feature";
-    this.METHOD_2 = "follow_bookmark";
-    this.EXTRA_SUBCATEGORY_2 = "navigation";
-    this.TYPE_BOOKMARK = Ci.nsINavBookmarksService.TYPE_BOOKMARK;
-    // Ignore "fake" bookmarks created for bookmark tags
-    this.skipTags = true;
-  }
-
-  init() {
-    this.addObservers();
-  }
-
-  addObservers() {
-    PlacesUtils.bookmarks.addObserver(this);
-  }
-
-  onItemAdded(itemID, parentID, index, itemType, uri, title, dateAdded, guid, parentGUID, source) {
-    this.handleItemAddRemove(itemType, uri, source, "save");
-  }
-
-  onItemRemoved(itemID, parentID, index, itemType, uri, guid, parentGUID, source) {
-    this.handleItemAddRemove(itemType, uri, source, "remove");
-  }
-
-  handleItemAddRemove(itemType, uri, source, event) {
-    /*
-    * "place:query" uris are used to create containers like Most Visited or
-    * Recently Bookmarked. These are added as default bookmarks.
-    */
-    if (itemType === this.TYPE_BOOKMARK && !uri.schemeIs("place")
-      && source === PlacesUtils.bookmarks.SOURCE_DEFAULT) {
-      const isBookmarkProbe = true;
-      this.recordEvent(event, isBookmarkProbe);
-    }
-  }
-
-  // This observer is only fired for TYPE_BOOKMARK items.
-  onItemVisited(itemID, visitID, time, transitionType, uri, parentID, guid, parentGUID) {
-    const isBookmarkProbe = false;
-    this.recordEvent("open", isBookmarkProbe);
-  }
-
-  recordEvent(event, isBookmarkProbe) {
-    const method = isBookmarkProbe ? this.METHOD_1 : this.METHOD_2;
-    const subcategory = isBookmarkProbe ? this.EXTRA_SUBCATEGORY_1 : this.EXTRA_SUBCATEGORY_2;
-    Services.telemetry.recordEvent(this.STUDY_TELEMETRY_CATEGORY, method, event, null,
-                                  {
-                                    subcategory
-                                  });
-  }
-
-  removeObservers() {
-    PlacesUtils.bookmarks.removeObserver(this);
-  }
-
-  uninit() {
-    if (SavantShieldStudy.shouldRemoveListeners) {
-      this.removeObservers();
-    }
-  }
-}
-
-class MenuListener {
-  constructor(studyCategory) {
-    this.STUDY_TELEMETRY_CATEGORY = studyCategory;
-    this.NAVIGATOR_TOOLBOX_ID = "navigator-toolbox";
-    this.OVERFLOW_PANEL_ID = "widget-overflow";
-    this.LIBRARY_PANELVIEW_ID = "appMenu-libraryView";
-    this.HAMBURGER_PANEL_ID = "appMenu-popup";
-    this.DOTDOTDOT_PANEL_ID = "pageActionPanel";
-    this.windowWatcher = new WindowWatcher();
-  }
-
-  init() {
-    this.windowWatcher.init(this.loadIntoWindow.bind(this),
-    this.unloadFromWindow.bind(this),
-    this.onWindowError.bind(this));
-  }
-
- loadIntoWindow(win) {
-    this.addListeners(win);
-  }
-
-  unloadFromWindow(win) {
-    this.removeListeners(win);
-  }
-
-  onWindowError(msg) {
-    log.error(msg);
-  }
-
-  addListeners(win) {
-    const doc = win.document;
-    const navToolbox = doc.getElementById(this.NAVIGATOR_TOOLBOX_ID);
-    const overflowPanel = doc.getElementById(this.OVERFLOW_PANEL_ID);
-    const hamburgerPanel = doc.getElementById(this.HAMBURGER_PANEL_ID);
-    const dotdotdotPanel = doc.getElementById(this.DOTDOTDOT_PANEL_ID);
-
-    /*
-    * the library menu "ViewShowing" event bubbles up on the navToolbox in its
-    * default location. A separate listener is needed if it is moved to the
-    * overflow panel via Hamburger > Customize
-    */
-    navToolbox.addEventListener("ViewShowing", this);
-    overflowPanel.addEventListener("ViewShowing", this);
-    hamburgerPanel.addEventListener("popupshown", this);
-    dotdotdotPanel.addEventListener("popupshown", this);
-  }
-
-  handleEvent(evt) {
-    switch (evt.type) {
-      case "ViewShowing":
-        if (evt.target.id === this.LIBRARY_PANELVIEW_ID) {
-          log.debug("Library panel opened.");
-          this.recordEvent("library_menu");
-        }
-        break;
-      case "popupshown":
-        switch (evt.target.id) {
-          case this.HAMBURGER_PANEL_ID:
-            log.debug("Hamburger panel opened.");
-            this.recordEvent("hamburger_menu");
-            break;
-          case this.DOTDOTDOT_PANEL_ID:
-            log.debug("Dotdotdot panel opened.");
-            this.recordEvent("dotdotdot_menu");
-            break;
-          default:
-            break;
-        }
-      break;
-    }
-  }
-
-  recordEvent(method) {
-    Services.telemetry.recordEvent(this.STUDY_TELEMETRY_CATEGORY, method, "open", null,
-                                  { subcategory: "menu" });
-  }
-
-  removeListeners(win) {
-    const doc = win.document;
-    const navToolbox = doc.getElementById(this.NAVIGATOR_TOOLBOX_ID);
-    const overflowPanel = doc.getElementById(this.OVERFLOW_PANEL_ID);
-    const hamburgerPanel = doc.getElementById(this.HAMBURGER_PANEL_ID);
-    const dotdotdotPanel = doc.getElementById(this.DOTDOTDOT_PANEL_ID);
-
-    try {
-      navToolbox.removeEventListener("ViewShowing", this);
-      overflowPanel.removeEventListener("ViewShowing", this);
-      hamburgerPanel.removeEventListener("popupshown", this);
-      dotdotdotPanel.removeEventListener("popupshown", this);
-    } catch (err) {
-      // Firefox is shutting down; elements have already been removed.
-    }
-  }
-
-  uninit() {
-    if (SavantShieldStudy.shouldRemoveListeners) {
-      this.windowWatcher.uninit();
-    }
-  }
-}
-
-/*
-* The WindowWatcher is used to add/remove listeners from MenuListener
-* to/from all windows.
-*/
-class WindowWatcher {
-  constructor() {
-    this._isActive = false;
-    this._loadCallback = null;
-    this._unloadCallback = null;
-    this._errorCallback = null;
-  }
-
-  // It is expected that loadCallback, unloadCallback, and errorCallback are bound
-  // to a `this` value.
-  init(loadCallback, unloadCallback, errorCallback) {
-    if (this._isActive) {
-      errorCallback("Called init, but WindowWatcher was already running");
-      return;
-    }
-
-    this._isActive = true;
-    this._loadCallback = loadCallback;
-    this._unloadCallback = unloadCallback;
-    this._errorCallback = errorCallback;
-
-    // Add loadCallback to existing windows
-    for (const win of Services.wm.getEnumerator("navigator:browser")) {
-      try {
-        this._loadCallback(win);
-      } catch (ex) {
-        this._errorCallback(`WindowWatcher code loading callback failed: ${ ex }`);
-      }
-    }
-
-    // Add loadCallback to future windows
-    // This will call the observe method on WindowWatcher
-    Services.ww.registerNotification(this);
-  }
-
-  uninit() {
-    if (!this._isActive) {
-      this._errorCallback("Called uninit, but WindowWatcher was already uninited");
-      return;
-    }
-
-    for (const win of Services.wm.getEnumerator("navigator:browser")) {
-      try {
-        this._unloadCallback(win);
-      } catch (ex) {
-        this._errorCallback(`WindowWatcher code unloading callback failed: ${ ex }`);
-      }
-    }
-
-    Services.ww.unregisterNotification(this);
-
-    this._loadCallback = null;
-    this._unloadCallback = null;
-    this._errorCallback = null;
-    this._isActive = false;
-  }
-
-  observe(win, topic) {
-    switch (topic) {
-      case "domwindowopened":
-        this._onWindowOpened(win);
-        break;
-      case "domwindowclosed":
-        this._onWindowClosed(win);
-        break;
-      default:
-        break;
-    }
-  }
-
-  _onWindowOpened(win) {
-    win.addEventListener("load", this, { once: true });
-  }
-
-  // only one event type expected: "load"
-  handleEvent(evt) {
-    const win = evt.target.ownerGlobal;
-
-    // make sure we only add window listeners to a DOMWindow (browser.xul)
-    const winType = win.document.documentElement.getAttribute("windowtype");
-    if (winType === "navigator:browser") {
-      this._loadCallback(win);
-    }
-  }
-
-  _onWindowClosed(win) {
-    this._unloadCallback(win);
-  }
-}
-
-const SavantShieldStudy = new SavantShieldStudyClass();
--- a/browser/modules/moz.build
+++ b/browser/modules/moz.build
@@ -133,17 +133,16 @@ EXTRA_JS_MODULES += [
     'OpenInTabsUtils.jsm',
     'PageActions.jsm',
     'PermissionUI.jsm',
     'PingCentre.jsm',
     'ProcessHangMonitor.jsm',
     'ReaderParent.jsm',
     'RemotePrompt.jsm',
     'Sanitizer.jsm',
-    'SavantShieldStudy.jsm',
     'SchedulePressure.jsm',
     'SiteDataManager.jsm',
     'SitePermissions.jsm',
     'TabsList.jsm',
     'ThemeVariableMap.jsm',
     'TransientPrefs.jsm',
     'webrtcUI.jsm',
     'ZoomUI.jsm',
--- a/toolkit/components/passwordmgr/LoginManagerContent.jsm
+++ b/toolkit/components/passwordmgr/LoginManagerContent.jsm
@@ -431,24 +431,18 @@ var LoginManagerContent = {
    * Fetch logins from the parent for a given form and then attempt to fill it.
    *
    * @param {FormLike} form to fetch the logins for then try autofill.
    * @param {Window} window
    */
   _fetchLoginsFromParentAndFillForm(form, window) {
     this._detectInsecureFormLikes(window);
 
-    const isPrivateWindow = PrivateBrowsingUtils.isContentWindowPrivate(window);
-
     let messageManager = window.docShell.messageManager;
-    messageManager.sendAsyncMessage("LoginStats:LoginEncountered",
-                                    {
-                                      isPrivateWindow,
-                                      isPwmgrEnabled: gEnabled,
-                                    });
+    messageManager.sendAsyncMessage("LoginStats:LoginEncountered");
 
     if (!gEnabled) {
       return;
     }
 
     this._getLoginDataFromParent(form, { showMasterPassword: true })
         .then(this.loginsFound.bind(this))
         .catch(Cu.reportError);
--- a/toolkit/components/passwordmgr/LoginManagerParent.jsm
+++ b/toolkit/components/passwordmgr/LoginManagerParent.jsm
@@ -89,23 +89,16 @@ var LoginManagerParent = {
         // TODO Verify msg.target's principals against the formOrigin?
         this.onFormSubmit(data.hostname,
                           data.formSubmitURL,
                           data.usernameField,
                           data.newPasswordField,
                           data.oldPasswordField,
                           msg.objects.openerTopWindow,
                           msg.target);
-
-        const flow_id = msg.target.ownerGlobal.gBrowser.getTabForBrowser(msg.target).linkedPanel;
-        Services.telemetry.recordEvent("savant", "login_form", "submit", null,
-                                      {
-                                        subcategory: "encounter",
-                                        flow_id,
-                                      });
         break;
       }
 
       case "RemoteLogins:insecureLoginFormPresent": {
         this.setHasInsecureLoginForms(msg.target, data.hasInsecureLoginForms);
         break;
       }
 
@@ -114,38 +107,16 @@ var LoginManagerParent = {
         break;
       }
 
       case "RemoteLogins:removeLogin": {
         let login = LoginHelper.vanillaObjectToLogin(data.login);
         AutoCompletePopup.removeLogin(login);
         break;
       }
-
-      case "LoginStats:LoginFillSuccessful": {
-        const flow_id = msg.target.ownerGlobal.gBrowser.getTabForBrowser(msg.target).linkedPanel;
-        Services.telemetry.recordEvent("savant", "pwmgr_use", "use", null,
-                                      {
-                                        subcategory: "feature",
-                                        flow_id,
-                                      });
-        break;
-      }
-
-      case "LoginStats:LoginEncountered": {
-        const canRecordSubmit = (!data.isPrivateWindow && data.isPwmgrEnabled).toString();
-        const flow_id = msg.target.ownerGlobal.gBrowser.getTabForBrowser(msg.target).linkedPanel;
-        Services.telemetry.recordEvent("savant", "login_form", "load", null,
-                                      {
-                                        subcategory: "encounter",
-                                        flow_id,
-                                        canRecordSubmit,
-                                      });
-        break;
-      }
     }
 
     return undefined;
   },
 
   /**
    * Trigger a login form fill and send relevant data (e.g. logins and recipes)
    * to the child process (LoginManagerContent).
--- a/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
+++ b/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
@@ -818,24 +818,16 @@ LoginManagerPrompter.prototype = {
                                             : this._getLocalizedString(changeMsgNames.prompt);
 
     let histogramName = type == "password-save" ? "PWMGR_PROMPT_REMEMBER_ACTION"
                                                 : "PWMGR_PROMPT_UPDATE_ACTION";
     let histogram = Services.telemetry.getHistogramById(histogramName);
     histogram.add(PROMPT_DISPLAYED);
     Services.obs.notifyObservers(null, "weave:telemetry:histogram", histogramName);
 
-    const promptType = type == "password-save" ? "save" : "update";
-    const flow_id = browser.ownerGlobal.gBrowser.getTabForBrowser(browser).linkedPanel;
-    Services.telemetry.recordEvent("savant", "pwmgr", "ask", promptType,
-                                  {
-                                    subcategory: "prompt",
-                                    flow_id,
-                                  });
-
     let chromeDoc = browser.ownerDocument;
 
     let currentNotification;
 
     let updateButtonStatus = (element) => {
       let mainActionButton = element.button;
       // Disable the main button inside the menu-button if the password field is empty.
       if (login.password.length == 0) {
@@ -953,30 +945,18 @@ LoginManagerPrompter.prototype = {
     };
 
     // The main action is the "Save" or "Update" button.
     let mainAction = {
       label: this._getLocalizedString(initialMsgNames.buttonLabel),
       accessKey: this._getLocalizedString(initialMsgNames.buttonAccessKey),
       callback: () => {
         histogram.add(PROMPT_ADD_OR_UPDATE);
-        const flow_id = browser.ownerGlobal.gBrowser.getTabForBrowser(browser).linkedPanel;
         if (histogramName == "PWMGR_PROMPT_REMEMBER_ACTION") {
           Services.obs.notifyObservers(null, "LoginStats:NewSavedPassword");
-          Services.telemetry.recordEvent("savant", "pwmgr", "save", null,
-                                        {
-                                          subcategory: "prompt",
-                                          flow_id,
-                                        });
-        } else if (histogramName == "PWMGR_PROMPT_UPDATE_ACTION") {
-          Services.telemetry.recordEvent("savant", "pwmgr", "update", null,
-                                        {
-                                          subcategory: "prompt",
-                                          flow_id,
-                                        });
         }
         readDataFromUI();
         persistData();
         Services.obs.notifyObservers(null, "weave:telemetry:histogram", histogramName);
         browser.focus();
       }
     };
 
--- a/toolkit/components/reader/ReaderMode.jsm
+++ b/toolkit/components/reader/ReaderMode.jsm
@@ -93,19 +93,16 @@ var ReaderMode = {
     }
   },
 
   /**
    * Enter the reader mode by going forward one step in history if applicable,
    * if not, append the about:reader page in the history instead.
    */
   enterReaderMode(docShell, win) {
-    Services.telemetry.recordEvent("savant", "readermode", "on", null,
-                                  { subcategory: "feature" });
-
     let url = win.document.location.href;
     let readerURL = "about:reader?url=" + encodeURIComponent(url);
     let webNav = docShell.QueryInterface(Ci.nsIWebNavigation);
     let sh = webNav.sessionHistory;
     if (webNav.canGoForward) {
       let forwardEntry = sh.legacySHistory.getEntryAtIndex(sh.index + 1, false);
       let forwardURL = forwardEntry.URI.spec;
       if (forwardURL && (forwardURL == readerURL || !readerURL)) {
@@ -117,18 +114,16 @@ var ReaderMode = {
     win.document.location = readerURL;
   },
 
   /**
    * Exit the reader mode by going back one step in history if applicable,
    * if not, append the original page in the history instead.
    */
   leaveReaderMode(docShell, win) {
-    Services.telemetry.recordEvent("savant", "readermode", "off", null,
-                                  { subcategory: "feature" });
     let url = win.document.location.href;
     let originalURL = this.getOriginalUrl(url);
     let webNav = docShell.QueryInterface(Ci.nsIWebNavigation);
     let sh = webNav.sessionHistory;
     if (webNav.canGoBack) {
       let prevEntry = sh.legacySHistory.getEntryAtIndex(sh.index - 1, false);
       let prevURL = prevEntry.URI.spec;
       if (prevURL && (prevURL == originalURL || !originalURL)) {
--- a/toolkit/components/telemetry/Events.yaml
+++ b/toolkit/components/telemetry/Events.yaml
@@ -108,216 +108,16 @@ navigation:
     bug_numbers: [1316281]
     notification_emails:
       - "past@mozilla.com"
       - "dzeber@mozilla.com"
     expiry_version: "65"
     extra_keys:
       engine: The id of the search engine used.
 
-# This category contains event entries used for the Savant Shield study.
-savant:
-  # Mostly a dupe of "search" event from "navigation" category to ensure only Savant
-  # code enables/disables it.
-  search:
-    objects: ["about_home", "about_newtab", "contextmenu", "oneoff",
-              "suggestion", "alias", "enter", "searchbar", "urlbar"]
-    release_channel_collection: opt-out
-    record_in_processes: ["main"]
-    description: >
-      This is recorded on each search navigation.
-      The value field records the action used to trigger the search:
-        "enter", "oneoff", "suggestion", "alias", null (for contextmenu)
-    bug_numbers: [1316281, 1457226, 1462725]
-    notification_emails:
-      - "bdanforth@mozilla.com"
-      - "shong@mozilla.com"
-    expiry_version: "65"
-    extra_keys:
-      subcategory: The broad event category for this probe. E.g. navigation
-      engine: The id of the search engine used.
-  end_study:
-    objects: ["ineligible", "study_disable", "expired"]
-    release_channel_collection: opt-out
-    record_in_processes: ["main"]
-    description: >
-      This is recorded any time a study ending condition occurs for the Savant
-      Shield study. The object field records the reason that caused the ending.
-    bug_numbers: [1457226, 1462725]
-    notification_emails:
-      - "bdanforth@mozilla.com"
-      - "shong@mozilla.com"
-    expiry_version: "65"
-    extra_keys:
-      subcategory: The broad event category for this probe. E.g. navigation
-  readermode:
-    objects: ["on", "off"]
-    release_channel_collection: opt-out
-    record_in_processes: ["content"]
-    description: >
-      This is recorded any time Reader Mode is turned on or off.
-    bug_numbers: [1457226, 1465698]
-    notification_emails:
-      - "bdanforth@mozilla.com"
-      - "shong@mozilla.com"
-    expiry_version: "65"
-    extra_keys:
-      subcategory: The broad event category for this probe. E.g. navigation
-  addon:
-    objects: ["install_start", "install_finish", "remove_start", "remove_finish",
-              "enable", "disable" ]
-    release_channel_collection: opt-out
-    record_in_processes: ["main"]
-    description: >
-      This is recorded any time an addon event as listed in the objects field fires.
-      The value field records the addon ID for the event.
-    bug_numbers: [1457226, 1465707]
-    notification_emails:
-      - "bdanforth@mozilla.com"
-      - "shong@mozilla.com"
-    expiry_version: "65"
-    extra_keys:
-      subcategory: The broad event category for this probe. E.g. navigation
-  bookmark:
-    objects: ["save", "remove"]
-    release_channel_collection: opt-out
-    record_in_processes: ["main"]
-    description: >
-      This is recorded any time a bookmark is saved or removed.
-    bug_numbers: [1457226, 1465703]
-    notification_emails:
-      - "bdanforth@mozilla.com"
-      - "shong@mozilla.com"
-    expiry_version: "65"
-    extra_keys:
-      subcategory: The broad event category for this probe. E.g. navigation
-  follow_bookmark:
-    objects: ["open"]
-    release_channel_collection: opt-out
-    record_in_processes: ["main"]
-    description: >
-      This is recorded any time a bookmark is visited.
-    bug_numbers: [1457226, 1465703]
-    notification_emails:
-      - "bdanforth@mozilla.com"
-      - "shong@mozilla.com"
-    expiry_version: "65"
-    extra_keys:
-      subcategory: The broad event category for this probe. E.g. navigation
-  follow_urlbar_link:
-    objects: ["bookmark", "history"]
-    release_channel_collection: opt-out
-    record_in_processes: ["main"]
-    description: >
-      This is recorded when the user selects a urlbar bookmark or history result.
-    bug_numbers: [1457226, 1465704]
-    notification_emails:
-      - "bdanforth@mozilla.com"
-      - "shong@mozilla.com"
-    expiry_version: "65"
-    extra_keys:
-      subcategory: The broad event category for this probe. E.g. navigation
-  library_menu:
-    objects: ["open"]
-    release_channel_collection: opt-out
-    record_in_processes: ["main"]
-    description: >
-      This is recorded any time the library menu is opened.
-    bug_numbers: [1457226, 1465697]
-    notification_emails:
-      - "bdanforth@mozilla.com"
-      - "shong@mozilla.com"
-    expiry_version: "65"
-    extra_keys:
-      subcategory: The broad event category for this probe. E.g. navigation
-  hamburger_menu:
-    objects: ["open"]
-    release_channel_collection: opt-out
-    record_in_processes: ["main"]
-    description: >
-      This is recorded any time the hamburger menu is opened.
-    bug_numbers: [1457226, 1465697]
-    notification_emails:
-      - "bdanforth@mozilla.com"
-      - "shong@mozilla.com"
-    expiry_version: "65"
-    extra_keys:
-      subcategory: The broad event category for this probe. E.g. navigation
-  dotdotdot_menu:
-    objects: ["open"]
-    release_channel_collection: opt-out
-    record_in_processes: ["main"]
-    description: >
-      This is recorded any time the dotdotdot (aka pageAction) menu is opened.
-    bug_numbers: [1457226, 1465697]
-    notification_emails:
-      - "bdanforth@mozilla.com"
-      - "shong@mozilla.com"
-    expiry_version: "65"
-    extra_keys:
-      subcategory: The broad event category for this probe. E.g. navigation
-  pwmgr_use:
-    objects: ["use"]
-    release_channel_collection: opt-out
-    record_in_processes: ["main"]
-    description: >
-      Client uses saved login information from the Password Manager
-    bug_numbers: [1457226, 1465685]
-    notification_emails:
-      - "bdanforth@mozilla.com"
-      - "shong@mozilla.com"
-    expiry_version: "65"
-    extra_keys:
-      subcategory: The broad event category for this probe. E.g. navigation
-      flow_id: A tab identifier to associate events occuring in the same tab
-  pwmgr:
-    objects: ["ask", "save", "update"]
-    release_channel_collection: opt-out
-    record_in_processes: ["main"]
-    description: >
-      Password Manager asks the user to save or update login information.
-      For ask prompts, the value field indicate a save versus update ask.
-    bug_numbers: [1457226, 1465685]
-    notification_emails:
-      - "bdanforth@mozilla.com"
-      - "shong@mozilla.com"
-    expiry_version: "65"
-    extra_keys:
-      subcategory: The broad event category for this probe. E.g. navigation
-      flow_id: A tab identifier to associate events occuring in the same tab
-  login_form:
-    objects: ["load", "submit"]
-    release_channel_collection: opt-out
-    record_in_processes: ["main"]
-    description: >
-      A login form has been loaded or submitted. Login form submit events only
-      fire in non-private windows with Password Manager enabled.
-    bug_numbers: [1457226, 1465685]
-    notification_emails:
-      - "bdanforth@mozilla.com"
-      - "shong@mozilla.com"
-    expiry_version: "65"
-    extra_keys:
-      subcategory: The broad event category for this probe. E.g. navigation
-      flow_id: A tab identifier to associate events occuring in the same tab
-      canRecordSubmit: True if a login form loads in a non-private window with Password Manager enabled.
-  tab:
-    objects: ["open", "close", "select"]
-    release_channel_collection: opt-out
-    record_in_processes: ["main"]
-    description: >
-      This is recorded any time a tab is opened, closed or selected.
-    bug_numbers: [1457226, 1465694]
-    notification_emails:
-      - "bdanforth@mozilla.com"
-      - "shong@mozilla.com"
-    expiry_version: "65"
-    extra_keys:
-      subcategory: The broad event category for this probe. E.g. navigation
-
 # This category contains event entries used for Telemetry tests.
 # They will not be sent out with any pings.
 telemetry.test:
   test:
     methods: ["test1", "test2"]
     objects: ["object1", "object2"]
     bug_numbers: [1286606]
     notification_emails: ["telemetry-client-dev@mozilla.com"]