Add a closure/data field to JS window actor
Categories
(Core :: DOM: Core & HTML, task, P3)
Tracking
()
People
(Reporter: mccr8, Unassigned)
Details
In bug 1586393, I'm reimplementing BrowserTestUtils.addContentEventListener using JS window actors. This API works by listening for a particular content event from a particular browsing context. It has to work even if the bc navigates across processes. My current fix is an unfortunate combination of window actors and message manager shared data.
My current approach essentially adds a window actor to every window, and then checks in the shared data to look up the data for the bc. Right now, all calls to BrowserTestUtils.addContentEventListener share a single window actor, but I could imagine having a single actor per call to addContentEventListener, which would let me use the window actor's code for listening to events instead of manually dealing with that.
If I had an actor for every addContentEventListener call, then I could eliminate the use of message manager shared data, but that would require something like sticking some data on the actor itself. So you'd specify a serializable data object when you create the actor, and then any instantiation of the actor would get that in some field it could check.
Anyways, just an idea.
Updated•3 years ago
|
Description
•