Backed out changeset b4f0e8b4b6fa (bug 1559365) for causing browser-chrome failures in AboutLoginsParent.jsm
authorMihai Alexandru Michis <malexandru@mozilla.com>
Sat, 06 Jul 2019 03:18:28 +0300
changeset 544371 91d8f385c5e5ec15c5cdb1d6c24b582fe1862acc
parent 544370 921eab31ab8eaa9c381d5c44b65fc2045c97845a
child 544372 16485dcacef6087da868ac4fef2ad829850db195
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1559365
milestone69.0a1
backs outb4f0e8b4b6faec847999027e2cff9d5227077d21
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 changeset b4f0e8b4b6fa (bug 1559365) for causing browser-chrome failures in AboutLoginsParent.jsm
browser/components/BrowserGlue.jsm
browser/components/aboutlogins/AboutLoginsChild.jsm
browser/components/aboutlogins/AboutLoginsParent.jsm
browser/components/aboutlogins/content/aboutLogins.js
browser/components/aboutlogins/content/components/login-list-item.css
browser/components/aboutlogins/content/components/login-list.js
--- a/browser/components/BrowserGlue.jsm
+++ b/browser/components/BrowserGlue.jsm
@@ -98,17 +98,16 @@ let LEGACY_ACTORS = {
         AboutLoginsOpenFeedback: { wantUntrusted: true },
         AboutLoginsOpenPreferences: { wantUntrusted: true },
         AboutLoginsOpenSite: { wantUntrusted: true },
         AboutLoginsRecordTelemetryEvent: { wantUntrusted: true },
         AboutLoginsUpdateLogin: { wantUntrusted: true },
       },
       messages: [
         "AboutLogins:AllLogins",
-        "AboutLogins:UpdateBreaches",
         "AboutLogins:LoginAdded",
         "AboutLogins:LoginModified",
         "AboutLogins:LoginRemoved",
       ],
     },
   },
 
   AboutReader: {
--- a/browser/components/aboutlogins/AboutLoginsChild.jsm
+++ b/browser/components/aboutlogins/AboutLoginsChild.jsm
@@ -106,19 +106,16 @@ class AboutLoginsChild extends ActorChil
     }
   }
 
   receiveMessage(message) {
     switch (message.name) {
       case "AboutLogins:AllLogins":
         this.sendToContent("AllLogins", message.data);
         break;
-      case "AboutLogins:UpdateBreaches":
-        this.sendToContent("UpdateBreaches", message.data);
-        break;
       case "AboutLogins:LoginAdded":
         this.sendToContent("LoginAdded", message.data);
         break;
       case "AboutLogins:LoginModified":
         this.sendToContent("LoginModified", message.data);
         break;
       case "AboutLogins:LoginRemoved":
         this.sendToContent("LoginRemoved", message.data);
--- a/browser/components/aboutlogins/AboutLoginsParent.jsm
+++ b/browser/components/aboutlogins/AboutLoginsParent.jsm
@@ -21,21 +21,16 @@ ChromeUtils.defineModuleGetter(
 );
 ChromeUtils.defineModuleGetter(
   this,
   "MigrationUtils",
   "resource:///modules/MigrationUtils.jsm"
 );
 ChromeUtils.defineModuleGetter(
   this,
-  "RemoteSettings",
-  "resource://services-settings/remote-settings.js"
-);
-ChromeUtils.defineModuleGetter(
-  this,
   "Services",
   "resource://gre/modules/Services.jsm"
 );
 
 XPCOMUtils.defineLazyGetter(this, "log", () => {
   return LoginHelper.createLogger("AboutLoginsParent");
 });
 
@@ -175,22 +170,19 @@ var AboutLoginsParent = {
         ) {
           Services.obs.addObserver(this, "passwordmgr-crypto-login");
           Services.obs.addObserver(this, "passwordmgr-crypto-loginCanceled");
           Services.obs.addObserver(this, "passwordmgr-storage-changed");
         }
         this._subscribers.add(message.target);
 
         let messageManager = message.target.messageManager;
-        const logins = await this.getAllLogins();
-        messageManager.sendAsyncMessage("AboutLogins:AllLogins", logins);
-        const breachesByLoginGUID = await this.getBreachesForLogins(logins);
         messageManager.sendAsyncMessage(
-          "AboutLogins:UpdateBreaches",
-          breachesByLoginGUID
+          "AboutLogins:AllLogins",
+          await this.getAllLogins()
         );
         break;
       }
       case "AboutLogins:UpdateLogin": {
         let loginUpdates = message.data.login;
         let logins = LoginHelper.searchLoginsWithObject({
           guid: loginUpdates.guid,
         });
@@ -366,29 +358,9 @@ var AboutLoginsParent = {
     } catch (e) {
       if (e.result == Cr.NS_ERROR_ABORT) {
         // If the user cancels the MP prompt then return no logins.
         return [];
       }
       throw e;
     }
   },
-
-  async getBreachesForLogins(logins) {
-    const breaches = await RemoteSettings("fxmonitor-breaches").get();
-    const breachHostMap = new Map();
-    for (const breach of breaches) {
-      breachHostMap.set(breach.Domain, breach);
-    }
-    const breachesByLoginGUID = new Map();
-    for (const login of logins) {
-      const loginURI = Services.io.newURI(login.origin);
-      const breach = breachHostMap.get(loginURI.host) || false;
-      if (
-        breach &&
-        login.timePasswordChanged < new Date(breach.BreachDate).getTime()
-      ) {
-        breachesByLoginGUID.set(login.guid, breach);
-      }
-    }
-    return breachesByLoginGUID;
-  },
 };
--- a/browser/components/aboutlogins/content/aboutLogins.js
+++ b/browser/components/aboutlogins/content/aboutLogins.js
@@ -34,20 +34,16 @@ document.addEventListener(
 );
 
 window.addEventListener("AboutLoginsChromeToContent", event => {
   switch (event.detail.messageType) {
     case "AllLogins": {
       gElements.loginList.setLogins(event.detail.value);
       break;
     }
-    case "UpdateBreaches": {
-      gElements.loginList.updateBreaches(event.detail.value);
-      break;
-    }
     case "LoginAdded": {
       gElements.loginList.loginAdded(event.detail.value);
       gElements.loginItem.loginAdded(event.detail.value);
       break;
     }
     case "LoginModified": {
       gElements.loginList.loginModified(event.detail.value);
       gElements.loginItem.loginModified(event.detail.value);
--- a/browser/components/aboutlogins/content/components/login-list-item.css
+++ b/browser/components/aboutlogins/content/components/login-list-item.css
@@ -24,20 +24,16 @@
   background-color: var(--in-content-box-background-odd);
 }
 
 :host(.selected) {
   border-inline-start-color: var(--in-content-border-highlight);
   background-color: var(--in-content-box-background-hover);
 }
 
-:host(.breached) {
-    border-inline-start-color: var(--in-content-border-invalid);
-}
-
 .title {
   font-weight: bold;
 }
 
 .title,
 .username {
   display: block;
   max-width: 50ch;
--- a/browser/components/aboutlogins/content/components/login-list.js
+++ b/browser/components/aboutlogins/content/components/login-list.js
@@ -74,22 +74,16 @@ export default class LoginList extends H
 
     for (let login of this._logins) {
       let listItem = new LoginListItem(login);
       if (login.guid == this._selectedGuid) {
         listItem.classList.add("selected");
         listItem.setAttribute("aria-selected", "true");
         this._list.setAttribute("aria-activedescendant", listItem.id);
       }
-      if (
-        this._breachesByLoginGUID &&
-        this._breachesByLoginGUID.has(login.guid)
-      ) {
-        listItem.classList.add("breached");
-      }
       this._list.append(listItem);
     }
 
     let visibleLoginCount = this._applyFilter();
     document.l10n.setAttributes(this._count, "login-list-count", {
       count: visibleLoginCount,
     });
   }
@@ -164,24 +158,16 @@ export default class LoginList extends H
             detail: firstVisibleLogin._login,
           })
         );
       }
     }
   }
 
   /**
-   * @param {Map} breachesByLoginGUID A Map of breaches by login GUIDs used for displaying breached login indicators.
-   */
-  updateBreaches(breachesByLoginGUID) {
-    this._breachesByLoginGUID = breachesByLoginGUID;
-    this.render();
-  }
-
-  /**
    * @param {login} login A login that was added to storage.
    */
   loginAdded(login) {
     this._logins.push(login);
     this.render();
   }
 
   /**