summaryrefslogtreecommitdiffstats
path: root/sync/android
diff options
context:
space:
mode:
authortorne <torne@chromium.org>2015-09-04 04:16:35 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-04 11:17:08 +0000
commit89cc5d913e36029273a916f27d154967af3900d6 (patch)
treef4deb74691a281a98f3065fe0c2e4d5868b6b213 /sync/android
parentaf43c88d506f641363b9d6a36a55bffbf2104003 (diff)
downloadchromium_src-89cc5d913e36029273a916f27d154967af3900d6.zip
chromium_src-89cc5d913e36029273a916f27d154967af3900d6.tar.gz
chromium_src-89cc5d913e36029273a916f27d154967af3900d6.tar.bz2
jni_generator: Pass object parameters as JavaParamRef.
Pass all object parameters to JNI functions in JavaParamRef<> wrappers. This new type behaves like ScopedJavaLocalRef, but does not free the local reference when it goes out of scope, since the JVM does not allow method parameters to be freed and this causes a warning. This CL only changes the implementation of the generator and the signatures of JNI functions which take JavaParamRef arguments; the minimum required to allow it to compile and work. An implicit cast from JavaParamRef<T> to T is defined, to allow function bodies to remain unaltered. These will be migrated over future CLs and the cast removed. BUG=506850 Review URL: https://codereview.chromium.org/1312153003 Cr-Commit-Position: refs/heads/master@{#347379}
Diffstat (limited to 'sync/android')
-rw-r--r--sync/android/model_type_helper.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sync/android/model_type_helper.cc b/sync/android/model_type_helper.cc
index 37650cb..64d808f 100644
--- a/sync/android/model_type_helper.cc
+++ b/sync/android/model_type_helper.cc
@@ -11,8 +11,10 @@
namespace syncer {
-static ScopedJavaLocalRef<jstring>
-ModelTypeToNotificationType(JNIEnv* env, jclass clazz, jint model_type_int) {
+static ScopedJavaLocalRef<jstring> ModelTypeToNotificationType(
+ JNIEnv* env,
+ const JavaParamRef<jclass>& clazz,
+ jint model_type_int) {
std::string model_type_string;
ModelType model_type = static_cast<ModelType>(model_type_int);
if (!RealModelTypeToNotificationType(model_type, &model_type_string)) {