Merge backout of bug 633942, a=josh

This commit is contained in:
Josh Aas 2011-02-15 13:30:42 -05:00
commit c3c6530c38
3 changed files with 14 additions and 22 deletions

View File

@ -128,16 +128,12 @@ PluginInstanceChild::PluginInstanceChild(const NPPluginFuncs* aPluginIface)
#endif // OS_WIN
, mAsyncCallMutex("PluginInstanceChild::mAsyncCallMutex")
#if defined(OS_MACOSX)
#if defined(NP_NO_CARBON)
, mEventModel(NPEventModelCocoa)
, mDrawingModel(NPDrawingModelCoreGraphics)
#else
#if defined(__i386__)
, mEventModel(NPEventModelCarbon)
, mDrawingModel(NPDrawingModelQuickDraw)
#endif
, mShColorSpace(nsnull)
, mShContext(nsnull)
, mDrawingModel(NPDrawingModelCoreGraphics)
, mCurrentEvent(nsnull)
#endif
, mLayersRendering(false)
@ -480,25 +476,25 @@ PluginInstanceChild::NPN_SetValue(NPPVariable aVar, void* aValue)
#ifdef XP_MACOSX
case NPPVpluginDrawingModel: {
NPError rv;
int drawingModel = (int16) (intptr_t) aValue;
NPError rv = NPERR_GENERIC_ERROR;
if (!CallNPN_SetValue_NPPVpluginDrawingModel(drawingModel, &rv))
return NPERR_GENERIC_ERROR;
mDrawingModel = static_cast<NPDrawingModel>(drawingModel);
mDrawingModel = drawingModel;
return rv;
}
case NPPVpluginEventModel: {
NPError rv;
int eventModel = (int16) (intptr_t) aValue;
NPError rv = NPERR_GENERIC_ERROR;
if (!CallNPN_SetValue_NPPVpluginEventModel(eventModel, &rv))
return NPERR_GENERIC_ERROR;
#if defined(__i386__)
mEventModel = static_cast<NPEventModel>(eventModel);
#endif
return rv;
}

View File

@ -390,10 +390,12 @@ private:
#endif // defined(OS_WIN)
#if defined(OS_MACOSX)
private:
#if defined(__i386__)
NPEventModel mEventModel;
NPDrawingModel mDrawingModel;
#endif
CGColorSpaceRef mShColorSpace;
CGContextRef mShContext;
int16_t mDrawingModel;
nsCARenderer mCARenderer;
public:
@ -401,8 +403,9 @@ public:
return mCurrentEvent;
}
#if defined(__i386__)
NPEventModel EventModel() { return mEventModel; }
NPDrawingModel DrawingModel() { return mDrawingModel; }
#endif
private:
const NPCocoaEvent *mCurrentEvent;

View File

@ -1910,13 +1910,7 @@ PluginModuleChild::AnswerPPluginInstanceConstructor(PPluginInstanceChild* aActor
return false;
}
#if defined(XP_MACOSX)
if (getenv("NPAPI_MODEL_DEBUG")) {
printf("OOP plugin negotiated NPAPI event model: %d\n", childInstance->EventModel());
printf("OOP plugin negotiated NPAPI drawing model: %d\n", childInstance->DrawingModel());
}
#if defined(__i386__)
#if defined(XP_MACOSX) && defined(__i386__)
// If an i386 Mac OS X plugin has selected the Carbon event model then
// we have to fail. We do not support putting Carbon event model plugins
// out of process. Note that Carbon is the default model so out of process
@ -1931,7 +1925,6 @@ PluginModuleChild::AnswerPPluginInstanceConstructor(PPluginInstanceChild* aActor
// Fail to instantiate.
*rv = NPERR_MODULE_LOAD_FAILED_ERROR;
}
#endif
#endif
return true;