forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnsJavaDOMImpl.h
108 lines (88 loc) · 2.41 KB
/
nsJavaDOMImpl.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#ifndef __nsJavaDOMImpl_h__
#define __nsJavaDOMImpl_h__
#include <jni.h>
#include "nsIJavaDOM.h"
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,
#ifdef NECKO
nsIChannel* channel,
nsresult aStatus,
#else
nsIURI* aURL,
PRInt32 aStatus,
#endif
nsIDocumentLoaderObserver* aObserver);
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader,
#ifdef NECKO
nsIChannel* channel,
#else
nsIURI* aURL,
const char* aContentType,
#endif
nsIContentViewer* aViewer);
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader,
#ifdef NECKO
nsIChannel* channel,
#else
nsIURI* aURL,
#endif
PRUint32 aProgress,
PRUint32 aProgressMax);
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader,
#ifdef NECKO
nsIChannel* channel,
#else
nsIURI* aURL,
#endif
nsString& aMsg);
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader,
#ifdef NECKO
nsIChannel* channel,
nsresult aStatus);
#else
nsIURI* aURL,
PRInt32 aStatus);
#endif
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader,
#ifdef NECKO
nsIChannel* channel,
#else
nsIURI* aURL,
#endif
const char *aContentType,
const char *aCommand);
private:
static JavaVM* jvm;
static JNIEnv* env;
static jclass factoryClass;
static jclass documentClass;
static jclass listenerClass;
static jclass gcClass;
static jobject factory;
static jobject docListener;
static jfieldID documentPtrFID;
static jmethodID getListenerMID;
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();
nsIDOMDocument* GetDocument(nsIDocumentLoader* loader);
jobject CaffienateDOMDocument(nsIDOMDocument* domDoc);
};
#endif /* __nsJavaDOMImpl_h__ */