Bug 888784 - Get rid of FormHistory.shutdown. r=mak
☠☠ backed out by 9fc7e71752fd ☠ ☠
authorMike Conley <mconley@mozilla.com>
Thu, 30 Nov 2017 18:11:18 -0500
changeset 452694 46fb8f82f2bffe2bbd27ee8bcec815e3f59d7697
parent 452693 73ad820d09ecafbfab3e3d2979f64677009b3ed6
child 452695 67c58cb32ac9cb44bee2d15be016d9065172d964
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 - Get rid of FormHistory.shutdown. r=mak FormHistory.shutdown was called via FormHistoryStartup.js's profile-before-change observer to close the database synchronously. Now FormHistory uses AsyncShutdown and closes the database asynchronously, so FormHistory.shutdown is no longer required. MozReview-Commit-ID: Lok5vx1dOTW
toolkit/components/satchel/FormHistory.jsm
toolkit/components/satchel/FormHistoryStartup.js
--- a/toolkit/components/satchel/FormHistory.jsm
+++ b/toolkit/components/satchel/FormHistory.jsm
@@ -1503,14 +1503,12 @@ this.FormHistory = {
       handleResult(aBeginningCount) {
         expireOldEntriesDeletion(expireTime, aBeginningCount);
       },
       handleError(aError) {
         log("expireStartCountFailure");
       },
     });
   },
-
-  shutdown() { dbClose(true); },
 };
 
 // Prevent add-ons from redefining this API
 Object.freeze(FormHistory);
--- a/toolkit/components/satchel/FormHistoryStartup.js
+++ b/toolkit/components/satchel/FormHistoryStartup.js
@@ -25,19 +25,16 @@ FormHistoryStartup.prototype = {
     switch (topic) {
       case "nsPref:changed":
         FormHistory.updatePrefs();
         break;
       case "idle-daily":
       case "formhistory-expire-now":
         FormHistory.expireOldEntries();
         break;
-      case "profile-before-change":
-        FormHistory.shutdown();
-        break;
       case "profile-after-change":
         this.init();
         break;
     }
   },
 
   inited: false,
   pendingQuery: null,
@@ -46,17 +43,16 @@ FormHistoryStartup.prototype = {
     if (this.inited) {
       return;
     }
     this.inited = true;
 
     Services.prefs.addObserver("browser.formfill.", this, true);
 
     // triggers needed service cleanup and db shutdown
-    Services.obs.addObserver(this, "profile-before-change", true);
     Services.obs.addObserver(this, "idle-daily", true);
     Services.obs.addObserver(this, "formhistory-expire-now", true);
 
     Services.ppmm.loadProcessScript("chrome://satchel/content/formSubmitListener.js", true);
     Services.ppmm.addMessageListener("FormHistory:FormSubmitEntries", this);
 
     let messageManager = Cc["@mozilla.org/globalmessagemanager;1"]
                          .getService(Ci.nsIMessageListenerManager);