Closed Bug 647079 Opened 13 years ago Closed 5 years ago

Lazy-load message-listening objects

Categories

(Firefox for Android Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: azakai, Unassigned)

Details

(Keywords: perf)

Consider the OfflineApps object as an example of the issue here: We define it to be lazy-loaded, but then in UIReadyDelayed we set up to listen for a messageManager message, with OfflineApps. So OfflineApps gets loaded then. IOW we save loading it at startup, but we still do load it a little later, on the main thread, in UIReadyDelayed.

We can, instead, have a little helper that can be told to listen for a message, and to 'wake up' an object when that happens. So it would receive the string name of that object, and eval() it when it gets the message, then pass the message to it, and stop listening itself to that message. Basically like the wakeupService, which works for components, while this would be for objects in browser.js and so forth.
An ugly approach would be:

messageManager.addMessageListener("Browser:MozApplicationManifest", function(m) { OfflineApps.receiveMessage(m); } );

but we can do better
Closing all opened bug in a graveyard component
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.