Bug 756701 - Don't add items to the deleted tables when removeAll is called. r=dolske,mfinkle a=blassey
authorWes Johnston <wjohnston@mozilla.com>
Tue, 22 May 2012 15:33:34 -0700
changeset 95852 420d9a20075d94dcb7c4825e566b76830b8014f2
parent 95851 439f333274eef027d842da75753e610971683401
child 95853 cb1661106d95873f5776fb589e276b4d25c66d31
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdolske, mfinkle, blassey
bugs756701
milestone14.0a2
Bug 756701 - Don't add items to the deleted tables when removeAll is called. r=dolske,mfinkle a=blassey
toolkit/components/passwordmgr/storage-mozStorage.js
toolkit/components/satchel/nsFormHistory.js
--- a/toolkit/components/passwordmgr/storage-mozStorage.js
+++ b/toolkit/components/passwordmgr/storage-mozStorage.js
@@ -721,23 +721,20 @@ LoginManagerStorage_mozStorage.prototype
         let query;
         let stmt;
         let transaction = new Transaction(this._dbConnection);
  
         // Delete any old, unused files.
         this._removeOldSignonsFiles();
 
         // Disabled hosts kept, as one presumably doesn't want to erase those.
+        // TODO: Add these items to the deleted items table once we've sorted
+        //       out the issues from bug 756701
         query = "DELETE FROM moz_logins";
         try {
-            let logins = this.getAllLogins();
-            for each (let login in logins) {
-                let [id, storedLogin] = this._getIdForLogin(login);
-                this.storeDeletedLogin(storedLogin);
-            }
             stmt = this._dbCreateStatement(query);
             stmt.execute();
             transaction.commit();
         } catch (e) {
             this.log("_removeAllLogins failed: " + e.name + " : " + e.message);
             transaction.rollback();
             throw "Couldn't write to database";
         } finally {
--- a/toolkit/components/satchel/nsFormHistory.js
+++ b/toolkit/components/satchel/nsFormHistory.js
@@ -328,21 +328,18 @@ FormHistory.prototype = {
         let query = "DELETE FROM moz_formhistory";
         let existingTransactionInProgress;
 
         try {
             // Don't start a transaction if one is already in progress since we can't nest them.
             existingTransactionInProgress = this.dbConnection.transactionInProgress;
             if (!existingTransactionInProgress)
                 this.dbConnection.beginTransaction();
-            this.moveToDeletedTable(
-              "SELECT guid, :timeDeleted FROM moz_formhistory", {
-              timeDeleted: Date.now()
-            });
-
+            // TODO: Add these items to the deleted items table once we've sorted
+            //       out the issues from bug 756701
             stmt = this.dbCreateStatement(query);
             stmt.execute();
             this.sendNotification("removeAllEntries", null);
         } catch (e) {
             if (!existingTransactionInProgress)
                 this.dbConnection.rollbackTransaction();
             this.log("removeAllEntries failed: " + e);
             throw e;