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

Unified Diff: base/message_loop/message_pump_android.cc

Issue 27518013: Fix content_browsertests on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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
Index: base/message_loop/message_pump_android.cc
diff --git a/base/message_loop/message_pump_android.cc b/base/message_loop/message_pump_android.cc
index f3f1c9bcb4d83bc0f5b94312f1ef64371a4617c7..fff1539044526fb3a0489c70f11a0b947f16bd6e 100644
--- a/base/message_loop/message_pump_android.cc
+++ b/base/message_loop/message_pump_android.cc
@@ -10,6 +10,7 @@
#include "base/android/scoped_java_ref.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
+#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/time/time.h"
#include "jni/SystemMessageHandler_jni.h"
@@ -21,7 +22,16 @@ 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, jint native_delegate) {
+static void DoRunLoopOnce(
+ JNIEnv* env,
+ jobject obj,
+ jint native_delegate,
+ jint native_message_loop) {
+ base::MessageLoop* message_loop =
+ reinterpret_cast<base::MessageLoop*>(native_message_loop);
+ if (message_loop != base::MessageLoop::current())
+ return;
+
base::MessagePump::Delegate* delegate =
reinterpret_cast<base::MessagePump::Delegate*>(native_delegate);
DCHECK(delegate);
@@ -81,7 +91,8 @@ void MessagePumpForUI::Start(Delegate* delegate) {
DCHECK(env);
system_message_handler_obj_.Reset(
- Java_SystemMessageHandler_create(env, reinterpret_cast<jint>(delegate)));
+ Java_SystemMessageHandler_create(env, reinterpret_cast<jint>(delegate),
+ reinterpret_cast<jint>(MessageLoop::current())));
}
void MessagePumpForUI::Quit() {

Powered by Google App Engine
This is Rietveld 408576698