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

RESOLVED FIXED in mozilla24

Status

()

defect
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: bhackett, Unassigned)

Tracking

unspecified
mozilla24
x86
macOS
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Reporter

Description

6 years ago
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)

Updated

6 years ago
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: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.