Thanks for the prompt feedback, Olli!

On 17/09/2013, at 13:25, smaug wrote:

>> 
>> My proposal to change this is to add strong referenced message listeners in 
>> these cases. I would say that we could add strong references by default
>> for all message listeners added via initDOMRequestHelper() during the window 
>> init process
> We need to still make sure we then remove those listeners at some point, 
> unless it is ok to keep the objects alive as long as the message manager is 
> alive.

Well, we will be observing "inner-window-destroyed" in DOMRequestHelper to 
remove the associated listeners when the window is destroyed, but if I am not 
wrong the message manager is associated with the window (is that correct?), so 
yes, I guess the listeners should live as long as the message manager lives.

> , if we finally do what I proposed in 1.
>> 
>> 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.

Is that something that is already possible or planned?

Thanks!

/ Fernando

_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to