Closed Bug 568885 Opened 14 years ago Closed 14 years ago

Put Cu.Sandbox globals in a separate compartment from non-sandbox objects in the same domain

Categories

(Core :: JavaScript Engine, defect)

Other Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jorendorff, Assigned: jorendorff)

References

Details

(Whiteboard: [fixed-in-tracemonkey])

Attachments

(1 file)

One result is that Greasemonkey scripts will be in a separate compartment from the Web pages they modify.

GM scripts already get XPCNWs of content objects. Putting GM in a separate compartment will mean separating them from content with a full membrane: content will get SJOWs of GM objects.
Blocks: 568886
Attached patch v1Splinter Review
Simple.

CompartmentChecker is not too happy about this because the existing wrappers don't update cx->compartment when moving across compartment boundaries. So once we land this, we can't do per-compartment heaps until after we enable the new wrapper implementations and make the compartment assertions happy again (in Nashville we decided not to do that in parallel after all, so it's ok).

Also: it will be hard for the RewrapObject (the XPConnect implementation of the new JSWrapObjectCallback we've added to the JSAPI) to avoid tripping those assertions. We may need to disable the assertions when that hook is being called. Dangerous. :-\
Assignee: general → jorendorff
Attachment #454306 - Flags: superreview?(mrbkap)
Attachment #454306 - Flags: review?(gal)
Attachment #454306 - Flags: superreview?(mrbkap) → superreview+
Reviewing now. Sorry for being slow.
Comment on attachment 454306 [details] [diff] [review]
v1

Looks good. Can't wait to test with it.
Attachment #454306 - Flags: review?(gal) → review+
http://hg.mozilla.org/tracemonkey/rev/4ae676e522f4
Whiteboard: [fixed-in-tracemonkey]
http://hg.mozilla.org/mozilla-central/rev/4ae676e522f4
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: