Looping dev-b2g again. On 18/09/2013, at 13:18, smaug wrote:
> On 09/18/2013 05:29 AM, Kyle Huey wrote: >> On Tue, Sep 17, 2013 at 7:25 PM, smaug <[email protected] >> <mailto:[email protected]>> wrote: >> >> >> Summary: - We need to add message listeners only when they are >> actually needed. - For "one-shot" messages associated with specific >> requests, we >> should add weak message listeners. - For messages that should be >> listened during the lifetime of the window, we should add strong message >> listeners. >> >> ...or keep the listeners alive by some other mechanism. Like adding some >> expando property to the relevant window and keep listeners alive there. >> khueyfix should then kill those references when the window goes away, >> right khuey? >> >> >> I don't entirely understand what's going on here, but I don't think it will >> clean up completely. If we are listening to messages on some global thing >> through JS then we will cut the reference from the cross-compartment-wrapper >> to the objects in the window, but we will leave message listeners with >> dead wrappers in the message manager so over time it will slow down as the >> set of listeners continues to grow. >> >> - Kyle > > > message listeners would be weak, and message manager cleans up its > dead-weak-references list occasionally. Can you elaborate more on the "adding some expando property to the window" suggestion, please? I am obviously missing a lot of important background here, so forgive me in advance if my questions sounds too dumb. Looking at the code, it seems that we are cleaning up dead weak references at [1]. For what I understand from your previous comment, you are suggesting that we can avoid removing [1] the listeners that lives in a window (?) that has an specific expando property that we should have previously set. And we can rely on khueyfix getting rid of these references when this window goes away. Once the window goes away and khueyfix cleans up the references, the message manager will be able to remove the listeners, cause the window (and its expando property) won't be there anymore. Am I understanding this correctly? Thanks! / Fernando [1] https://mxr.mozilla.org/mozilla-central/source/content/base/src/nsFrameMessageManager.cpp#764 _______________________________________________ dev-b2g mailing list [email protected] https://lists.mozilla.org/listinfo/dev-b2g
