views:

332

answers:

2

I have a custom OS X NPAPI plugin built as universal 32 bit bundle. It works fine under OS x 10.6 in Firefox. It also runs fine in Safari launched in 32 bit mode.

However, it silently fails in Safari launched in 64 bit mode. The 64 bit Safari runs 32 bit plugins in a separate process (WebKitPluginHost). Plugin log shows that the host starts the plugin, calls NP_Initialize, then NP_GetEntryPoints, then NPP_New, which successfully returns created instance. Typically, the next plugin method called would be NPP_SetWindow, however, host never calls it. Instead it silently quits in about 10 seconds after launch, with no messages or whatever. I managed to attach to the host process with GDB, but with no luck, it just notes that the process has finished normally.

I'd much appreciate any hint what I might have done wrong in the plugin, or a URL of open sourced NPAPI plugin which is known to work under WebKitPluginHost, or even a hint what would be the best way to debug this issue (building debug version of WebKit is a last resort, I've been there and now I need to find a solution a bit more quicker)

A: 

Building a fat version with a 64-bit segment in the binary would seem to be the most obvious thing to do first.

Azeem.Butt
This was not really possible because of 3rd party proprietary library, sorry for not mentioned that.
Alexey Naidyonov
+1  A: 

It appeared that WebKitPluginHost explicitly requires plugin to set NPPVpluginDrawingModel. Since the plugin was windowless I never bothered to do that, and it worked out fine.

Minus six hours of my life for digging that out :(

Alexey Naidyonov
Welcome to the club - at least you only needed 6 hours ;)
Georg Fritzsche
The reason for this is presumably that Safari doesn't support QD plugins OOP. If you don't negotiate a model in a 32-bit plugin, the default is QD.
smorgan