[M49_2623] Chromium upversion to m49_2623 branch.
[platform/framework/web/chromium-efl.git] / tizen_src / chromium_impl / base / message_loop / message_pump_ecore.h
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Copyright (c) 2014 Samsung Electronics. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5
6 #ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_EFL_H_
7 #define BASE_MESSAGE_LOOP_MESSAGE_PUMP_EFL_H_
8
9 #include "base/base_export.h"
10 #include "base/message_loop/message_pump.h"
11 #include "base/threading/non_thread_safe.h"
12
13 #include <Ecore.h>
14
15 namespace base {
16
17 class TimeTicks;
18
19 class BASE_EXPORT MessagePumpEcore : public MessagePump {
20  public:
21   MessagePumpEcore();
22   ~MessagePumpEcore() override;
23
24   void Run(Delegate* delegate) override;
25   void Quit() override;
26   void ScheduleWork() override;
27   void ScheduleDelayedWork(const TimeTicks& delayed_work_time) override;
28
29   void HandleScheduledWork();
30
31 private:
32   // We may make recursive calls to Run, so we save state that needs to be
33   // separate between them in this structure type.
34   struct RunState;
35   RunState* state_;
36
37   // This is the time when we need to do delayed work.
38   TimeTicks delayed_work_time_;
39
40   Ecore_Pipe* pipe_;
41   base::Lock schedule_work_lock_;
42   bool work_scheduled_;
43 };
44
45 }  // namespace base
46
47 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_EFL_H_