From 6e3ac6acb8a2cbb3e1ec55022b10e687bc67bb7c Mon Sep 17 00:00:00 2001 From: Justin Dolske Date: Mon, 23 Mar 2009 16:40:36 -0700 Subject: [PATCH] Bug 483693 - import from legacy storage should use a transaction for better performance. r=sdwilsh --- toolkit/components/passwordmgr/src/storage-mozStorage.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/toolkit/components/passwordmgr/src/storage-mozStorage.js b/toolkit/components/passwordmgr/src/storage-mozStorage.js index f56c6914e261..e4f0260396f0 100644 --- a/toolkit/components/passwordmgr/src/storage-mozStorage.js +++ b/toolkit/components/passwordmgr/src/storage-mozStorage.js @@ -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";