divyang4481 / firebreath

Automatically exported from code.google.com/p/firebreath
0 stars 0 forks source link

Issues in Mac NPAPI model negotiation #53

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
NpapiPluginMac::NpapiPluginMac's current negotiation (as of today's source) has 
a few bugs:

1) It falls back to Carbon+CG if all negotiation fails, which is incorrect. Per 
<https://wiki.mozilla.org/NPAPI:Models>, the default is either QD+Carbon, or 
CG+Cocoa, depending on whether the plugin is 32-bit or 64-bit.

2) QuickDraw mode will fail in older browsers, since it only works if the 
browser supports both drawing model and event model negotiation. Sufficiently 
old browsers won't negotiate anything, and even currently shipping version of 
Firefox don't support model negotiation.

3) CG+Carbon mode assumes that Carbon is available, which doesn't allow for the 
possibility of browsers supporting new models but not Carbon. The negotiation 
code needs to distinguish between "asking about Carbon support and getting an 
error" (a browser that doesn't support negotiation, where Carbon is thus 
assumed), and "asking about Carbon support returned NPERR_NO_ERROR, and set the 
value to false" (a browser that has dropped Carbon support). (The same logic 
would apply to trying negotiate QuickDraw for issue 2).

Original issue reported on code.google.com by stuart.morgan on 13 Jul 2010 at 4:16

GoogleCodeExporter commented 8 years ago
Good comments, I'll get started on fixes.

Original comment by amack...@gmail.com on 13 Jul 2010 at 5:23

GoogleCodeExporter commented 8 years ago
Fixes have been committed, just need somebody to look them over and test.

Original comment by amack...@gmail.com on 15 Jul 2010 at 7:00

GoogleCodeExporter commented 8 years ago
Two minor things remaining:

1) Copy and paste error in the define being checked for Cocoa:
#if !FBMAC_USE_CARBON
        printf("Cocoa not supported\n");
        return false;
#else

2) Cocoa+CG should be preferred to Carbon+CG (i.e., tried first in the 
if/else-if cascade); the Cocoa event model is more consistent between browsers, 
is more efficient, and is better for out-of-process plugins.

Original comment by stuart.morgan on 16 Jul 2010 at 6:30