mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 534944 - Avoid loading/importing weave files until necessary to speed up fennec startup
Have importing service.js trigger startup instead of only starting up from Weave.js, which now is used as a backup kickstarter. Only call import(service.js) when necessary from various Fennec files.
This commit is contained in:
parent
61a7c45b44
commit
30a5a5e095
@ -59,8 +59,13 @@ WeaveService.prototype = {
|
||||
break;
|
||||
|
||||
case "final-ui-startup":
|
||||
Cu.import("resource://weave/service.js");
|
||||
Weave.Service.onStartup();
|
||||
// Force Weave service to load if it hasn't triggered from overlays
|
||||
this.timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
this.timer.initWithCallback({
|
||||
notify: function() {
|
||||
Cu.import("resource://weave/service.js");
|
||||
}
|
||||
}, 10000, Ci.nsITimer.TYPE_ONE_SHOT);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -253,8 +253,6 @@ WeaveSvc.prototype = {
|
||||
while (enum.hasMoreElements())
|
||||
wait += enum.getNext().gBrowser.mTabs.length;
|
||||
break;
|
||||
case FENNEC_ID:
|
||||
wait = 10;
|
||||
}
|
||||
|
||||
// Make sure we wait a little but but not too long in the worst case
|
||||
@ -1523,3 +1521,6 @@ WeaveSvc.prototype = {
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
// Load Weave on the first time this file is loaded
|
||||
Weave.Service.onStartup();
|
||||
|
@ -795,6 +795,7 @@ let Utils = {
|
||||
|
||||
let Svc = {};
|
||||
Svc.Prefs = new Preferences(PREFS_BRANCH);
|
||||
Svc.Obs = Observers;
|
||||
[["Annos", "@mozilla.org/browser/annotation-service;1", "nsIAnnotationService"],
|
||||
["AppInfo", "@mozilla.org/xre/app-info;1", "nsIXULAppInfo"],
|
||||
["Bookmark", "@mozilla.org/browser/nav-bookmarks-service;1", "nsINavBookmarksService"],
|
||||
|
Loading…
Reference in New Issue
Block a user