Background:

Message managers are used in JS code to communicate across potential
process layers. There are two kinds of message managers, (a) frame
message managers that correspond to windows and frames within those
windows, and (b) process message managers that correspond to specific
processes. Both kinds of message managers are organized in a hierarchy
where parent message managers broadcast messages across their
children.

Problem:

In the case of multiple content processes (e.g. on FxOS/B2G),
unintentional broadcasting is a serious performance and security
footgun. Most (some would argue all) chrome code should only ever
speak to specific frame and process message managers, and rarely
(never) have to use broadcasting. This is currently not the case,
however. We're going to fix offenders as we see them, but the fact
that so many places in the codebase got it wrong has prompted us to
make an API change.

Change:

In bug 776825, we're going to separate message managers into mere
senders and broadcasters. Broadcasters have a different API, so it
will be blatantly obvious when you're speaking to more than just one
frame or process. We have fixed all call points in Gecko, and we will
subsequently review every message broadcast as to whether using
specific message senders is more appropriate. Code that has been
written correctly should not be affected at all. This includes add-ons
that load frame scripts and communicate with them without using
broadcasting.


Let us know if you have any questions.

Philipp
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to