Bug 1140683: Fix async plugin init using null plugin funcs on MacOSX; r=jimm

This commit is contained in:
Aaron Klotz 2015-03-09 12:10:02 -06:00
parent bd9f68ac70
commit d55b7850b6

View File

@ -1544,6 +1544,8 @@ PluginModuleParent::DeallocPPluginInstanceParent(PPluginInstanceParent* aActor)
void
PluginModuleParent::SetPluginFuncs(NPPluginFuncs* aFuncs)
{
MOZ_ASSERT(aFuncs);
aFuncs->version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR;
aFuncs->javaClass = nullptr;
@ -2179,7 +2181,7 @@ PluginModuleParent::RecvNP_InitializeResult(const NPError& aError)
return true;
}
if (mIsStartingAsync) {
if (mIsStartingAsync && mNPPIface) {
SetPluginFuncs(mNPPIface);
InitAsyncSurrogates();
}
@ -2301,8 +2303,17 @@ PluginModuleParent::NP_GetEntryPoints(NPPluginFuncs* pFuncs, NPError* error)
*error = NPERR_NO_ERROR;
if (mIsStartingAsync && !IsChrome()) {
PluginAsyncSurrogate::NP_GetEntryPoints(pFuncs);
mNPPIface = pFuncs;
#if defined(XP_MACOSX)
if (mNPInitialized) {
SetPluginFuncs(pFuncs);
InitAsyncSurrogates();
} else {
PluginAsyncSurrogate::NP_GetEntryPoints(pFuncs);
}
#else
PluginAsyncSurrogate::NP_GetEntryPoints(pFuncs);
#endif
} else {
SetPluginFuncs(pFuncs);
}