Closed Bug 1357862 (same-compartment-realms) Opened 4 years ago Closed 2 years ago
[meta] Support multiple globals per compartment (same-compartment realms)
Currently a compartment contains exactly one realm (standard-ese for a global and all objects and code associated with it). An object in one realm cannot have a direct reference to an object in another realm. References across realm boundaries are represented as cross-compartment wrappers (CCWs). The cross-compartment wrapper overhead is sometimes bad, so we're planning to merge compartments that are in the same tab group and are same-origin. Objects in a page will tend to be same-compartment with those in child iframes. The new nesting will be runtimes > zone groups > zones > compartments > realms. In the new order, the main responsibility of compartments will be security. Security wrappers will continue to exist. Since only same-origin compartments are being merged, the only CCWs removed will be the transparent wrappers we currently insert at the boundary between same-origin compartments. This will mean changing the implementation and some Web-observable behavior of Window and Location objects and (especially) document.domain. Many things in various specs require there to be a "current global", so we'll continue to have a cx->global() that's non-null whenever JS could run. JSAutoCompartment will be changed to require a global, not just a JSCompartment*.
Summary: [meta] Support multiple globals per compartment → [meta] Support multiple globals per compartment (same-compartment realms)
Whiteboard: [qf:f61][qf:p1] → [qf:f64][qf:p1]
Assignee: nobody → jdemooij
Status: NEW → ASSIGNED
You need to log in before you can comment on or make changes to this bug.