Open Bug 1631146 Opened 6 years ago Updated 3 years ago

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)

enhancement

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.

(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.

Severity: -- → normal
Type: defect → enhancement
Flags: needinfo?(enndeakin)

So far I know of:

But other callers of broadcastAsyncMessage might need something for this, or some broadcasting replacement.

Flags: needinfo?(enndeakin) → needinfo?(nika)

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?

Flags: needinfo?(nika)

Nika says she spoke with Neil and he will provide more information here.

Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.