Chromium Code Reviews| Index: base/message_loop/message_pump_android.h |
| diff --git a/base/message_loop/message_pump_android.h b/base/message_loop/message_pump_android.h |
| index 795bd5e79ee69569347d3c0c57522c3717c892ee..399cc12e1beecd3ec8c77da2a1f01a1cb55dd645 100644 |
| --- a/base/message_loop/message_pump_android.h |
| +++ b/base/message_loop/message_pump_android.h |
| @@ -15,8 +15,13 @@ |
| namespace base { |
| +namespace android { |
| +class JavaMessageHandlerFactory; |
| +} |
| + |
| class RunLoop; |
| class TimeTicks; |
| +class WaitableEvent; |
| // This class implements a MessagePump needed for TYPE_UI MessageLoops on |
| // OS_ANDROID platform. |
| @@ -31,12 +36,25 @@ class BASE_EXPORT MessagePumpForUI : public MessagePump { |
| void ScheduleDelayedWork(const TimeTicks& delayed_work_time) override; |
| virtual void Start(Delegate* delegate); |
| + void StartForUnitTest(Delegate* delegate, |
| + base::android::JavaMessageHandlerFactory* factory, |
| + WaitableEvent* test_done_event); |
| + |
| + // We call Abort when there is a pending JNI exception, meaning that the |
| + // current thread will crash when we return to Java. |
| + // We can't call any jni-methods before returning to Java as we would then |
|
nyquist
2016/08/18 15:50:02
Nit: JNI and missing period at end of sentence.
gsennton
2016/08/18 18:56:54
Done.
|
| + // cause a native crash (instead of the original Java crash) |
| + void Abort() { should_abort_ = true; } |
| + bool ShouldAbort() const { return should_abort_; } |
| static bool RegisterBindings(JNIEnv* env); |
| private: |
| + JNIEnv* StartInternal(); |
| + |
| RunLoop* run_loop_; |
| base::android::ScopedJavaGlobalRef<jobject> system_message_handler_obj_; |
| + bool should_abort_; |
| DISALLOW_COPY_AND_ASSIGN(MessagePumpForUI); |
| }; |