Bug 452899 - Don't explicitly create the statement wrapper - storage does it for us; r=(dolske + sdwilsh)
☠☠ backed out by 783541270c29 ☠ ☠
authorPaul O'Shannessy <paul@oshannessy.com>
Sat, 20 Sep 2008 17:02:26 +0200
changeset 19453 fa8fbd81159d415304e12c3273f040416f4e7fd5
parent 19452 bee5256b90e1cd10f0482cdc812010d18f37ed76
child 19454 72a9124cdb200cc268506c00c122d43c3aaa5132
child 19461 783541270c298725bcc433342ad12069551148fa
push id2242
push usersgautherie.bz@free.fr
push dateSat, 20 Sep 2008 15:02:46 +0000
treeherderautoland@fa8fbd81159d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs452899
milestone1.9.1b1pre
Bug 452899 - Don't explicitly create the statement wrapper - storage does it for us; r=(dolske + sdwilsh)
toolkit/components/passwordmgr/src/storage-mozStorage.js
--- a/toolkit/components/passwordmgr/src/storage-mozStorage.js
+++ b/toolkit/components/passwordmgr/src/storage-mozStorage.js
@@ -942,22 +942,17 @@ LoginManagerStorage_mozStorage.prototype
      * Creates a statement, wraps it, and then does parameter replacement
      * Returns the wrapped statement for execution.  Will use memoization
      * so that statements can be reused.
      */
     _dbCreateStatement : function (query, params) {
         // Memoize the statements
         if (!this._dbStmts[query]) {
             this.log("Creating new statement for query: " + query);
-            let stmt = this._dbConnection.createStatement(query);
-
-            let wrappedStmt = Cc["@mozilla.org/storage/statement-wrapper;1"].
-                              createInstance(Ci.mozIStorageStatementWrapper);
-            wrappedStmt.initialize(stmt);
-            this._dbStmts[query] = wrappedStmt;
+            this._dbStmts[query] = this._dbConnection.createStatement(query);
         }
         // Replace parameters, must be done 1 at a time
         if (params)
             for (let i in params)
                 this._dbStmts[query].params[i] = params[i];
         return this._dbStmts[query];
     },
 
@@ -1070,17 +1065,17 @@ LoginManagerStorage_mozStorage.prototype
         // Create backup file
         if (backup) {
             let backupFile = this._signonsFile.leafName + ".corrupt";
             this._storageService.backupDatabaseFile(this._signonsFile, backupFile);
         }
 
         // Finalize all statements to free memory, avoid errors later
         for (let i = 0; i < this._dbStmts.length; i++)
-            this._dbStmts[i].statement.finalize();
+            this._dbStmts[i].finalize();
         this._dbStmts = [];
 
         // Close the connection, ignore 'already closed' error
         try { this._dbConnection.close() } catch(e) {}
         this._signonsFile.remove(false);
     }
 
 }; // end of nsLoginManagerStorage_mozStorage implementation