| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/message_loop/message_pump_android.h" | 5 #include "base/message_loop/message_pump_android.h" |
| 6 | 6 |
| 7 #include <jni.h> | 7 #include <jni.h> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 namespace base { | 56 namespace base { |
| 57 | 57 |
| 58 MessagePumpForUI::MessagePumpForUI() | 58 MessagePumpForUI::MessagePumpForUI() |
| 59 : run_loop_(NULL) { | 59 : run_loop_(NULL) { |
| 60 } | 60 } |
| 61 | 61 |
| 62 MessagePumpForUI::~MessagePumpForUI() { | 62 MessagePumpForUI::~MessagePumpForUI() { |
| 63 } | 63 } |
| 64 | 64 |
| 65 bool MessagePumpForUI::NeedsScheduleWorkPerTask() { |
| 66 return true; |
| 67 } |
| 68 |
| 65 void MessagePumpForUI::Run(Delegate* delegate) { | 69 void MessagePumpForUI::Run(Delegate* delegate) { |
| 66 NOTREACHED() << "UnitTests should rely on MessagePumpForUIStub in" | 70 NOTREACHED() << "UnitTests should rely on MessagePumpForUIStub in" |
| 67 " test_stub_android.h"; | 71 " test_stub_android.h"; |
| 68 } | 72 } |
| 69 | 73 |
| 70 void MessagePumpForUI::Start(Delegate* delegate) { | 74 void MessagePumpForUI::Start(Delegate* delegate) { |
| 71 run_loop_ = new RunLoop(); | 75 run_loop_ = new RunLoop(); |
| 72 // Since the RunLoop was just created above, BeforeRun should be guaranteed to | 76 // Since the RunLoop was just created above, BeforeRun should be guaranteed to |
| 73 // return true (it only returns false if the RunLoop has been Quit already). | 77 // return true (it only returns false if the RunLoop has been Quit already). |
| 74 if (!run_loop_->BeforeRun()) | 78 if (!run_loop_->BeforeRun()) |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 Java_SystemMessageHandler_setDelayedTimer(env, | 127 Java_SystemMessageHandler_setDelayedTimer(env, |
| 124 system_message_handler_obj_.obj(), millis); | 128 system_message_handler_obj_.obj(), millis); |
| 125 } | 129 } |
| 126 | 130 |
| 127 // static | 131 // static |
| 128 bool MessagePumpForUI::RegisterBindings(JNIEnv* env) { | 132 bool MessagePumpForUI::RegisterBindings(JNIEnv* env) { |
| 129 return RegisterNativesImpl(env); | 133 return RegisterNativesImpl(env); |
| 130 } | 134 } |
| 131 | 135 |
| 132 } // namespace base | 136 } // namespace base |
| OLD | NEW |