David Rajchenbach-Teller wrote:
On 12/20/12 7:27 AM, Ray You wrote:
How can we start a real thread in gecko using javascript and use XPCOM in it?
Is dispatching events to /nsIStreamTransportService/ or
/nsIThreadManager.newThread(0) /the right way?
I don't think this is supported anymore. As far as I can tell, if you truly
need to call XPCOM from JS in a background thread, you need to do the following:
- write extern "C" code that calls into XPCOM;
- launch a Chrome Worker from JS;
- link JS to your C shared lib through js-ctypes;
- call your C code from JS through js-ctypes.
IIRC XPCOM exposes a C-compatible API, but I don't want to be the person
who writes a wrapper for NS_InvokeByIndex ;-)
--
Warning: May contain traces of nuts.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform