blob: 4deaa2de0a55dbf9fa9b0f355ec3bd58029b1e6c [file] [log] [blame]
[email protected]f2ebbf062012-04-06 03:14:301// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]b2e97292008-09-02 18:20:342// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]59e69e742013-06-18 20:27:525#ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_DEFAULT_H_
6#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_DEFAULT_H_
[email protected]b2e97292008-09-02 18:20:347
[email protected]32857c02014-06-25 17:40:578#include "base/base_export.h"
avi9b6f42932015-12-26 22:15:149#include "base/macros.h"
[email protected]59e69e742013-06-18 20:27:5210#include "base/message_loop/message_pump.h"
[email protected]9bf0b362013-06-14 23:15:3211#include "base/synchronization/waitable_event.h"
[email protected]99084f62013-06-28 00:49:0712#include "base/time/time.h"
Robert Sesekd5ebd4b2017-09-22 23:09:0713#include "build/build_config.h"
[email protected]b2e97292008-09-02 18:20:3414
15namespace base {
16
[email protected]32857c02014-06-25 17:40:5717class BASE_EXPORT MessagePumpDefault : public MessagePump {
[email protected]b2e97292008-09-02 18:20:3418 public:
19 MessagePumpDefault();
dcheng56488182014-10-21 10:54:5120 ~MessagePumpDefault() override;
[email protected]b2e97292008-09-02 18:20:3421
22 // MessagePump methods:
dcheng56488182014-10-21 10:54:5123 void Run(Delegate* delegate) override;
24 void Quit() override;
25 void ScheduleWork() override;
26 void ScheduleDelayedWork(const TimeTicks& delayed_work_time) override;
Avi Drissman5b286372020-07-28 21:59:3827#if defined(OS_APPLE)
Robert Sesekd5ebd4b2017-09-22 23:09:0728 void SetTimerSlack(TimerSlack timer_slack) override;
29#endif
[email protected]b2e97292008-09-02 18:20:3430
31 private:
32 // This flag is set to false when Run should return.
33 bool keep_running_;
34
35 // Used to sleep until there is more work to do.
36 WaitableEvent event_;
37
[email protected]b2e97292008-09-02 18:20:3438 DISALLOW_COPY_AND_ASSIGN(MessagePumpDefault);
39};
40
41} // namespace base
42
danakj0a448602015-03-10 00:31:1643#endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_DEFAULT_H_