mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 02:05:42 +00:00
Backed out changeset d15abe37a931 (bug 1058438)
This commit is contained in:
parent
a2744dec29
commit
08889aeff5
@ -268,8 +268,6 @@ LoginStore.prototype = {
|
||||
if (!this.data.logins) {
|
||||
this.data.logins = [];
|
||||
}
|
||||
|
||||
// Stub needed for login imports before data has been migrated.
|
||||
if (!this.data.disabledHosts) {
|
||||
this.data.disabledHosts = [];
|
||||
}
|
||||
|
@ -27,9 +27,6 @@ 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 = {
|
||||
@ -87,24 +84,7 @@ this.LoginManagerStorage_json.prototype = {
|
||||
|
||||
// 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");
|
||||
@ -386,6 +366,8 @@ this.LoginManagerStorage_json.prototype = {
|
||||
|
||||
/**
|
||||
* Removes all logins from storage.
|
||||
*
|
||||
* Disabled hosts are kept, as one presumably doesn't want to erase those.
|
||||
*/
|
||||
removeAllLogins() {
|
||||
this._store.ensureDataReady();
|
||||
|
Loading…
Reference in New Issue
Block a user