summaryrefslogtreecommitdiffstats
path: root/WebKit/android/jni
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-02-24 04:54:25 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-02-24 04:54:25 -0800
commit52df3a88ee4d2299c8e84771a803e75dbadc2e8e (patch)
tree9ee6ab49004c6bcb1c090bafcd6700bbf7e313cd /WebKit/android/jni
parent5fc48bced27265c28fa2eb1f6334028100e2e9a4 (diff)
parente5d2646223c750b4d6785d48b4b9026524e82324 (diff)
downloadexternal_webkit-52df3a88ee4d2299c8e84771a803e75dbadc2e8e.zip
external_webkit-52df3a88ee4d2299c8e84771a803e75dbadc2e8e.tar.gz
external_webkit-52df3a88ee4d2299c8e84771a803e75dbadc2e8e.tar.bz2
Merge "Copy constructor for AutoJObject must increase the ref count on the underlying object"
Diffstat (limited to 'WebKit/android/jni')
-rw-r--r--WebKit/android/jni/WebCoreJni.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/WebKit/android/jni/WebCoreJni.h b/WebKit/android/jni/WebCoreJni.h
index 6e6a486..ec25c8f 100644
--- a/WebKit/android/jni/WebCoreJni.h
+++ b/WebKit/android/jni/WebCoreJni.h
@@ -36,6 +36,9 @@ namespace android {
// returned from getRealObject.
class AutoJObject {
public:
+ AutoJObject(const AutoJObject& other)
+ : m_env(other.m_env)
+ , m_obj(other.m_obj ? other.m_env->NewLocalRef(other.m_obj) : NULL) {}
~AutoJObject() {
if (m_obj)
m_env->DeleteLocalRef(m_obj);
@@ -54,6 +57,7 @@ public:
return m_env;
}
private:
+ AutoJObject(); // Not permitted.
AutoJObject(JNIEnv* env, jobject obj)
: m_env(env)
, m_obj(obj) {}