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
Родитель 227c077f37
Коммит 6e3ac6acb8
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -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";