michael@0: // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: michael@0: #ifndef BASE_MESSAGE_PUMP_DEFAULT_H_ michael@0: #define BASE_MESSAGE_PUMP_DEFAULT_H_ michael@0: michael@0: #include "base/message_pump.h" michael@0: #include "base/time.h" michael@0: #include "base/waitable_event.h" michael@0: michael@0: namespace base { michael@0: michael@0: class MessagePumpDefault : public MessagePump { michael@0: public: michael@0: MessagePumpDefault(); michael@0: ~MessagePumpDefault() {} michael@0: michael@0: // MessagePump methods: michael@0: virtual void Run(Delegate* delegate); michael@0: virtual void Quit(); michael@0: virtual void ScheduleWork(); michael@0: virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time); michael@0: michael@0: protected: michael@0: // This flag is set to false when Run should return. michael@0: bool keep_running_; michael@0: michael@0: // Used to sleep until there is more work to do. michael@0: WaitableEvent event_; michael@0: michael@0: // The time at which we should call DoDelayedWork. michael@0: TimeTicks delayed_work_time_; michael@0: michael@0: private: michael@0: DISALLOW_COPY_AND_ASSIGN(MessagePumpDefault); michael@0: }; michael@0: michael@0: } // namespace base michael@0: michael@0: #endif // BASE_MESSAGE_PUMP_DEFAULT_H_