Closed Bug 574320 Opened 14 years ago Closed 14 years ago

Tweaks to compartments API

Categories

(Core :: JavaScript Engine, defect)

Other Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jorendorff, Unassigned)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

Here are the changes I want to make:

1. Move the AutoCrossCompartmentCall utility class from shell/js.cpp to jsapi.h, just like JSAutoRequest.

2. Change JS_SetGlobalObject to initialize both cx->globalObject and cx->compartment.

3. Don't check the compartments in JS_GetPrivate (because that API can be, and in some circumstances must be, used outside of a request).

In addition this patch tidies up shell/js.cpp and makes the shell workers in shell/jsworkers.cpp use the new compartment API.
Attached patch v1Splinter Review
Attachment #453701 - Flags: review?(gal)
Attachment #453701 - Flags: review?(gal) → review+
http://hg.mozilla.org/tracemonkey/rev/d7ad923b3ae6
Whiteboard: fixed-in-tracemonkey
Crash on startup without this. Also, I am not so sure any more SetGlobalObject is a good point to change cx->compartment. Why do we do that?

http://hg.mozilla.org/tracemonkey/rev/6cc02636c52a
http://hg.mozilla.org/mozilla-central/rev/d7ad923b3ae6
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: