Bug 784759 - Move database creation out of startup on firstrun. r=mfinkle

This commit is contained in:
Wes Johnston 2012-11-05 17:14:20 -08:00
parent 8c976f0b41
commit a152ebf1a6

View File

@ -283,8 +283,18 @@ var BrowserApp = {
this.restoreSession(false, null);
}
if (updated)
this.onAppUpdated();
if (updated) {
// creating the form history and passwords databases can be expensive
// delay it until after the first page has loaded
let browser = BrowserApp.selectedTab.browser;
let updatedFun = function updatedFun() {
browser.removeEventListener("DOMContentLoaded", updatedFun, false);
// initialize the form history and passwords databases on upgrades
Services.obs.notifyObservers(null, "FormHistory:Init", "");
Services.obs.notifyObservers(null, "Passwords:Init", "");
}
browser.addEventListener("DOMContentLoaded", updatedFun, false);
}
// notify java that gecko has loaded
sendMessageToJava({
@ -487,12 +497,6 @@ var BrowserApp = {
});
},
onAppUpdated: function() {
// initialize the form history and passwords databases on upgrades
Services.obs.notifyObservers(null, "FormHistory:Init", "");
Services.obs.notifyObservers(null, "Passwords:Init", "");
},
shutdown: function shutdown() {
NativeWindow.uninit();
SelectionHandler.uninit();