summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortorne <torne@chromium.org>2015-09-04 06:57:12 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-04 13:57:48 +0000
commit9d46f6be2e866a727a83da5096cca87ee722532d (patch)
tree2dec3c2aa32bfa5e308694c3620f1b83c7d0a5bc
parent753ecf6e4b230ee714ed4f9b78f55cb34acaa899 (diff)
downloadchromium_src-9d46f6be2e866a727a83da5096cca87ee722532d.zip
chromium_src-9d46f6be2e866a727a83da5096cca87ee722532d.tar.gz
chromium_src-9d46f6be2e866a727a83da5096cca87ee722532d.tar.bz2
jni: Remove no-longer-needed calls to NewLocalRef.
We no longer need to explicitly create new local references to put into ScopedJavaLocalRef to avoid JNI warnings; we can just pass JavaParamRefs around safely now. Remove temporary fixes added in https://codereview.chromium.org/1278823006 and do that instead. BUG=506850 Review URL: https://codereview.chromium.org/1324453006 Cr-Commit-Position: refs/heads/master@{#347396}
-rw-r--r--content/app/android/child_process_service.cc10
-rw-r--r--content/app/android/content_main.cc4
-rw-r--r--testing/android/native_test/native_test_launcher.cc4
3 files changed, 5 insertions, 13 deletions
diff --git a/content/app/android/child_process_service.cc b/content/app/android/child_process_service.cc
index 68bf0c0..2ac9ef4c 100644
--- a/content/app/android/child_process_service.cc
+++ b/content/app/android/child_process_service.cc
@@ -38,7 +38,7 @@ class SurfaceTextureManagerImpl : public SurfaceTextureManager,
// |service| is the instance of
// org.chromium.content.app.ChildProcessService.
explicit SurfaceTextureManagerImpl(
- const base::android::ScopedJavaLocalRef<jobject>& service)
+ const base::android::JavaRef<jobject>& service)
: service_(service) {
SurfaceTexturePeer::InitInstance(this);
GpuSurfaceLookup::InitInstance(this);
@@ -132,13 +132,9 @@ class SurfaceTextureManagerImpl : public SurfaceTextureManager,
// Chrome actually uses the renderer code path for all of its child
// processes such as renderers, plugins, etc.
void InternalInitChildProcess(JNIEnv* env,
- jclass clazz,
- jobject service_in,
+ const JavaParamRef<jobject>& service,
jint cpu_count,
jlong cpu_features) {
- base::android::ScopedJavaLocalRef<jobject> service(
- env, env->NewLocalRef(service_in));
-
// Set the CPU properties.
android_setCpu(cpu_count, cpu_features);
SurfaceTextureManager::SetInstance(new SurfaceTextureManagerImpl(service));
@@ -163,7 +159,7 @@ void InitChildProcess(JNIEnv* env,
const JavaParamRef<jobject>& service,
jint cpu_count,
jlong cpu_features) {
- InternalInitChildProcess(env, clazz, service, cpu_count, cpu_features);
+ InternalInitChildProcess(env, service, cpu_count, cpu_features);
}
void ExitChildProcess(JNIEnv* env, const JavaParamRef<jclass>& clazz) {
diff --git a/content/app/android/content_main.cc b/content/app/android/content_main.cc
index 986474f..74f6783 100644
--- a/content/app/android/content_main.cc
+++ b/content/app/android/content_main.cc
@@ -31,9 +31,7 @@ LazyInstance<scoped_ptr<ContentMainDelegate> > g_content_main_delegate =
static void InitApplicationContext(JNIEnv* env,
const JavaParamRef<jclass>& clazz,
const JavaParamRef<jobject>& context) {
- base::android::ScopedJavaLocalRef<jobject> scoped_context(
- env, env->NewLocalRef(context));
- base::android::InitApplicationContext(env, scoped_context);
+ base::android::InitApplicationContext(env, context);
}
static jint Start(JNIEnv* env, const JavaParamRef<jclass>& clazz) {
diff --git a/testing/android/native_test/native_test_launcher.cc b/testing/android/native_test/native_test_launcher.cc
index 52b419d..ae24e3f 100644
--- a/testing/android/native_test/native_test_launcher.cc
+++ b/testing/android/native_test/native_test_launcher.cc
@@ -81,9 +81,7 @@ static void RunTests(JNIEnv* env,
base::CommandLine::Init(arraysize(kInitialArgv), kInitialArgv);
// Set the application context in base.
- base::android::ScopedJavaLocalRef<jobject> scoped_context(
- env, env->NewLocalRef(app_context));
- base::android::InitApplicationContext(env, scoped_context);
+ base::android::InitApplicationContext(env, app_context);
base::android::RegisterJni(env);
std::vector<std::string> args;