1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/ipc/chromium/src/base/message_pump_default.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,41 @@ 1.4 +// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1.5 +// Use of this source code is governed by a BSD-style license that can be 1.6 +// found in the LICENSE file. 1.7 + 1.8 +#ifndef BASE_MESSAGE_PUMP_DEFAULT_H_ 1.9 +#define BASE_MESSAGE_PUMP_DEFAULT_H_ 1.10 + 1.11 +#include "base/message_pump.h" 1.12 +#include "base/time.h" 1.13 +#include "base/waitable_event.h" 1.14 + 1.15 +namespace base { 1.16 + 1.17 +class MessagePumpDefault : public MessagePump { 1.18 + public: 1.19 + MessagePumpDefault(); 1.20 + ~MessagePumpDefault() {} 1.21 + 1.22 + // MessagePump methods: 1.23 + virtual void Run(Delegate* delegate); 1.24 + virtual void Quit(); 1.25 + virtual void ScheduleWork(); 1.26 + virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time); 1.27 + 1.28 + protected: 1.29 + // This flag is set to false when Run should return. 1.30 + bool keep_running_; 1.31 + 1.32 + // Used to sleep until there is more work to do. 1.33 + WaitableEvent event_; 1.34 + 1.35 + // The time at which we should call DoDelayedWork. 1.36 + TimeTicks delayed_work_time_; 1.37 + 1.38 + private: 1.39 + DISALLOW_COPY_AND_ASSIGN(MessagePumpDefault); 1.40 +}; 1.41 + 1.42 +} // namespace base 1.43 + 1.44 +#endif // BASE_MESSAGE_PUMP_DEFAULT_H_