summaryrefslogtreecommitdiffstats
path: root/base/message_loop
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 /base/message_loop
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 'base/message_loop')
-rw-r--r--base/message_loop/message_pump_android.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/base/message_loop/message_pump_android.cc b/base/message_loop/message_pump_android.cc
index babd17b..a0eee12 100644
--- a/base/message_loop/message_pump_android.cc
+++ b/base/message_loop/message_pump_android.cc
@@ -21,8 +21,10 @@ using base::android::ScopedJavaLocalRef;
// ----------------------------------------------------------------------------
// This method can not move to anonymous namespace as it has been declared as
// 'static' in system_message_handler_jni.h.
-static void DoRunLoopOnce(JNIEnv* env, jobject obj, jlong native_delegate,
- jlong delayed_scheduled_time_ticks) {
+static void DoRunLoopOnce(JNIEnv* env,
+ const JavaParamRef<jobject>& obj,
+ jlong native_delegate,
+ jlong delayed_scheduled_time_ticks) {
base::MessagePump::Delegate* delegate =
reinterpret_cast<base::MessagePump::Delegate*>(native_delegate);
DCHECK(delegate);