Add a utility method to get all parent-side JSWindowActors of a given name and/or broadcast a message from them.
Categories
(Core :: DOM: Content Processes, enhancement, P3)
Tracking
()
People
(Reporter: enndeakin, Unassigned)
Details
Several JSWindowActor subclasses need to keep track of all the actors of a given name, and then broadcast messages to the child actors.
For example, see bug https://bugzilla.mozilla.org/show_bug.cgi?id=1614749.
Current places that use this do this manually, but it would good to not have to manually maintain the list of parent actors.
Comment 1•6 years ago
|
||
(In reply to Neil Deakin from comment #0)
Several JSWindowActor subclasses need to keep track of all the actors of a given name, and then broadcast messages to the child actors.
Neil, do you know of any other use cases that would use this method? If you do, please share and then needinfo Nika here.
Parent actors are not instantiated automatically until a child actor asks for one. So, IIUC, any manually-maintained list of parent actors might currently be incomplete.
| Reporter | ||
Comment 2•6 years ago
|
||
So far I know of:
- reader mode (bug 1591469)
- about tab:tabcrashed (bug 1614749)
- ContentSearchParent.jsm
But other callers of broadcastAsyncMessage might need something for this, or some broadcasting replacement.
Comment 3•6 years ago
|
||
Do these want to broadcast to every tab where the parent actor could exist, or just every actor where it already exists? Actors are generally created only when needed, so, for example, AboutTabCrashedParent won't exist until either it's looked up on the WindowGlobalParent, or it's sent a message by AboutTabCrashedChild, even if AboutTabCrashedChild is created immediately.
In terms of a broadcasting API, would you want something like "send a message to every X actor under a BrowsingContext", or something like "send a message to every X actor everywhere"?
For the second case, we'd probably want to put a limit so it can only be used with actors which have matches filters on them, to avoid instantiating a ton of extra actors, would that be good enough for your use case?
Comment 4•6 years ago
|
||
Nika says she spoke with Neil and he will provide more information here.
Updated•3 years ago
|
Description
•