Backed out changeset d15abe37a931 (bug 1058438)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Mon, 25 Jul 2016 12:20:36 +0200
changeset 346368 b93bc99d4c6eb8cb1c6e36d56a3ce06ae83355be
parent 346367 1c60e002f023347feb49fd7b1c08e51b601f2675
child 346369 1bb05a19ff9d70ed1d858d526fdbe27a8408f19f
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1058438
milestone50.0a1
backs outd15abe37a931d9e8db0565bdc7d45e17ba5824d3
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 d15abe37a931 (bug 1058438)
toolkit/components/passwordmgr/LoginStore.jsm
toolkit/components/passwordmgr/storage-json.js
--- a/toolkit/components/passwordmgr/LoginStore.jsm
+++ b/toolkit/components/passwordmgr/LoginStore.jsm
@@ -263,18 +263,16 @@ LoginStore.prototype = {
    * Synchronously work on the data just loaded into memory.
    */
   _processLoadedData: function ()
   {
     // Create any arrays that are not present in the saved file.
     if (!this.data.logins) {
       this.data.logins = [];
     }
-
-    // Stub needed for login imports before data has been migrated.
     if (!this.data.disabledHosts) {
       this.data.disabledHosts = [];
     }
 
     // Indicate that the current version of the code has touched the file.
     this.data.version = kDataVersion;
 
     this.dataReady = true;
--- a/toolkit/components/passwordmgr/storage-json.js
+++ b/toolkit/components/passwordmgr/storage-json.js
@@ -22,19 +22,16 @@ XPCOMUtils.defineLazyModuleGetter(this, 
                                   "resource://gre/modules/LoginStore.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(this, "gUUIDGenerator",
                                    "@mozilla.org/uuid-generator;1",
                                    "nsIUUIDGenerator");
 
-// The permission type we store in the permission manager.
-const PERMISSION_SAVE_LOGINS = "login-saving";
-
 this.LoginManagerStorage_json = function () {};
 
 this.LoginManagerStorage_json.prototype = {
   classID: Components.ID("{c00c432d-a0c9-46d7-bef6-9c45b4d07341}"),
   QueryInterface: XPCOMUtils.generateQI([Ci.nsILoginManagerStorage]),
 
   __crypto: null,  // nsILoginManagerCrypto service
   get _crypto() {
@@ -82,34 +79,17 @@ this.LoginManagerStorage_json.prototype 
           // prevent us from marking the operation as completed.
           // At the next startup, we will not try the import again.
           yield loginImport.import().catch(Cu.reportError);
           this._store.saveSoon();
         }
 
         // We won't attempt import again on next startup.
         Services.prefs.setBoolPref("signon.importedFromSqlite", true);
-      }.bind(this)).catch(Cu.reportError)
-      .then(Task.spawn(function () {
-        // If the storage has a disabledHosts entry we migrate them
-        // to the permissions manager (bug 1058438)
-        if (!this._store.data || !this._store.data.disabledHosts) {
-          return; // already migrated.
-        }
-        for (let host of this._store.data.disabledHosts) {
-          try {
-            let uri = Services.io.newURI(host, null, null);
-            Services.perms.add(uri, PERMISSION_SAVE_LOGINS, Services.perms.DENY_ACTION);
-          } catch (e) {
-            Cu.reportError(e);
-          }
-        }
-        delete this._store.data.disabledHosts;
-        this._store.saveSoon();
-      }.bind(this))).catch(Cu.reportError);
+      }.bind(this)).catch(Cu.reportError);
     } catch (e) {
       this.log("Initialization failed:", e);
       throw new Error("Initialization failed");
     }
   },
 
   /**
    * Internal method used by regression tests only.  It is called before
@@ -381,16 +361,18 @@ this.LoginManagerStorage_json.prototype 
 
     this.log("_searchLogins: returning", foundLogins.length, "logins for", matchData,
              "with options", aOptions);
     return [foundLogins, foundIds];
   },
 
   /**
    * Removes all logins from storage.
+   *
+   * Disabled hosts are kept, as one presumably doesn't want to erase those.
    */
   removeAllLogins() {
     this._store.ensureDataReady();
 
     this.log("Removing all logins");
     this._store.data.logins = [];
     this._store.saveSoon();