diff options
author | yfriedman <yfriedman@chromium.org> | 2015-08-10 06:27:07 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-10 13:27:52 +0000 |
commit | 87fe94b76553a4fa4415fb9b37476e56c1a0bbcc (patch) | |
tree | 2709129bea9f75fedb0642a25d60bedf5097a2e0 /content/app | |
parent | b9956635b170a47888665a9121bc289ee6e83106 (diff) | |
download | chromium_src-87fe94b76553a4fa4415fb9b37476e56c1a0bbcc.zip chromium_src-87fe94b76553a4fa4415fb9b37476e56c1a0bbcc.tar.gz chromium_src-87fe94b76553a4fa4415fb9b37476e56c1a0bbcc.tar.bz2 |
Fix a few CHECK_JNI failures.
Passed in jobjects should not be released.
Using ScopedLocalJavaRef(env, jobject) with a parameter passed in from
JNI adopts the jojbect from the param and incorrectly tries to release
it.
Review URL: https://codereview.chromium.org/1278823006
Cr-Commit-Position: refs/heads/master@{#342609}
Diffstat (limited to 'content/app')
-rw-r--r-- | content/app/android/child_process_service.cc | 8 | ||||
-rw-r--r-- | content/app/android/content_main.cc | 3 |
2 files changed, 5 insertions, 6 deletions
diff --git a/content/app/android/child_process_service.cc b/content/app/android/child_process_service.cc index c6301ae..d3e6a1b 100644 --- a/content/app/android/child_process_service.cc +++ b/content/app/android/child_process_service.cc @@ -133,11 +133,11 @@ class SurfaceTextureManagerImpl : public SurfaceTextureManager, // processes such as renderers, plugins, etc. void InternalInitChildProcess(JNIEnv* env, jclass clazz, - jobject context, jobject service_in, jint cpu_count, jlong cpu_features) { - base::android::ScopedJavaLocalRef<jobject> service(env, service_in); + base::android::ScopedJavaLocalRef<jobject> service( + env, env->NewLocalRef(service_in)); // Set the CPU properties. android_setCpu(cpu_count, cpu_features); @@ -160,12 +160,10 @@ void RegisterGlobalFileDescriptor(JNIEnv* env, void InitChildProcess(JNIEnv* env, jclass clazz, - jobject context, jobject service, jint cpu_count, jlong cpu_features) { - InternalInitChildProcess(env, clazz, context, service, cpu_count, - cpu_features); + InternalInitChildProcess(env, clazz, service, cpu_count, cpu_features); } void ExitChildProcess(JNIEnv* env, jclass clazz) { diff --git a/content/app/android/content_main.cc b/content/app/android/content_main.cc index f322017..13f20b6 100644 --- a/content/app/android/content_main.cc +++ b/content/app/android/content_main.cc @@ -29,7 +29,8 @@ LazyInstance<scoped_ptr<ContentMainDelegate> > g_content_main_delegate = } // namespace static void InitApplicationContext(JNIEnv* env, jclass clazz, jobject context) { - base::android::ScopedJavaLocalRef<jobject> scoped_context(env, context); + base::android::ScopedJavaLocalRef<jobject> scoped_context( + env, env->NewLocalRef(context)); base::android::InitApplicationContext(env, scoped_context); } |