Bug 544088 - Support Xt plugins OOP. r=karlt

This commit is contained in:
Martin Stransky
2012-08-01 16:34:08 -04:00
parent ab42ecf0e7
commit 9f2071c211
5 changed files with 173 additions and 17 deletions

View File

@@ -1094,7 +1094,19 @@ _getvalue(NPP aNPP,
*(NPBool*)aValue = value ? true : false;
return result;
}
#if defined(MOZ_WIDGET_GTK)
case NPNVxDisplay: {
if (aNPP) {
return InstCast(aNPP)->NPN_GetValue(aVariable, aValue);
}
else {
*(void **)aValue = xt_client_get_display();
}
return NPERR_NO_ERROR;
}
case NPNVxtAppContext:
return NPERR_GENERIC_ERROR;
#endif
default: {
if (aNPP) {
return InstCast(aNPP)->NPN_GetValue(aVariable, aValue);
@@ -1938,13 +1950,7 @@ PluginModuleChild::AllocPPluginInstance(const nsCString& aMimeType,
}
#endif
nsAutoPtr<PluginInstanceChild> childInstance(
new PluginInstanceChild(&mFunctions));
if (!childInstance->Initialize()) {
*rv = NPERR_GENERIC_ERROR;
return 0;
}
return childInstance.forget();
return new PluginInstanceChild(&mFunctions);
}
void
@@ -2037,6 +2043,8 @@ PluginModuleChild::AnswerPPluginInstanceConstructor(PPluginInstanceChild* aActor
return true;
}
childInstance->Initialize();
#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