Update V8 to version 4.7.42.
[chromium-blink-merge.git] / base / message_loop / message_pump_android.h
blobd48050d21d10aca84d08c7f685413750dd40aa84
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
3 // found in the LICENSE file.
5 #ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_ANDROID_H_
6 #define BASE_MESSAGE_LOOP_MESSAGE_PUMP_ANDROID_H_
8 #include <jni.h>
10 #include "base/android/scoped_java_ref.h"
11 #include "base/base_export.h"
12 #include "base/compiler_specific.h"
13 #include "base/message_loop/message_pump.h"
15 namespace base {
17 class RunLoop;
18 class TimeTicks;
20 // This class implements a MessagePump needed for TYPE_UI MessageLoops on
21 // OS_ANDROID platform.
22 class BASE_EXPORT MessagePumpForUI : public MessagePump {
23 public:
24 MessagePumpForUI();
25 ~MessagePumpForUI() override;
27 void Run(Delegate* delegate) override;
28 void Quit() override;
29 void ScheduleWork() override;
30 void ScheduleDelayedWork(const TimeTicks& delayed_work_time) override;
32 virtual void Start(Delegate* delegate);
34 static bool RegisterBindings(JNIEnv* env);
36 private:
37 RunLoop* run_loop_;
38 base::android::ScopedJavaGlobalRef<jobject> system_message_handler_obj_;
40 DISALLOW_COPY_AND_ASSIGN(MessagePumpForUI);
43 } // namespace base
45 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_ANDROID_H_