Closed Bug 881333 Opened 11 years ago Closed 11 years ago

Use accessor methods for cx->compartment and cx->runtime

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla24

People

(Reporter: bhackett1024, Unassigned)

References

Details

Attachments

(1 file)

Bug 875661, bug 875125, and other future work want ways to interact with the VM from off the main thread.  These will work by adding superclasses of JSContext that have fewer capabilities.  One problem though is that JSContext's first fields, as enshrined in jsfriendapi ContextFriendFields, are direct pointers to the context's compartment, zone and runtime.  It would be better if these were protected members, so that subclasses of ContextFriendFields could decide what functionality to expose from these in a threadsafe way.

The attached patch changes cx->compartment and cx->runtime into cx->compartment() and cx->runtime().  The only interesting bits are in jspubtd.h and jscntxt.h.
Attachment #760460 - Flags: review?(luke)
Attachment #760460 - Flags: review?(luke) → review+
https://hg.mozilla.org/mozilla-central/rev/21e3c2610814
https://hg.mozilla.org/mozilla-central/rev/b0afcbcafb72
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: