On Aug 20, 10:22 am, Antoine Junod <[EMAIL PROTECTED]> wrote:
> I'm writing an XPCOM component in C++. It's using js callbacks defined
> as follow in an idl file:
>
> [scriptable, uuid(...)]
> interface JSCallback : nsISupports

for everyone's sanity, please don't violate namespaces.

JS* is owned by spidermonkey that means that JS* should generally
speaking be a public C struct defined by spidermonkey.

Foo* is generally, in gecko, a private class (not an interface)

blahIBar* is generally, in gecko, a Barish interface of the blah
module. You may pick blah and Bar freely as long as you don't step on
someone else's toes. If you aren't gecko, then using blah=ns is
frowned upon.

I'd also encourage you to treat "call" as a reserved word. It's way
too confusing having a function named "call" which is not the ECMA
call method.

> In the C++ code, I'm using them as follow:
>
> My problem is that I also have to trig those callbacks in other
> threads, created by a third party dll that I'm also using
> successfully. Those calls end up in the following js error:
>
> Error: [Exception... "'Permission denied to get property Function.__parent__' 
> when calling method: [JSCallback::call]"  nsresult: "0x8057001e 
> (NS_ERROR_XPC_JS_THREW_STRING)"  location: "<unknown>"  data: no]

the JavaScript security model relies on stack walking to understand if
something is safe. I'd punt and wait for bz to comment. But I'd
request that you fix the things I've highlighted and confirm that it
doesn't fix the problem.

_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to