Chromium Code Reviews| Index: base/message_pump_android.cc |
| diff --git a/base/message_pump_android.cc b/base/message_pump_android.cc |
| index 2daf98db3157fa8ac9aed43ce34052745119836b..a99c2779901c9ad4aa33a74a72f076ea57bb3545 100644 |
| --- a/base/message_pump_android.cc |
| +++ b/base/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/run_loop.h" |
| #include "jni/system_message_handler_jni.h" |
| using base::android::ScopedJavaLocalRef; |
| @@ -61,7 +62,7 @@ static jboolean DoRunLoopOnce(JNIEnv* env, jobject obj, jint native_delegate) { |
| namespace base { |
| MessagePumpForUI::MessagePumpForUI() |
| - : state_(NULL) { |
| + : run_loop_(NULL) { |
| } |
| MessagePumpForUI::~MessagePumpForUI() { |
| @@ -73,7 +74,8 @@ void MessagePumpForUI::Run(Delegate* delegate) { |
| } |
| void MessagePumpForUI::Start(Delegate* delegate) { |
| - state_ = new MessageLoop::AutoRunState(MessageLoop::current()); |
| + run_loop_ = new base::RunLoop(); |
| + run_loop_->BeforeRun(); |
|
jar (doing other things)
2012/06/23 02:43:19
Do we need to check return value here?
jbates
2012/06/25 20:04:57
Done.
|
| DCHECK(g_system_message_handler_obj.Get().is_null()); |
| @@ -94,9 +96,10 @@ void MessagePumpForUI::Quit() { |
| g_system_message_handler_obj.Get().Reset(); |
| } |
| - if (state_) { |
| - delete state_; |
| - state_ = NULL; |
| + if (run_loop_) { |
| + run_loop_->AfterRun(); |
| + delete run_loop_; |
| + run_loop_ = NULL; |
| } |
| } |