diff options
author | torne <torne@chromium.org> | 2015-09-04 04:16:35 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-04 11:17:08 +0000 |
commit | 89cc5d913e36029273a916f27d154967af3900d6 (patch) | |
tree | f4deb74691a281a98f3065fe0c2e4d5868b6b213 /chromecast/android | |
parent | af43c88d506f641363b9d6a36a55bffbf2104003 (diff) | |
download | chromium_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 'chromecast/android')
-rw-r--r-- | chromecast/android/cast_metrics_helper_android.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/chromecast/android/cast_metrics_helper_android.cc b/chromecast/android/cast_metrics_helper_android.cc index 62530bd..439303f 100644 --- a/chromecast/android/cast_metrics_helper_android.cc +++ b/chromecast/android/cast_metrics_helper_android.cc @@ -14,11 +14,11 @@ bool CastMetricsHelperAndroid::RegisterJni(JNIEnv* env) { return RegisterNativesImpl(env); } -void LogMediaPlay(JNIEnv* env, jclass clazz) { +void LogMediaPlay(JNIEnv* env, const JavaParamRef<jclass>& clazz) { metrics::CastMetricsHelper::GetInstance()->LogMediaPlay(); } -void LogMediaPause(JNIEnv* env, jclass clazz) { +void LogMediaPause(JNIEnv* env, const JavaParamRef<jclass>& clazz) { metrics::CastMetricsHelper::GetInstance()->LogMediaPause(); } |