Bug 483693 - import from legacy storage should use a transaction for better performance. r=sdwilsh

This commit is contained in:
Justin Dolske 2009-03-23 16:40:36 -07:00
parent 1d325109b3
commit e6ec16865a

View File

@ -914,11 +914,15 @@ LoginManagerStorage_mozStorage.prototype = {
// Import logins and disabledHosts
let logins = legacy.getAllEncryptedLogins({});
// Wrap in a transaction for better performance.
this._dbConnection.beginTransaction();
for each (let login in logins)
this._addLogin(login, true);
let disabledHosts = legacy.getAllDisabledHosts({});
for each (let hostname in disabledHosts)
this.setLoginSavingEnabled(hostname, false);
this._dbConnection.commitTransaction();
} catch (e) {
this.log("_importLegacySignons failed: " + e.name + " : " + e.message);
throw "Import failed";