summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android/jni/WebCoreFrameBridge.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-06-07 11:45:31 +0100
committerBen Murdoch <benm@google.com>2011-06-10 14:57:14 +0100
commit7d914f10c042bcd243dce3f7b5c26cc470c0f38f (patch)
tree06b8aeeaab89ca549965935462439a81cbdad5fc /Source/WebKit/android/jni/WebCoreFrameBridge.cpp
parentf729537b6d266be0c7b5ceca85a8089a9ee89da5 (diff)
downloadexternal_webkit-7d914f10c042bcd243dce3f7b5c26cc470c0f38f.zip
external_webkit-7d914f10c042bcd243dce3f7b5c26cc470c0f38f.tar.gz
external_webkit-7d914f10c042bcd243dce3f7b5c26cc470c0f38f.tar.bz2
Merge WebKit at r84325: Fix uses of JavaInstance.
The JavaInstance class is now an interface, so use the provided JavaInstanceJobject implementation instead. See http://trac.webkit.org/changeset/82950 Change-Id: I782e3887e4f059733fbc054ca1d9d97d94e817ef
Diffstat (limited to 'Source/WebKit/android/jni/WebCoreFrameBridge.cpp')
-rw-r--r--Source/WebKit/android/jni/WebCoreFrameBridge.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp
index 5f30ab4..cd9cdba 100644
--- a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp
+++ b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp
@@ -115,7 +115,7 @@
#include <runtime/JSLock.h>
#elif USE(V8)
#include "JavaNPObjectV8.h"
-#include "JavaInstanceV8.h"
+#include "JavaInstanceJobjectV8.h"
#include "V8Counters.h"
#endif // USE(JSC)
@@ -1733,7 +1733,11 @@ static jobject StringByEvaluatingJavaScriptFromString(JNIEnv *env, jobject obj,
// Wrap the JavaInstance used when binding custom javascript interfaces. Use a
// weak reference so that the gc can collect the WebView. Override virtualBegin
// and virtualEnd and swap the weak reference for the real object.
+#if USE(JSC)
class WeakJavaInstance : public JavaInstance {
+#elif USE(V8)
+class WeakJavaInstance : public JavaInstanceJobject {
+#endif
public:
#if USE(JSC)
static PassRefPtr<WeakJavaInstance> create(jobject obj, PassRefPtr<RootObject> root)
@@ -1753,7 +1757,7 @@ private:
: JavaInstance(instance, rootObject)
#elif USE(V8)
WeakJavaInstance(jobject instance)
- : JavaInstance(instance)
+ : JavaInstanceJobject(instance)
#endif
, m_beginEndDepth(0)
{
@@ -1777,7 +1781,7 @@ private:
env->DeleteWeakGlobalRef(weak);
}
- virtual void virtualBegin()
+ virtual void begin()
{
if (m_beginEndDepth++ > 0)
return;
@@ -1792,15 +1796,15 @@ private:
// Point to the real object
m_instance->setInstance(m_realObject);
// Call the base class method
- INHERITED::virtualBegin();
+ INHERITED::begin();
}
- virtual void virtualEnd()
+ virtual void end()
{
if (--m_beginEndDepth > 0)
return;
// Call the base class method first to pop the local frame.
- INHERITED::virtualEnd();
+ INHERITED::end();
// Get rid of the local reference to the real object.
getJNIEnv()->DeleteLocalRef(m_realObject);
// Point back to the WeakReference.
@@ -1808,7 +1812,11 @@ private:
}
private:
+#if USE(JSC)
typedef JavaInstance INHERITED;
+#elif USE(V8)
+ typedef JavaInstanceJobject INHERITED;
+#endif
jobject m_realObject;
jweak m_weakRef;
// The current depth of nested calls to virtualBegin and virtualEnd.