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
--- a/toolkit/components/satchel/FormHistory.jsm
+++ b/toolkit/components/satchel/FormHistory.jsm
@@ -1505,14 +1505,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);