mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-05 08:35:26 +00:00
da5218a6fc
JAVA_DOM_OJI_DISABLE check to JAVA_DOM_OJI_ENABLE not to affect unix builds.
89 lines
2.2 KiB
C++
89 lines
2.2 KiB
C++
#ifndef __nsJavaDOMImpl_h__
|
|
#define __nsJavaDOMImpl_h__
|
|
|
|
#include "jni.h"
|
|
#include "nsIJavaDOM.h"
|
|
#ifdef JAVA_DOM_OJI_ENABLE
|
|
#include "nsJVMManager.h"
|
|
#include "JavaDOMSecurityContext.h"
|
|
#endif
|
|
|
|
class nsIURI;
|
|
class nsIDOMDocument;
|
|
class nsIDocumentLoader;
|
|
|
|
class nsJavaDOMImpl : public nsIJavaDOM {
|
|
NS_DECL_ISUPPORTS
|
|
|
|
public:
|
|
nsJavaDOMImpl();
|
|
virtual ~nsJavaDOMImpl();
|
|
|
|
/* nsIDocumentLoaderObserver methods */
|
|
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader,
|
|
nsIURI* aURL,
|
|
const char* aCommand);
|
|
|
|
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader,
|
|
nsIChannel* channel,
|
|
nsresult aStatus);
|
|
|
|
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader,
|
|
nsIChannel* channel);
|
|
|
|
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader,
|
|
nsIChannel* channel,
|
|
PRUint32 aProgress,
|
|
PRUint32 aProgressMax);
|
|
|
|
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader,
|
|
nsIChannel* channel,
|
|
nsString& aMsg);
|
|
|
|
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader,
|
|
nsIChannel* channel,
|
|
nsresult aStatus);
|
|
|
|
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader,
|
|
nsIChannel* channel,
|
|
const char *aContentType,
|
|
const char *aCommand);
|
|
|
|
private:
|
|
#ifdef JAVA_DOM_OJI_ENABLE
|
|
static nsJVMManager* jvmManager;
|
|
static JavaDOMSecurityContext* securityContext;
|
|
#else
|
|
static JavaVM* jvm;
|
|
#endif
|
|
|
|
static jclass domAccessorClass;
|
|
static jclass documentClass;
|
|
static jclass listenerClass;
|
|
static jclass gcClass;
|
|
|
|
static jobject docListener;
|
|
|
|
static jfieldID documentPtrFID;
|
|
static jmethodID documentInitID;
|
|
|
|
static jmethodID getInstanceMID;
|
|
static jmethodID startURLLoadMID;
|
|
static jmethodID endURLLoadMID;
|
|
static jmethodID progressURLLoadMID;
|
|
static jmethodID statusURLLoadMID;
|
|
static jmethodID startDocumentLoadMID;
|
|
static jmethodID endDocumentLoadMID;
|
|
|
|
static jmethodID gcMID;
|
|
|
|
// cleanup after a JNI method invocation
|
|
static PRBool Cleanup(JNIEnv* env);
|
|
static JNIEnv* GetJNIEnv(void);
|
|
static void StartJVM(void);
|
|
nsIDOMDocument* GetDocument(nsIDocumentLoader* loader);
|
|
jobject CaffienateDOMDocument(nsIDOMDocument* domDoc);
|
|
};
|
|
|
|
#endif /* __nsJavaDOMImpl_h__ */
|