Closed Bug 970215 Opened 9 years ago Closed 8 years ago
delay setting all
Apps Launchable until webapps-registry-start
BrowserApp.startup loads Webapps.jsm in order to set DOMApplicationRegistry.allAppsLaunchable to true, which presumably entrains the significant amounts of work that Webapps.jsm does to initialize DOMApplicationRegistry. But DOMApplicationRegistry.allAppsLaunchable isn't needed on startup, so we should delay setting it until it's actually needed by doing it on webapps-registry-ready, which DOMApplicationRegistry will notify observers about right after it finishes initializing. Note that this is not specific to synthetic APKs, as both the old and new runtime implementations do this work on startup (the old implementation does it inside WebappsUI.init).
Here's a work-in-progress that doesn't quite work yet. This turns out to be a bit more complicated, because Webapps.js doesn't ensure Webapps.jsm is loaded before it sends it a message via the cross-process message manager. It relies on browser.js having loaded it at startup. So we still have to load Webapps.jsm early. But perhaps we can load it a bit later, on delayed startup.
Assignee: nobody → myk
Status: NEW → ASSIGNED
webapps-registry-ready -> webapps-registry-start in case something happens as soon as the registry is ready that needs the value of this flag. The perf difference should be negligible, as Webapps.jsm has already been read and evaluated by the time DOMApplicationRegistry notifies webapps-registry-start.
Depends on: 964510
Summary: delay setting allAppsLaunchable until webapps-registry-ready → delay setting allAppsLaunchable until webapps-registry-start
After puzzling over this a bit more, I don't think we can do it, or at least I can't figure out how, for the reason I mentioned in comment 1. So I'm going to resolve this bug WONTFIX.
Assignee: myk → nobody
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.