Closed Bug 272294 Opened 20 years ago Closed 20 years ago

xpcshell needs to use loader-style backstage pass

Categories

(Core :: XPConnect, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: shaver, Assigned: shaver)

Details

Attachments

(1 file)

If using nested functions which are cloned in response to a callback (executed
on the JS Component manager's context, perhaps) try to access native properties,
they are currently rewarded with an NS_ERROR_FAILURE, because the "real"
security manager looks up the scope and finds nothing to tell it what the
principal is.

Please find attached (shortly) a patch to move the loader's BackstagePass into
the runtime service, and using it from xpcshell as well.
Attached patch As promised.Splinter Review
note bug 239969 - are both patches fixing the same problem?
I think they're trying to, yes, but I prefer this solution (which doesn't match
the summary of bug 239969) which makes the xpcshell context (nearly?) identical
to the JS component one.
Status: NEW → ASSIGNED
Attachment #167365 - Flags: review?(dbradley)
This now means that xpconnect requires DOM and DOM requires XPConnect. Is that
circular dependency going to cause a problem?
The circular dependency is not a problem, as long as we don't care about
standalone xpconnect, or have made special provisions for it.
I think the XPCONNECT_STANDALONE provisions in this patch are sufficient, but
I'll confess that I haven't tested them.  When someone cares enough to report
bugs against it, I'll care enough to fix them, promise!
Comment on attachment 167365 [details] [diff] [review]
As promised.

r=dbradley

I was looking to see if I could build standalone over the weekend. I know it
was broken a while back and couldn't remember if it was fixed. So if there are
any problems here, I imagine they're are not alone.

Things look good to me. Some standard xpconnect style nits, no space between
"if(" and such in xpcruntimesvc.cpp.
Attachment #167365 - Flags: review?(dbradley) → review+
Readable whitespace FIXED, as is this bug.  Thanks!
Status: ASSIGNED → RESOLVED
Closed: 20 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: