summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/WebCore/bridge/jni/v8/JavaNPObjectV8.cpp8
-rw-r--r--Source/WebKit/android/jni/WebCoreFrameBridge.cpp5
2 files changed, 7 insertions, 6 deletions
diff --git a/Source/WebCore/bridge/jni/v8/JavaNPObjectV8.cpp b/Source/WebCore/bridge/jni/v8/JavaNPObjectV8.cpp
index b86a090..b22d57f 100644
--- a/Source/WebCore/bridge/jni/v8/JavaNPObjectV8.cpp
+++ b/Source/WebCore/bridge/jni/v8/JavaNPObjectV8.cpp
@@ -137,8 +137,10 @@ bool JavaNPObjectInvoke(NPObject* obj, NPIdentifier identifier, const NPVariant*
break;
}
}
- if (!jMethod)
+ if (!jMethod) {
+ instance->end();
return false;
+ }
JavaValue* jArgs = new JavaValue[argCount];
for (unsigned int i = 0; i < argCount; i++)
@@ -181,8 +183,10 @@ bool JavaNPObjectGetProperty(NPObject* obj, NPIdentifier identifier, NPVariant*
instance->begin();
JavaField* field = instance->getClass()->fieldNamed(name);
free(name); // TODO: use NPN_MemFree
- if (!field)
+ if (!field) {
+ instance->end();
return false;
+ }
#if PLATFORM(ANDROID)
// JSC does not seem to support returning object properties so we emulate that
diff --git a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp
index c08e629..a059bbe 100644
--- a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp
+++ b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp
@@ -1799,10 +1799,7 @@ private:
}
~WeakJavaInstance()
{
- // TODO: Check whether it's OK for calls to begin() and end() to be unbalanced.
- // See b/5006441
- if (m_beginEndDepth)
- LOGW("Unbalanced calls to WeakJavaInstance::begin() / end()");
+ LOG_ASSERT(!m_beginEndDepth, "Unbalanced calls to WeakJavaInstance::begin() / end()");
JNIEnv* env = getJNIEnv();
// The JavaInstance destructor attempts to delete the global ref stored
// in m_instance. Since we replaced it in our constructor with a weak