Bug 888784 - Make FormHistory.expireOldEntries use new Sqlite.jsm database backend. r=mak
☠☠ backed out by 9fc7e71752fd ☠ ☠
authorMike Conley <mconley@mozilla.com>
Fri, 01 Dec 2017 14:54:02 -0500
changeset 452696 d92599272745f5dd442cb1e4d66e3c18b56e42df
parent 452695 67c58cb32ac9cb44bee2d15be016d9065172d964
child 452697 98722ab8c2f6e9dd23dfb18e9a58d576328da8e8
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs888784
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 888784 - Make FormHistory.expireOldEntries use new Sqlite.jsm database backend. r=mak MozReview-Commit-ID: KSaWz0s6hF1
toolkit/components/satchel/FormHistory.jsm
--- a/toolkit/components/satchel/FormHistory.jsm
+++ b/toolkit/components/satchel/FormHistory.jsm
@@ -860,23 +860,22 @@ function expireOldEntriesDeletion(aExpir
  * @param {number} aBeginningCount number of entries at first
  */
 function expireOldEntriesVacuum(aExpireTime, aBeginningCount) {
   FormHistory.count({}, {
     handleResult(aEndingCount) {
       if (aBeginningCount - aEndingCount > 500) {
         log("expireOldEntriesVacuum");
 
-        let stmt = dbCreateAsyncStatement("VACUUM");
-        stmt.executeAsync({
-          handleResult: NOOP,
-          handleError(aError) {
+        FormHistory.db.then(async conn => {
+          try {
+            await conn.executeCached("VACUUM");
+          } catch (e) {
             log("expireVacuumError");
-          },
-          handleCompletion: NOOP,
+          }
         });
       }
 
       sendNotification("formhistory-expireoldentries", aExpireTime);
     },
     handleError(aError) {
       log("expireEndCountFailure");
     },