Closed Bug 976938 Opened 11 years ago Closed 11 years ago

Add a way to go from an Xray's method to the global of the underlying object

Categories

(Core :: XPConnect, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: bzbarsky, Assigned: bholley)

References

Details

Attachments

(1 file, 1 obsolete file)

This is needed for bug 976305.
Naming isn't great, but I really couldn't come up with something better.
Attachment #8383426 - Flags: review?(bzbarsky)
Comment on attachment 8383426 [details] [diff] [review] Add a way to identify the Xray parent (if any) of a given function. v1 > JS::Rooted<JSObject*> global(cx, JS_GetGlobalForObject(cx, wrapper)); This is unused after this patch. Nix it? >+XrayFunctionParentOrNull(JSObject *fun) In practice, what we will always want is the callee global, right? Would it make sense to just have an XrayAwareCalleeGlobal API that does that? If we do want the API that returns the Xray itself, I can live with this naming. Also, I really hope this method is reasonably fast, since we'll need to sprinkle it about. :(
Attachment #8383426 - Flags: review?(bzbarsky) → review+
Attachment #8383426 - Attachment is obsolete: true
Attachment #8384891 - Flags: review?(bzbarsky)
Comment on attachment 8384891 [details] [diff] [review] Add a way to identify the Xray parent (if any) of a given function. v2 We should document that the return value of XrayAwareCalleeGlobal may not be same-compartment with the argument, just to make it clear. r=me
Attachment #8384891 - Flags: review?(bzbarsky) → review+
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
Blocks: 976305
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: