ra=edburns

r=av
sr=waterson
author = Nikolay Igotti <inn@sparc.spb.su>
Changes are:
  - adding IID accessors to nsIJVMPlugin and nsIJVMConsole interface - I think
    better patch would  add accessors to the end of interface definition -
    to save binary compatibility with Java Plugin
 -  together with old way of obtaining of JVM service (GetFactory) use new way
    GetService - it's good anyway and shouldn't break Java Plugin

M modules/oji/public/nsIJVMPlugin.h
M modules/oji/public/nsIJVMConsole.h
M sun-java/stubs/include/jri_md.h
M modules/oji/src/nsJVMManager.cpp
This commit is contained in:
edburns%acm.org 2001-04-03 22:05:03 +00:00
parent 8e427dff2d
commit 5ff8275a2c
4 changed files with 32 additions and 20 deletions

View File

@ -35,6 +35,14 @@
#include "nsIJVMWindow.h"
#define NS_IJVMCONSOLE_IID \
{ /* fefaf860-6220-11d2-8164-006008119d7a */ \
0xfefaf860, \
0x6220, \
0x11d2, \
{0x81, 0x64, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
// JVM Console Interface
// This interface defines the API the browser needs to show and hide the JVM's
@ -42,7 +50,6 @@
class nsIJVMConsole : public nsIJVMWindow {
public:
NS_IMETHOD
Show(void) = 0;
@ -58,16 +65,9 @@ public:
NS_IMETHOD
Print(const char* msg, const char* encodingName = NULL) = 0;
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IJVMCONSOLE_IID)
};
#define NS_IJVMCONSOLE_IID \
{ /* fefaf860-6220-11d2-8164-006008119d7a */ \
0xfefaf860, \
0x6220, \
0x11d2, \
{0x81, 0x64, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIJVMConsole_h___ */

View File

@ -44,6 +44,15 @@ class nsISecureEnv;
*/
#define NS_JVM_MIME_TYPE "application/x-java-vm" // XXX "application/java" ?
#define NS_IJVMPLUGIN_IID \
{ /* da6f3bc0-a1bc-11d1-85b1-00805f0e4dfe */ \
0xda6f3bc0, \
0xa1bc, \
0x11d1, \
{0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
}
////////////////////////////////////////////////////////////////////////////////
// Java VM Plugin Interface
// This interface defines additional entry points that a plugin developer needs
@ -88,16 +97,9 @@ public:
NS_IMETHOD
UnwrapJavaWrapper(JNIEnv* jenv, jobject jobj, jint* obj) = 0;
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IJVMPLUGIN_IID)
};
#define NS_IJVMPLUGIN_IID \
{ /* da6f3bc0-a1bc-11d1-85b1-00805f0e4dfe */ \
0xda6f3bc0, \
0xa1bc, \
0x11d1, \
{0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
}
////////////////////////////////////////////////////////////////////////////////
#endif /* nsIJVMPlugin_h___ */

View File

@ -599,7 +599,17 @@ nsJVMManager::StartupJVM(void)
}
nsIPlugin* pluginFactory = NULL;
err = pluginHost->GetPluginFactory(NS_JVM_MIME_TYPE, &pluginFactory);
// this code is the correct way to obtain pluggable JVM
NS_WITH_SERVICE(nsIPlugin, f,
NS_INLINE_PLUGIN_CONTRACTID_PREFIX NS_JVM_MIME_TYPE,
&err);
if (NS_FAILED(err) || !f) {
err = pluginHost->GetPluginFactory(NS_JVM_MIME_TYPE, &pluginFactory);
}
else {
pluginFactory = f;
}
if (pluginFactory == NULL) {
fStatus = nsJVMStatus_Failed;

View File

@ -173,7 +173,7 @@ typedef struct _jobject *jref;
#endif
typedef unsigned char jbool;
typedef char jbyte;
/*** typedef signed char jbyte; ***/
#ifdef IS_64 /* XXX ok for alpha, but not right on all 64-bit architectures */
typedef unsigned int juint;
typedef int jint;
@ -197,7 +197,7 @@ typedef long jint;
#ifdef OSF1
/* long is default 64-bit on OSF1, -std1 does not allow long long */
typedef long jlong;
/*** typedef long jlong;***/
typedef unsigned long julong;
#define jlong_MAXINT 0x7fffffffffffffffL
#define jlong_MININT 0x8000000000000000L