Changes for lazy java initialization.

This commit is contained in:
warren%netscape.com 1998-09-01 00:16:08 +00:00
parent 677314c5c7
commit 4e6f663065
4 changed files with 16 additions and 24 deletions

View File

@ -653,13 +653,8 @@ BOOL fe_ShutdownJava()
BOOL bRetval = TRUE;
#if defined(OJI)
nsJVMMgr* jvmMgr = JVM_GetJVMMgr();
if (jvmMgr == NULL)
return FALSE;
bRetval = (jvmMgr->ShutdownJVM() == nsJVMStatus_Enabled);
// XXX suspend all java threads
jvmMgr->Release();
(void)JVM_ShutdownJVM();
// XXX set pCmdUI->Enable(FALSE);
#elif defined(JAVA)

View File

@ -2374,15 +2374,18 @@ void CGenericFrame::OnToggleJavaConsole()
void CGenericFrame::OnUpdateJavaConsole(CCmdUI* pCmdUI)
{
#ifdef OJI
if (JVM_IsJVMAvailable())
nsJVMStatus status = JVM_GetJVMStatus();
if (status != nsJVMStatus_Disabled && status != nsJVMStatus_Failed) {
pCmdUI->Enable(TRUE);
pCmdUI->SetCheck(JVM_IsConsoleVisible());
}
else
pCmdUI->Enable(FALSE);
#else
if (LJJavaStatus_Failed != LJ_GetJavaStatus()) {
pCmdUI->SetCheck( LJ_IsConsoleShowing() );
pCmdUI->SetCheck( LJ_IsConsoleShowing() );
} else {
pCmdUI->Enable(FALSE);
pCmdUI->Enable(FALSE);
}
#endif
}

View File

@ -586,6 +586,9 @@ LM_JamSourceIntoJSDebug( const char *filename,
#endif
extern JSContext*
LM_GetCrippledContext(void);
NSPR_END_EXTERN_C
#endif /* libmocha_h___ */

View File

@ -23,21 +23,12 @@
#ifndef _NP2_H
#define _NP2_H
#include "jni.h"
#include "prthread.h"
struct np_instance;
struct nsIPlugin;
struct nsIPluginInstance;
struct nsIPluginInstancePeer;
struct nsISupports;
PR_EXTERN(struct nsIPluginInstance*) NPL_GetOJIPluginInstance(NPEmbeddedApp *embed);
PR_EXTERN(const char *) NPL_GetText(struct nsIPluginInstance *);
PR_EXTERN(jobject) NPL_GetJavaObject(struct nsIPluginInstance *);
PR_EXTERN(void ) NPL_Release(struct nsISupports *);
PR_EXTERN(XP_Bool) NPL_IsJVMAndMochaPrefsEnabled(void);
PR_EXTERN(PRBool)NPL_JSJInit(void);
PR_EXTERN(JNIEnv *)NPL_EnsureJNIExecEnv(PRThread* thread);
#include "jni.h"
#include "lo_ele.h"
PR_EXTERN(const char *) NPL_GetText(LO_CommonPluginStruct* embed);
PR_EXTERN(jobject) NPL_GetJavaObject(LO_CommonPluginStruct* embed);
#endif /* _NP2_H */