Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2260)

Unified Diff: mojo/android/system/base_run_loop.cc

Issue 1312153003: jni_generator: Pass object parameters as JavaParamRef. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/android/javatests/validation_test_util.cc ('k') | mojo/android/system/core_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/android/system/base_run_loop.cc
diff --git a/mojo/android/system/base_run_loop.cc b/mojo/android/system/base_run_loop.cc
index 2bc2fb449f5688f90e6f4101b088b20d050b5658..df78561b27de3d8cb57de74d3b9a4278334976d8 100644
--- a/mojo/android/system/base_run_loop.cc
+++ b/mojo/android/system/base_run_loop.cc
@@ -17,21 +17,28 @@
namespace mojo {
namespace android {
-static jlong CreateBaseRunLoop(JNIEnv* env, jobject jcaller) {
+static jlong CreateBaseRunLoop(JNIEnv* env,
+ const JavaParamRef<jobject>& jcaller) {
base::MessageLoop* message_loop =
new base::MessageLoop(common::MessagePumpMojo::Create());
return reinterpret_cast<uintptr_t>(message_loop);
}
-static void Run(JNIEnv* env, jobject jcaller, jlong runLoopID) {
+static void Run(JNIEnv* env,
+ const JavaParamRef<jobject>& jcaller,
+ jlong runLoopID) {
reinterpret_cast<base::MessageLoop*>(runLoopID)->Run();
}
-static void RunUntilIdle(JNIEnv* env, jobject jcaller, jlong runLoopID) {
+static void RunUntilIdle(JNIEnv* env,
+ const JavaParamRef<jobject>& jcaller,
+ jlong runLoopID) {
reinterpret_cast<base::MessageLoop*>(runLoopID)->RunUntilIdle();
}
-static void Quit(JNIEnv* env, jobject jcaller, jlong runLoopID) {
+static void Quit(JNIEnv* env,
+ const JavaParamRef<jobject>& jcaller,
+ jlong runLoopID) {
reinterpret_cast<base::MessageLoop*>(runLoopID)->Quit();
}
@@ -42,9 +49,9 @@ static void RunJavaRunnable(
}
static void PostDelayedTask(JNIEnv* env,
- jobject jcaller,
+ const JavaParamRef<jobject>& jcaller,
jlong runLoopID,
- jobject runnable,
+ const JavaParamRef<jobject>& runnable,
jlong delay) {
base::android::ScopedJavaGlobalRef<jobject> runnable_ref;
// ScopedJavaGlobalRef do not hold onto the env reference, so it is safe to
@@ -56,7 +63,9 @@ static void PostDelayedTask(JNIEnv* env,
base::TimeDelta::FromMicroseconds(delay));
}
-static void DeleteMessageLoop(JNIEnv* env, jobject jcaller, jlong runLoopID) {
+static void DeleteMessageLoop(JNIEnv* env,
+ const JavaParamRef<jobject>& jcaller,
+ jlong runLoopID) {
base::MessageLoop* message_loop =
reinterpret_cast<base::MessageLoop*>(runLoopID);
delete message_loop;
« no previous file with comments | « mojo/android/javatests/validation_test_util.cc ('k') | mojo/android/system/core_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698