[webkit-dev] Threading issues regarding Netscape API plugins in WebKit

Song Yuan song at yuan.se
Mon Oct 1 00:36:22 PDT 2007


Darin and Timothy, thanks a lot for your reply!

On 9/28/07, Darin Adler <darin at apple.com> wrote:
> On Sep 28, 2007, at 10:26 AM, Song Yuan wrote:
> > Does Netscape APIs in WebKit have similar APIs like
> > NPN_PluginThreadAsyncCall (refer to http://developer.mozilla.org/en/docs/NPN_PluginThreadAsyncCall)
> >  in Gecko SDK in Mozilla?
> >
> No.

That's bad news. Does WebKit have any plan to enclose support for such
APIs in future releases?

> Is this in shipping versions of Firefox? I had the impression this was
> just invented and was planned for a future version.

No, it's not shipped yet. You are right that it's only planned in
Gecko 1.9 with Firefox 3.0.

> > Will a new thread pawned from plugin main thread be able to invoke
> > any JavaScript methods in browser?
> >
>
> This may work, but has not been extensively tested. So it's probably
> not a good idea to use this in production code, but it's something you
> could experiment with.
>
> The JavaScript engine has support for use from multiple threads
> because of its use in proxy auto-configuration files.

OK.  Another question is whether JavaScript in WebKit can spawn new
threads and invoke scriptable APIs of plugin in different context. If
yes, that would achieve the same goal. JavaScript in Firefox can make
it by using XPCOM like "@mozilla.org/thread",
"@mozilla.org/event-queue-service", etc.

On 9/28/07, Timothy Hatcher <timothy at hatcher.name> wrote:
>
> WebKit does not implement NPN_PluginThreadAsyncCall. A
> plugin could spawn another thread, but it can not call JavaScript (or any
> other API call) from that other thread.

OK. That's definite answer.



More information about the webkit-dev mailing list