| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "mojo/android/system/base_run_loop.h" | 5 #include "mojo/android/system/base_run_loop.h" |
| 6 | 6 |
| 7 #include <jni.h> | 7 #include <jni.h> |
| 8 | 8 |
| 9 #include "base/android/base_jni_registrar.h" | 9 #include "base/android/base_jni_registrar.h" |
| 10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 static void RunUntilIdle(JNIEnv* env, | 33 static void RunUntilIdle(JNIEnv* env, |
| 34 const JavaParamRef<jobject>& jcaller, | 34 const JavaParamRef<jobject>& jcaller, |
| 35 jlong runLoopID) { | 35 jlong runLoopID) { |
| 36 reinterpret_cast<base::MessageLoop*>(runLoopID)->RunUntilIdle(); | 36 reinterpret_cast<base::MessageLoop*>(runLoopID)->RunUntilIdle(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 static void Quit(JNIEnv* env, | 39 static void Quit(JNIEnv* env, |
| 40 const JavaParamRef<jobject>& jcaller, | 40 const JavaParamRef<jobject>& jcaller, |
| 41 jlong runLoopID) { | 41 jlong runLoopID) { |
| 42 reinterpret_cast<base::MessageLoop*>(runLoopID)->Quit(); | 42 reinterpret_cast<base::MessageLoop*>(runLoopID)->QuitWhenIdle(); |
| 43 } | 43 } |
| 44 | 44 |
| 45 static void RunJavaRunnable( | 45 static void RunJavaRunnable( |
| 46 const base::android::ScopedJavaGlobalRef<jobject>& runnable_ref) { | 46 const base::android::ScopedJavaGlobalRef<jobject>& runnable_ref) { |
| 47 Java_BaseRunLoop_runRunnable(base::android::AttachCurrentThread(), | 47 Java_BaseRunLoop_runRunnable(base::android::AttachCurrentThread(), |
| 48 runnable_ref.obj()); | 48 runnable_ref.obj()); |
| 49 } | 49 } |
| 50 | 50 |
| 51 static void PostDelayedTask(JNIEnv* env, | 51 static void PostDelayedTask(JNIEnv* env, |
| 52 const JavaParamRef<jobject>& jcaller, | 52 const JavaParamRef<jobject>& jcaller, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 72 } | 72 } |
| 73 | 73 |
| 74 bool RegisterBaseRunLoop(JNIEnv* env) { | 74 bool RegisterBaseRunLoop(JNIEnv* env) { |
| 75 return RegisterNativesImpl(env); | 75 return RegisterNativesImpl(env); |
| 76 } | 76 } |
| 77 | 77 |
| 78 } // namespace android | 78 } // namespace android |
| 79 } // namespace mojo | 79 } // namespace mojo |
| 80 | 80 |
| 81 | 81 |
| OLD | NEW |