Bug 633942: Add debug logging for OOPP model negotiation. r=bsmedberg a=josh

This commit is contained in:
Josh Aas 2011-02-15 12:08:07 -05:00
Родитель 33fb9e97b2
Коммит 15148be395
3 изменённых файлов: 22 добавлений и 14 удалений

Просмотреть файл

@ -128,12 +128,16 @@ PluginInstanceChild::PluginInstanceChild(const NPPluginFuncs* aPluginIface)
#endif // OS_WIN
, mAsyncCallMutex("PluginInstanceChild::mAsyncCallMutex")
#if defined(OS_MACOSX)
#if defined(__i386__)
#if defined(NP_NO_CARBON)
, mEventModel(NPEventModelCocoa)
, mDrawingModel(NPDrawingModelCoreGraphics)
#else
, mEventModel(NPEventModelCarbon)
, mDrawingModel(NPDrawingModelQuickDraw)
#endif
, mShColorSpace(nsnull)
, mShContext(nsnull)
, mDrawingModel(NPDrawingModelCoreGraphics)
, mCurrentEvent(nsnull)
#endif
, mLayersRendering(false)
@ -476,25 +480,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 = drawingModel;
mDrawingModel = static_cast<NPDrawingModel>(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;
}

Просмотреть файл

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

Просмотреть файл

@ -1910,7 +1910,13 @@ PluginModuleChild::AnswerPPluginInstanceConstructor(PPluginInstanceChild* aActor
return false;
}
#if defined(XP_MACOSX) && defined(__i386__)
#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 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
@ -1925,6 +1931,7 @@ PluginModuleChild::AnswerPPluginInstanceConstructor(PPluginInstanceChild* aActor
// Fail to instantiate.
*rv = NPERR_MODULE_LOAD_FAILED_ERROR;
}
#endif
#endif
return true;