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
Родитель 53bb913470
Коммит dd70f1e76a
1 изменённых файлов: 12 добавлений и 8 удалений

Просмотреть файл

@ -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();