Commit ff8c9f84 authored by Dmitry Rozhkov's avatar Dmitry Rozhkov Committed by chriadam

[loginmanager] Initialize nsLoginManager only after profile is accessible

At least since Gecko38 nsLoginManager tries to initialize storage is a
part of its initialization procedure. But the storage can't be
initialized until the user profile is available for a component.
It's a wrong assumption that the profile is available upon the
"app-startup" notification. In fact the availability of the profile
is announced with the "profile-after-change" notification.
parent 2fdd50ca
......@@ -25,7 +25,15 @@ EmbedLiteGlobalHelper.prototype = {
dump("EmbedLiteGlobalHelper app-startup\n");
Services.obs.addObserver(this, "invalidformsubmit", false);
Services.obs.addObserver(this, "xpcom-shutdown", false);
// Init LoginManager, not important for gecko > 32
Services.obs.addObserver(this, "profile-after-change", false);
break;
}
case "invalidformsubmit": {
dump("EmbedLiteGlobalHelper invalidformsubmit\n");
break;
}
case "profile-after-change": {
// Init LoginManager
try {
Cc["@mozilla.org/login-manager;1"].getService(Ci.nsILoginManager);
} catch (e) {
......@@ -33,10 +41,6 @@ EmbedLiteGlobalHelper.prototype = {
}
break;
}
case "invalidformsubmit": {
dump("EmbedLiteGlobalHelper invalidformsubmit\n");
break;
}
case "xpcom-shutdown": {
dump("EmbedLiteGlobalHelper xpcom-shutdown\n");
Services.obs.removeObserver(this, "invalidformsubmit", false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment