Resurrect --disable-oji

Bug #197924 r=peterl sr=alecf
This commit is contained in:
seawood%netscape.com 2003-03-25 06:54:52 +00:00
parent b92a5778a0
commit d056fe18d0
29 changed files with 758 additions and 555 deletions

View File

@ -146,7 +146,11 @@ tier_9_dirs += \
$(NULL)
ifdef MOZ_OJI
tier_9_dirs += js/src/liveconnect
tier_9_dirs += \
js/src/liveconnect \
sun-java \
modules/oji \
$(NULL)
endif
ifdef MOZ_JSDEBUGGER
@ -171,7 +175,6 @@ tier_9_dirs += \
uriloader \
modules/libpref \
modules/libimg \
modules/oji \
caps \
rdf \
expat \
@ -191,7 +194,6 @@ tier_9_dirs += \
profile \
embedding \
editor \
sun-java \
themes \
$(NULL)

View File

@ -115,7 +115,7 @@ ClientWallet=1
CookieManagement=1
SingleSignon=1
MOZ_OJI=1
MOZ_OJI = @MOZ_OJI@
MOZ_POST_DSO_LIB_COMMAND = @MOZ_POST_DSO_LIB_COMMAND@
MOZ_POST_PROGRAM_COMMAND = @MOZ_POST_PROGRAM_COMMAND@

View File

@ -698,10 +698,6 @@ endif
DEFINES += -DOSTYPE=\"$(OS_CONFIG)\"
DEFINES += -DOSARCH=\"$(OS_ARCH)\"
ifdef MOZ_OJI
DEFINES += -DOJI
endif
# For profiling
ifdef ENABLE_EAZEL_PROFILER
ifndef INTERNAL_TOOLS

1078
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -3354,6 +3354,18 @@ MOZ_ARG_DISABLE_BOOL(jsd,
MOZ_JSDEBUGGER=1)
dnl ========================================================
dnl = Open JVM Interface (OJI) support
dnl ========================================================
MOZ_OJI=1
MOZ_ARG_DISABLE_BOOL(oji,
[ --disable-oji Disable Open JVM Integration support],
MOZ_OJI=,
MOZ_OJI=1)
if test -n "$MOZ_OJI"; then
AC_DEFINE(OJI)
fi
dnl ========================================================
dnl = This turns on xinerama support. We just can't use the
dnl = autodetection of the libraries since on Red Hat 7 linking with
@ -4824,6 +4836,7 @@ AC_SUBST(MOZ_DBGRINFO_MODULES)
AC_SUBST(MOZ_EXTENSIONS)
AC_SUBST(MOZ_IMG_DECODERS)
AC_SUBST(MOZ_JSDEBUGGER)
AC_SUBST(MOZ_OJI)
AC_SUBST(ENABLE_EAZEL_PROFILER)
AC_SUBST(EAZEL_PROFILER_CFLAGS)
AC_SUBST(EAZEL_PROFILER_LIBS)

View File

@ -122,6 +122,7 @@
#include "nsIPluginHost.h"
#include "nsPIPluginHost.h"
#ifdef OJI
// HTMLAppletElement helper includes
#include "nsIJVMManager.h"
@ -130,6 +131,7 @@
#include "nsILiveConnectManager.h"
#include "nsIJVMPluginInstance.h"
#endif
// HTMLOptionsCollection includes
#include "nsIDOMHTMLOptionElement.h"
@ -5731,13 +5733,16 @@ nsHTMLAppletElementSH::GetPluginJSObject(JSContext *cx, JSObject *obj,
JSObject **plugin_obj,
JSObject **plugin_proto)
{
#ifdef OJI
*plugin_obj = nsnull;
*plugin_proto = nsnull;
nsCOMPtr<nsIJVMManager> jvm(do_GetService(nsIJVMManager::GetCID()));
if (!jvm) {
#endif
return NS_OK;
#ifdef OJI
}
nsCOMPtr<nsIJVMPluginInstance> javaPluginInstance;
@ -5763,6 +5768,7 @@ nsHTMLAppletElementSH::GetPluginJSObject(JSContext *cx, JSObject *obj,
}
return manager->WrapJavaObject(cx, appletObject, plugin_obj);
#endif /* OJI */
}

View File

@ -65,7 +65,9 @@
#include "nsNetUtil.h"
#include "nsPluginArray.h"
#include "nsIPluginHost.h"
#ifdef OJI
#include "nsIJVMManager.h"
#endif
#include "nsContentCID.h"
// Interfaces Needed
@ -165,7 +167,9 @@ PRInt32 gTimeoutCnt = 0;
// CIDs
static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
#ifdef OJI
static NS_DEFINE_CID(kJVMServiceCID, NS_JVMMANAGER_CID);
#endif
static NS_DEFINE_CID(kHTTPHandlerCID, NS_HTTPPROTOCOLHANDLER_CID);
static NS_DEFINE_CID(kXULControllersCID, NS_XULCONTROLLERS_CID);
static NS_DEFINE_CID(kCharsetConverterManagerCID,
@ -5813,6 +5817,7 @@ NavigatorImpl::JavaEnabled(PRBool *aReturn)
nsresult rv = NS_OK;
*aReturn = PR_FALSE;
#ifdef OJI
// determine whether user has enabled java.
nsCOMPtr<nsIPrefBranch> prefBranch(gPrefBranch);
if (!prefBranch) {
@ -5838,7 +5843,7 @@ NavigatorImpl::JavaEnabled(PRBool *aReturn)
else {
*aReturn = PR_FALSE;
}
#endif
return rv;
}

View File

@ -84,8 +84,10 @@
#include "prlog.h"
#include "prthread.h"
#ifdef OJI
#include "nsIJVMManager.h"
#include "nsILiveConnectManager.h"
#endif
const size_t gStackSize = 8192;
@ -1250,6 +1252,7 @@ nsJSContext::InitializeLiveConnectClasses()
{
nsresult rv = NS_OK;
#ifdef OJI
nsCOMPtr<nsIJVMManager> jvmManager =
do_GetService(nsIJVMManager::GetCID(), &rv);
@ -1267,6 +1270,7 @@ nsJSContext::InitializeLiveConnectClasses()
}
}
}
#endif /* OJI */
// return all is well until things are stable.
return NS_OK;
@ -1713,6 +1717,7 @@ nsresult nsJSEnvironment::Init()
NS_WARNING("Failed to get XPConnect service!");
}
#ifdef OJI
// Initialize LiveConnect. XXXbe use contractid rather than GetCID
// NOTE: LiveConnect is optional so initialisation will still succeed
// even if the service is not present.
@ -1725,6 +1730,7 @@ nsresult nsJSEnvironment::Init()
PRBool started = PR_FALSE;
rv = manager->StartupLiveConnect(sRuntime, started);
}
#endif /* OJI */
isInitialized = NS_SUCCEEDED(rv);

View File

@ -62,7 +62,9 @@
#include "nsISupportsArray.h"
#include "plstr.h"
#include "nsILinkHandler.h"
#ifdef OJI
#include "nsIJVMPluginTagInfo.h"
#endif
#include "nsIWebShell.h"
#include "nsINameSpaceManager.h"
#include "nsIEventListener.h"
@ -148,6 +150,11 @@ static NS_DEFINE_CID(kRangeCID, NS_RANGE_CID);
#undef KeyPress
#endif
#ifdef XP_WIN
#include <wtypes.h>
#include <winuser.h>
#endif
// special class for handeling DOM context menu events
// because for some reason it starves other mouse events if implemented on the same class
class nsPluginDOMContextMenuListener : public nsIDOMContextMenuListener,
@ -171,7 +178,9 @@ public:
class nsPluginInstanceOwner : public nsIPluginInstanceOwner,
public nsIPluginTagInfo2,
#ifdef OJI
public nsIJVMPluginTagInfo,
#endif
public nsIEventListener,
public nsITimerCallback,
public nsIDOMMouseListener,
@ -253,6 +262,7 @@ public:
NS_IMETHOD GetUniqueID(PRUint32 *result);
#ifdef OJI
//nsIJVMPluginTagInfo interface
NS_IMETHOD GetCode(const char* *result);
@ -265,6 +275,8 @@ public:
NS_IMETHOD GetMayScript(PRBool *result);
#endif /* OJI */
/** nsIDOMMouseListener interfaces
* @see nsIDOMMouseListener
*/
@ -2243,7 +2255,9 @@ NS_INTERFACE_MAP_BEGIN(nsPluginInstanceOwner)
NS_INTERFACE_MAP_ENTRY(nsIPluginInstanceOwner)
NS_INTERFACE_MAP_ENTRY(nsIPluginTagInfo)
NS_INTERFACE_MAP_ENTRY(nsIPluginTagInfo2)
#ifdef OJI
NS_INTERFACE_MAP_ENTRY(nsIJVMPluginTagInfo)
#endif
NS_INTERFACE_MAP_ENTRY(nsIEventListener)
NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
NS_INTERFACE_MAP_ENTRY(nsIDOMMouseListener)
@ -2894,6 +2908,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetUniqueID(PRUint32 *result)
return NS_OK;
}
#ifdef OJI
NS_IMETHODIMP nsPluginInstanceOwner::GetCode(const char* *result)
{
nsresult rv;
@ -2954,6 +2969,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetMayScript(PRBool *result)
return NS_OK;
}
#endif /* OJI */
// Little helper function to resolve relative URL in
// |value| for certain inputs of |name|

View File

@ -62,7 +62,9 @@
#include "nsISupportsArray.h"
#include "plstr.h"
#include "nsILinkHandler.h"
#ifdef OJI
#include "nsIJVMPluginTagInfo.h"
#endif
#include "nsIWebShell.h"
#include "nsINameSpaceManager.h"
#include "nsIEventListener.h"
@ -148,6 +150,11 @@ static NS_DEFINE_CID(kRangeCID, NS_RANGE_CID);
#undef KeyPress
#endif
#ifdef XP_WIN
#include <wtypes.h>
#include <winuser.h>
#endif
// special class for handeling DOM context menu events
// because for some reason it starves other mouse events if implemented on the same class
class nsPluginDOMContextMenuListener : public nsIDOMContextMenuListener,
@ -171,7 +178,9 @@ public:
class nsPluginInstanceOwner : public nsIPluginInstanceOwner,
public nsIPluginTagInfo2,
#ifdef OJI
public nsIJVMPluginTagInfo,
#endif
public nsIEventListener,
public nsITimerCallback,
public nsIDOMMouseListener,
@ -253,6 +262,7 @@ public:
NS_IMETHOD GetUniqueID(PRUint32 *result);
#ifdef OJI
//nsIJVMPluginTagInfo interface
NS_IMETHOD GetCode(const char* *result);
@ -265,6 +275,8 @@ public:
NS_IMETHOD GetMayScript(PRBool *result);
#endif /* OJI */
/** nsIDOMMouseListener interfaces
* @see nsIDOMMouseListener
*/
@ -2243,7 +2255,9 @@ NS_INTERFACE_MAP_BEGIN(nsPluginInstanceOwner)
NS_INTERFACE_MAP_ENTRY(nsIPluginInstanceOwner)
NS_INTERFACE_MAP_ENTRY(nsIPluginTagInfo)
NS_INTERFACE_MAP_ENTRY(nsIPluginTagInfo2)
#ifdef OJI
NS_INTERFACE_MAP_ENTRY(nsIJVMPluginTagInfo)
#endif
NS_INTERFACE_MAP_ENTRY(nsIEventListener)
NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
NS_INTERFACE_MAP_ENTRY(nsIDOMMouseListener)
@ -2894,6 +2908,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetUniqueID(PRUint32 *result)
return NS_OK;
}
#ifdef OJI
NS_IMETHODIMP nsPluginInstanceOwner::GetCode(const char* *result)
{
nsresult rv;
@ -2954,6 +2969,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetMayScript(PRBool *result)
return NS_OK;
}
#endif /* OJI */
// Little helper function to resolve relative URL in
// |value| for certain inputs of |name|

View File

@ -26,7 +26,11 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = public src
DIRS = public
ifdef MOZ_OJI
DIRS += src
endif
include $(topsrcdir)/config/rules.mk

View File

@ -52,7 +52,6 @@ REQUIRES = xpcom \
intl \
$(NULL)
ifdef MOZ_OJI
LIBRARY_NAME = oji
EXPORT_LIBRARY = 1
ifeq ($(OS_ARCH),WINNT)
@ -81,7 +80,6 @@ EXPORTS = \
nsJVMPluginTagInfo.h \
$(NULL)
endif
EXTRA_DSO_LDOPTS = \
$(LIBS_DIR) \

View File

@ -38,7 +38,7 @@
/*
* npapi.h $Revision: 3.29 $
* npapi.h $Revision: 3.30 $
* Netscape client plug-in API spec
*/
@ -76,7 +76,9 @@
#ifndef NO_NSPR_10_SUPPORT
#define NO_NSPR_10_SUPPORT
#endif
#ifdef OJI
#include "jri.h" /* Java Runtime Interface */
#endif
#if defined (__OS2__ ) || defined (OS2)
# ifndef XP_OS2
@ -85,6 +87,7 @@
#endif /* __OS2__ */
#ifdef _WINDOWS
# include <windef.h>
# ifndef XP_WIN
# define XP_WIN 1
# endif /* XP_WIN */
@ -110,9 +113,12 @@
#include <Events.h>
#endif
#if defined(XP_UNIX) && defined(MOZ_X11)
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#if defined(XP_UNIX)
# include <stdio.h>
# if defined(MOZ_X11)
# include <X11/Xlib.h>
# include <X11/Xutil.h>
# endif
#endif
/*----------------------------------------------------------------------*/
@ -633,7 +639,9 @@ void NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint);
int16 NP_LOADDS NPP_HandleEvent(NPP instance, void* event);
void NP_LOADDS NPP_URLNotify(NPP instance, const char* url,
NPReason reason, void* notifyData);
#ifdef OJI
jref NP_LOADDS NPP_GetJavaClass(void);
#endif
NPError NP_LOADDS NPP_GetValue(NPP instance, NPPVariable variable, void *value);
NPError NP_LOADDS NPP_SetValue(NPP instance, NPNVariable variable, void *value);
@ -664,8 +672,10 @@ void* NP_LOADDS NPN_MemAlloc(uint32 size);
void NP_LOADDS NPN_MemFree(void* ptr);
uint32 NP_LOADDS NPN_MemFlush(uint32 size);
void NP_LOADDS NPN_ReloadPlugins(NPBool reloadPages);
#ifdef OJI
JRIEnv* NP_LOADDS NPN_GetJavaEnv(void);
jref NP_LOADDS NPN_GetJavaPeer(NPP instance);
#endif
NPError NP_LOADDS NPN_GetValue(NPP instance, NPNVariable variable, void *value);
NPError NP_LOADDS NPN_SetValue(NPP instance, NPPVariable variable, void *value);
void NP_LOADDS NPN_InvalidateRect(NPP instance, NPRect *invalidRect);

View File

@ -38,7 +38,7 @@
/*
* npupp.h $Revision: 3.12 $
* npupp.h $Revision: 3.13 $
* function call mecahnics needed by platform specific glue code.
*/
@ -58,7 +58,9 @@
#include "npapi.h"
#endif
#ifdef OJI
#include "jri.h"
#endif
/******************************************************************************************
plug-in function table macros
@ -930,6 +932,7 @@ typedef void (* NP_LOADDS NPN_ReloadPluginsUPP)(NPBool reloadPages);
#endif
#ifdef OJI
/* NPN_GetJavaEnv */
@ -982,6 +985,7 @@ typedef jref (* NP_LOADDS NPN_GetJavaPeerUPP)(NPP instance);
#endif
#endif /* OJI */
/* NPN_InvalidateRect */
@ -1089,7 +1093,9 @@ typedef struct _NPPluginFuncs {
NPP_PrintUPP print;
NPP_HandleEventUPP event;
NPP_URLNotifyUPP urlnotify;
#ifdef OJI
JRIGlobalRef javaClass;
#endif
NPP_GetValueUPP getvalue;
NPP_SetValueUPP setvalue;
} NPPluginFuncs;
@ -1109,8 +1115,10 @@ typedef struct _NPNetscapeFuncs {
NPN_MemFreeUPP memfree;
NPN_MemFlushUPP memflush;
NPN_ReloadPluginsUPP reloadplugins;
#ifdef OJI
NPN_GetJavaEnvUPP getJavaEnv;
NPN_GetJavaPeerUPP getJavaPeer;
#endif
NPN_GetURLNotifyUPP geturlnotify;
NPN_PostURLNotifyUPP posturlnotify;
NPN_GetValueUPP getvalue;

View File

@ -185,6 +185,7 @@ PR_BEGIN_EXTERN_C
static void* NP_EXPORT
_memalloc (uint32 size);
#ifdef OJI
static JRIEnv* NP_EXPORT
_getJavaEnv(void);
@ -197,6 +198,7 @@ PR_BEGIN_EXTERN_C
_getJavaClass(void* handle);
#endif
#endif /* OJI */
#if defined(XP_MAC) && !defined(powerc)
#pragma pointers_in_A0
@ -274,8 +276,10 @@ ns4xPlugin::CheckClassInitialized(void)
CALLBACKS.memfree = NewNPN_MemFreeProc(FP2TV(_memfree));
CALLBACKS.memflush = NewNPN_MemFlushProc(FP2TV(_memflush));
CALLBACKS.reloadplugins = NewNPN_ReloadPluginsProc(FP2TV(_reloadplugins));
#ifdef OJI
CALLBACKS.getJavaEnv = NewNPN_GetJavaEnvProc(FP2TV(_getJavaEnv));
CALLBACKS.getJavaPeer = NewNPN_GetJavaPeerProc(FP2TV(_getJavaPeer));
#endif
CALLBACKS.geturlnotify = NewNPN_GetURLNotifyProc(FP2TV(_geturlnotify));
CALLBACKS.posturlnotify = NewNPN_PostURLNotifyProc(FP2TV(_posturlnotify));
CALLBACKS.getvalue = NewNPN_GetValueProc(FP2TV(_getvalue));
@ -1457,12 +1461,14 @@ _requestread(NPStream *pstream, NPByteRange *rangeList)
#endif
////////////////////////////////////////////////////////////////////////
#ifdef OJI
JRIEnv* NP_EXPORT
_getJavaEnv(void)
{
NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("NPN_GetJavaEnv\n"));
return NULL;
}
#endif
////////////////////////////////////////////////////////////////////////
const char * NP_EXPORT
@ -1495,7 +1501,7 @@ _memalloc (uint32 size)
return gMalloc->Alloc(size);
}
#ifdef OJI
////////////////////////////////////////////////////////////////////////
java_lang_Class* NP_EXPORT
_getJavaClass(void* handle)
@ -1512,3 +1518,5 @@ _getJavaPeer(NPP npp)
NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("NPN_GetJavaPeer: npp=%p\n", (void*)npp));
return NULL;
}
#endif /* OJI */

View File

@ -56,7 +56,9 @@
#include "nsIScriptablePlugin.h"
#include "npupp.h"
#ifdef OJI
#include "jri.h"
#endif
#include "prlink.h" // for PRLibrary
#if defined (MOZ_WIDGET_GTK) || defined (MOZ_WIDGET_GTK2)

View File

@ -255,8 +255,10 @@ nsPluginDirServiceProvider::GetFile(const char *prop, PRBool *persistant, nsIFil
} else if (nsCRT::strcmp(prop, NS_WIN_JRE_SCAN_KEY) == 0) {
PRBool isJavaEnabled;
nsXPIDLCString strVer;
#ifdef OJI
if ((NS_FAILED(prefs->GetBoolPref("security.enable_java", &isJavaEnabled)) || !isJavaEnabled) ||
NS_FAILED(prefs->GetCharPref(prop, getter_Copies(strVer))))
#endif /* OJI */
return NS_ERROR_FAILURE;
verBlock minVer;
TranslateVersionStr(strVer.get(), &minVer);

View File

@ -47,8 +47,10 @@
#include "ns4xPlugin.h"
#include "nsPluginInstancePeer.h"
#include "nsIPlugin.h"
#ifdef OJI
#include "nsIJVMPlugin.h"
#include "nsIJVMManager.h"
#endif
#include "nsIPluginStreamListener.h"
#include "nsIHTTPHeaderListener.h"
#include "nsIHttpHeaderVisitor.h"
@ -3330,6 +3332,7 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateEmbededPlugin(const char *aMimeType,
if (tagType == nsPluginTagType_Applet ||
PL_strncasecmp(aMimeType, "application/x-java-vm", 21) == 0 ||
PL_strncasecmp(aMimeType, "application/x-java-applet", 25) == 0) {
#ifdef OJI
isJava = PR_TRUE;
nsCOMPtr<nsIPref> prefs(do_GetService(kPrefServiceCID));
// see if java is enabled
@ -3349,6 +3352,10 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateEmbededPlugin(const char *aMimeType,
isJavaEnabled = PR_TRUE;
}
}
#else
isJavaEnabled = PR_FALSE;
return NS_ERROR_FAILURE;
#endif
}
// Determine if the scheme of this URL is one we can handle internaly because we should
@ -3782,7 +3789,7 @@ NS_IMETHODIMP nsPluginHostImpl::TrySetUpPluginInstance(const char *aMimeType,
isJavaPlugin = PR_TRUE;
}
#if (defined(XP_UNIX) && !defined(XP_MACOSX)) || defined(XP_OS2)
#if defined(OJI) && ((defined(XP_UNIX) && !defined(XP_MACOSX)) || defined(XP_OS2))
// This is a work-around on Unix for a LiveConnect problem (bug 83698).
// The problem:
// The proxy JNI needs to be created by the browser. If it is created by
@ -4665,6 +4672,20 @@ static PRBool isUnwantedPlugin(nsPluginTag * tag)
return PR_TRUE;
}
////////////////////////////////////////////////////////////////////////
// XXX quick helper function to check for java plugin
static PRBool isUnwantedJavaPlugin(nsPluginTag * tag) {
#ifndef OJI
for (PRInt32 i = 0; i < tag->mVariants; ++i) {
if ((0 == PL_strncasecmp(tag->mMimeTypeArray[i], "application/x-java-vm", 21)) ||
(0 == PL_strncasecmp(tag->mMimeTypeArray[i], "application/x-java-applet", 25)) ||
(0 == PL_strncasecmp(tag->mMimeTypeArray[i], "application/x-java-bean", 23)))
return PR_TRUE;
}
#endif /* OJI */
return PR_FALSE;
}
nsPluginTag * nsPluginHostImpl::HaveSamePlugin(nsPluginTag * aPluginTag)
{
for(nsPluginTag* tag = mPlugins; tag; tag = tag->mNext) {
@ -4855,7 +4876,7 @@ nsresult nsPluginHostImpl::ScanPluginsDirectory(nsIFile * pluginsDir,
else {
// if it is unwanted plugin we are checking for, get it back to the cache info list
// if this is a duplicate plugin, too place it back in the cache info list marking unwantedness
if((checkForUnwantedPlugins && isUnwantedPlugin(pluginTag)) || IsDuplicatePlugin(pluginTag)) {
if((checkForUnwantedPlugins && isUnwantedPlugin(pluginTag)) || IsDuplicatePlugin(pluginTag) || isUnwantedJavaPlugin(pluginTag)) {
pluginTag->Mark(NS_PLUGIN_FLAG_UNWANTED);
pluginTag->mNext = mCachedPlugins;
mCachedPlugins = pluginTag;
@ -4917,7 +4938,7 @@ nsresult nsPluginHostImpl::ScanPluginsDirectory(nsIFile * pluginsDir,
// if this is unwanted plugin we are checkin for, or this is a duplicate plugin,
// add it to our cache info list so we can cache the unwantedness of this plugin
// when we sync cached plugins to registry
if((checkForUnwantedPlugins && isUnwantedPlugin(pluginTag)) || IsDuplicatePlugin(pluginTag)) {
if((checkForUnwantedPlugins && isUnwantedPlugin(pluginTag)) || IsDuplicatePlugin(pluginTag) || isUnwantedJavaPlugin(pluginTag)) {
pluginTag->Mark(NS_PLUGIN_FLAG_UNWANTED);
pluginTag->mNext = mCachedPlugins;
mCachedPlugins = pluginTag;
@ -4929,7 +4950,8 @@ nsresult nsPluginHostImpl::ScanPluginsDirectory(nsIFile * pluginsDir,
PRBool bAddIt = PR_TRUE;
// check if this is a specific plugin we don't want
if(checkForUnwantedPlugins && isUnwantedPlugin(pluginTag))
if((checkForUnwantedPlugins && isUnwantedPlugin(pluginTag)) ||
isUnwantedJavaPlugin(pluginTag))
bAddIt = PR_FALSE;
// check if we already have this plugin in the list which

View File

@ -46,7 +46,9 @@
#include "prprf.h"
#include "nsIFile.h"
#include "nsCOMPtr.h"
#ifdef OJI
#include "nsIJVMManager.h"
#endif
#include "nsIServiceManager.h"
#include "nsIDocument.h"
@ -82,7 +84,8 @@ nsPluginInstancePeerImpl::~nsPluginInstancePeerImpl()
static NS_DEFINE_IID(kIPluginTagInfoIID, NS_IPLUGINTAGINFO_IID);
static NS_DEFINE_IID(kIPluginTagInfo2IID, NS_IPLUGINTAGINFO2_IID);
static NS_DEFINE_IID(kIJVMPluginTagInfoIID, NS_IJVMPLUGINTAGINFO_IID);
#ifdef OJI
static NS_DEFINE_IID(kIJVMPluginTagInfoIID, NS_IJVMPLUGINTAGINFO_IID);
NS_IMPL_ISUPPORTS7(nsPluginInstancePeerImpl,
nsIPluginInstancePeer,
@ -92,6 +95,15 @@ NS_IMPL_ISUPPORTS7(nsPluginInstancePeerImpl,
nsIPluginTagInfo2,
nsIJVMPluginTagInfo,
nsPIPluginInstancePeer);
#else
NS_IMPL_ISUPPORTS6(nsPluginInstancePeerImpl,
nsIPluginInstancePeer,
nsIPluginInstancePeer2,
nsIWindowlessPluginInstancePeer,
nsIPluginTagInfo,
nsIPluginTagInfo2,
nsPIPluginInstancePeer);
#endif
NS_IMETHODIMP nsPluginInstancePeerImpl::GetValue(nsPluginInstancePeerVariable variable, void *value)
{
@ -596,6 +608,7 @@ NS_IMETHODIMP nsPluginInstancePeerImpl::GetUniqueID(PRUint32 *result)
NS_IMETHODIMP nsPluginInstancePeerImpl::GetCode(const char* *result)
{
#ifdef OJI
if (nsnull != mOwner) {
nsIJVMPluginTagInfo *tinfo;
nsresult rv;
@ -610,13 +623,17 @@ NS_IMETHODIMP nsPluginInstancePeerImpl::GetCode(const char* *result)
return rv;
}
else {
#endif
*result = 0;
return NS_ERROR_FAILURE;
#ifdef OJI
}
#endif
}
NS_IMETHODIMP nsPluginInstancePeerImpl::GetCodeBase(const char* *result)
{
#ifdef OJI
if (nsnull != mOwner) {
nsIJVMPluginTagInfo *tinfo;
nsresult rv;
@ -631,13 +648,17 @@ NS_IMETHODIMP nsPluginInstancePeerImpl::GetCodeBase(const char* *result)
return rv;
}
else {
#endif
*result = 0;
return NS_ERROR_FAILURE;
#ifdef OJI
}
#endif
}
NS_IMETHODIMP nsPluginInstancePeerImpl::GetArchive(const char* *result)
{
#ifdef OJI
if (nsnull != mOwner) {
nsIJVMPluginTagInfo *tinfo;
nsresult rv;
@ -652,13 +673,17 @@ NS_IMETHODIMP nsPluginInstancePeerImpl::GetArchive(const char* *result)
return rv;
}
else {
#endif
*result = 0;
return NS_ERROR_FAILURE;
#ifdef OJI
}
#endif
}
NS_IMETHODIMP nsPluginInstancePeerImpl::GetName(const char* *result)
{
#ifdef OJI
if (nsnull != mOwner) {
nsIJVMPluginTagInfo *tinfo;
nsresult rv;
@ -673,13 +698,17 @@ NS_IMETHODIMP nsPluginInstancePeerImpl::GetName(const char* *result)
return rv;
}
else {
#endif
*result = 0;
return NS_ERROR_FAILURE;
#ifdef OJI
}
#endif
}
NS_IMETHODIMP nsPluginInstancePeerImpl::GetMayScript(PRBool *result)
{
#ifdef OJI
if (nsnull != mOwner) {
nsIJVMPluginTagInfo *tinfo;
nsresult rv;
@ -694,9 +723,12 @@ NS_IMETHODIMP nsPluginInstancePeerImpl::GetMayScript(PRBool *result)
return rv;
}
else {
#endif
*result = 0;
return NS_ERROR_FAILURE;
#ifdef OJI
}
#endif
}
NS_IMETHODIMP nsPluginInstancePeerImpl::SetWindowSize(PRUint32 width, PRUint32 height)

View File

@ -42,13 +42,17 @@
#include "nsIWindowlessPlugInstPeer.h"
#include "nsIPluginTagInfo2.h"
#include "nsIPluginInstanceOwner.h"
#ifdef OJI
#include "nsIJVMPluginTagInfo.h"
#endif
#include "nsPIPluginInstancePeer.h"
class nsPluginInstancePeerImpl : public nsIPluginInstancePeer2,
public nsIWindowlessPluginInstancePeer,
public nsIPluginTagInfo2,
#ifdef OJI
public nsIJVMPluginTagInfo,
#endif
public nsPIPluginInstancePeer
{

View File

@ -83,11 +83,13 @@ NPP_Initialize(void)
return NPERR_NO_ERROR;
}
#ifdef OJI
jref
NPP_GetJavaClass()
{
return NULL;
}
#endif
void
NPP_Shutdown(void)

View File

@ -190,6 +190,7 @@ void NPN_ReloadPlugins(NPBool reloadPages)
CallNPN_ReloadPluginsProc(gNetscapeFuncs.reloadplugins, reloadPages);
}
#ifdef OJI
JRIEnv* NPN_GetJavaEnv()
{
return CallNPN_GetJavaEnvProc(gNetscapeFuncs.getJavaEnv);
@ -200,6 +201,7 @@ jref NPN_GetJavaPeer(NPP instance)
return CallNPN_GetJavaPeerProc(gNetscapeFuncs.getJavaPeer,
instance);
}
#endif
void
NPN_InvalidateRect(NPP instance, NPRect *invalidRect)
@ -324,6 +326,7 @@ Private_Print(NPP instance, NPPrint* platformPrint)
NPP_Print(instance, platformPrint);
}
#ifdef OJI
JRIGlobalRef
Private_GetJavaClass(void)
{
@ -334,6 +337,7 @@ Private_GetJavaClass(void)
}
return NULL;
}
#endif
/***********************************************************************
*
@ -436,8 +440,10 @@ NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs)
gNetscapeFuncs.memfree = nsTable->memfree;
gNetscapeFuncs.memflush = nsTable->memflush;
gNetscapeFuncs.reloadplugins = nsTable->reloadplugins;
#ifdef OJI
gNetscapeFuncs.getJavaEnv = nsTable->getJavaEnv;
gNetscapeFuncs.getJavaPeer = nsTable->getJavaPeer;
#endif
gNetscapeFuncs.getvalue = nsTable->getvalue;
/*
@ -459,7 +465,9 @@ NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs)
pluginFuncs->print = NewNPP_PrintProc(Private_Print);
pluginFuncs->urlnotify = NewNPP_URLNotifyProc(Private_URLNotify);
pluginFuncs->event = NULL;
#ifdef OJI
pluginFuncs->javaClass = Private_GetJavaClass();
#endif
err = NPP_Initialize();
}

View File

@ -37,6 +37,7 @@
#include <windows.h>
#include <windowsx.h>
#include <assert.h>
#include "resource.h"

View File

@ -36,6 +36,7 @@
* ***** END LICENSE BLOCK ***** */
#include <windows.h>
#include <assert.h>
#include "resource.h"
@ -321,7 +322,9 @@ void NP_LOADDS NPP_URLNotify(NPP pInstance, const char* url, NPReason reason, vo
pPlugin->URLNotify(url);
}
#ifdef OJI
jref NP_LOADDS NPP_GetJavaClass(void)
{
return NULL;
}
#endif

View File

@ -49,6 +49,7 @@
//\\// GLOBAL DATA
NPNetscapeFuncs* g_pNavigatorFuncs = 0;
#ifdef OJI
JRIGlobalRef Private_GetJavaClass(void);
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\.
@ -68,7 +69,7 @@ Private_GetJavaClass(void)
}
return NULL;
}
#endif /* OJI */
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\.
////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//.
// PLUGIN DLL entry points
@ -143,11 +144,11 @@ NP_Initialize(NPNetscapeFuncs* pFuncs)
if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) {
g_pluginFuncs->urlnotify = NPP_URLNotify;
}
#ifdef OJI
if( navMinorVers >= NPVERS_HAS_LIVECONNECT ) {
g_pluginFuncs->javaClass = Private_GetJavaClass();
}
#endif
// NPP_Initialize is a standard (cross-platform) initialize function.
return NPP_Initialize();
}
@ -336,7 +337,7 @@ void NPN_MemFree(void* ptr)
{
g_pNavigatorFuncs->memfree(ptr);
}
#ifdef OJI
/* private function to Netscape. do not use!
*/
void NPN_ReloadPlugins(NPBool reloadPages)
@ -353,4 +354,5 @@ jref NPN_GetJavaPeer(NPP instance)
{
return g_pNavigatorFuncs->getJavaPeer(instance);
}
#endif

View File

@ -37,6 +37,7 @@
#include <windows.h>
#include <windowsx.h>
#include <assert.h>
#include "resource.h"
@ -474,12 +475,16 @@ void CPlugin::showGetPluginDialog()
m_bOnline = !bOffline;
#ifdef OJI
if(m_bOnline && m_bJavaScript && m_bSmartUpdate && useDefaultURL_P())
{
JRIEnv *penv = NPN_GetJavaEnv();
m_bJava = (penv != NULL);
}
#else
m_bJava = FALSE;
#endif
dbgOut1("Environment:");
dbgOut2("%s", m_bOnline ? "On-line" : "Off-line");
dbgOut2("Java %s", m_bJava ? "Enabled" : "Disabled");

View File

@ -90,7 +90,9 @@ static NPError fillPluginFunctionTable(NPPluginFuncs* aNPPFuncs)
aNPPFuncs->getvalue = NPP_GetValue;
aNPPFuncs->setvalue = NPP_SetValue;
#endif
#ifdef OJI
aNPPFuncs->javaClass = NULL;
#endif
return NPERR_NO_ERROR;
}
@ -122,8 +124,10 @@ static NPError fillNetscapeFunctionTable(NPNetscapeFuncs* aNPNFuncs)
NPNFuncs.memfree = aNPNFuncs->memfree;
NPNFuncs.memflush = aNPNFuncs->memflush;
NPNFuncs.reloadplugins = aNPNFuncs->reloadplugins;
#ifdef OJI
NPNFuncs.getJavaEnv = aNPNFuncs->getJavaEnv;
NPNFuncs.getJavaPeer = aNPNFuncs->getJavaPeer;
#endif
NPNFuncs.getvalue = aNPNFuncs->getvalue;
NPNFuncs.setvalue = aNPNFuncs->setvalue;
NPNFuncs.invalidaterect = aNPNFuncs->invalidaterect;

View File

@ -171,6 +171,7 @@ void NPN_ReloadPlugins(NPBool reloadPages)
CallNPN_ReloadPluginsProc(NPNFuncs.reloadplugins, reloadPages);
}
#ifdef OJI
JRIEnv* NPN_GetJavaEnv(void)
{
JRIEnv * rv = NULL;
@ -184,6 +185,7 @@ jref NPN_GetJavaPeer(NPP instance)
rv = CallNPN_GetJavaPeerProc(NPNFuncs.getJavaPeer, instance);
return rv;
}
#endif
NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value)
{

View File

@ -257,10 +257,12 @@ int16 NPP_HandleEvent(NPP instance, void* event)
return rv;
}
#ifdef OJI
jref NPP_GetJavaClass (void)
{
return NULL;
}
#endif
/**************************************************/
/* */