Bug 1467452 - Back out f5f49315fec2 to restore getJavaEnv/getJavaPeer NPAPIs to fix Flash crash. r=jimm

Flash still calls these NPAPIs to initialize some ancient LiveConnect code.

--HG--
extra : rebase_source : 74a6a89e52595aa871d508bf13485b2ba7d404e8
This commit is contained in:
Chris Peterson 2018-06-20 12:42:39 -07:00
parent df59deb701
commit 634a84b050
3 changed files with 50 additions and 4 deletions

View File

@ -113,8 +113,8 @@ static NPNetscapeFuncs sBrowserFuncs = {
_memfree,
_memflush,
_reloadplugins,
nullptr, // _getJavaEnv, unimplemented
nullptr, // _getJavaPeer, unimplemented
_getJavaEnv,
_getJavaPeer,
_geturlnotify,
_posturlnotify,
_getvalue,
@ -1703,6 +1703,14 @@ _requestread(NPStream *pstream, NPByteRange *rangeList)
return NPERR_STREAM_NOT_SEEKABLE;
}
// Deprecated, only stubbed out
void* /* OJI type: JRIEnv* */
_getJavaEnv()
{
NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("NPN_GetJavaEnv\n"));
return nullptr;
}
const char *
_useragent(NPP npp)
{
@ -1736,6 +1744,14 @@ _memalloc (uint32_t size)
return moz_xmalloc(size);
}
// Deprecated, only stubbed out
void* /* OJI type: jref */
_getJavaPeer(NPP npp)
{
NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("NPN_GetJavaPeer: npp=%p\n", (void*)npp));
return nullptr;
}
void
_pushpopupsenabledstate(NPP npp, NPBool enabled)
{

View File

@ -279,6 +279,13 @@ _useragent(NPP npp);
void*
_memalloc (uint32_t size);
// Deprecated entry points for the old Java plugin.
void* /* OJI type: JRIEnv* */
_getJavaEnv();
void* /* OJI type: jref */
_getJavaPeer(NPP npp);
void
_urlredirectresponse(NPP instance, void* notifyData, NPBool allow);

View File

@ -875,6 +875,14 @@ _useragent(NPP aNPP);
static void*
_memalloc (uint32_t size);
// Deprecated entry points for the old Java plugin.
static void* /* OJI type: JRIEnv* */
_getjavaenv(void);
// Deprecated entry points for the old Java plugin.
static void* /* OJI type: jref */
_getjavapeer(NPP aNPP);
static bool
_invoke(NPP aNPP, NPObject* npobj, NPIdentifier method, const NPVariant *args,
uint32_t argCount, NPVariant *result);
@ -979,8 +987,8 @@ const NPNetscapeFuncs PluginModuleChild::sBrowserFuncs = {
mozilla::plugins::child::_memfree,
mozilla::plugins::child::_memflush,
mozilla::plugins::child::_reloadplugins,
nullptr, // _getjavaenv, unimplemented
nullptr, // _getjavapeer, unimplemented
mozilla::plugins::child::_getjavaenv,
mozilla::plugins::child::_getjavapeer,
mozilla::plugins::child::_geturlnotify,
mozilla::plugins::child::_posturlnotify,
mozilla::plugins::child::_getvalue,
@ -1296,6 +1304,21 @@ _memalloc(uint32_t aSize)
return moz_xmalloc(aSize);
}
// Deprecated entry points for the old Java plugin.
void* /* OJI type: JRIEnv* */
_getjavaenv(void)
{
PLUGIN_LOG_DEBUG_FUNCTION;
return 0;
}
void* /* OJI type: jref */
_getjavapeer(NPP aNPP)
{
PLUGIN_LOG_DEBUG_FUNCTION;
return 0;
}
bool
_invoke(NPP aNPP,
NPObject* aNPObj,