| Index: base/message_pump_libevent.h
|
| ===================================================================
|
| --- base/message_pump_libevent.h (revision 0)
|
| +++ base/message_pump_libevent.h (revision 0)
|
| @@ -0,0 +1,54 @@
|
| +// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef BASE_MESSAGE_PUMP_LIBEVENT_H_
|
| +#define BASE_MESSAGE_PUMP_LIBEVENT_H_
|
| +
|
| +#include "base/message_pump.h"
|
| +#include "base/time.h"
|
| +
|
| +// from libevent
|
| +struct event_base;
|
| +struct event;
|
| +
|
| +namespace base {
|
| +
|
| +class MessagePumpLibevent : public MessagePump {
|
| + public:
|
| + MessagePumpLibevent();
|
| + virtual ~MessagePumpLibevent();
|
| +
|
| + // MessagePump methods:
|
| + virtual void Run(Delegate* delegate);
|
| + virtual void Quit();
|
| + virtual void ScheduleWork();
|
| + virtual void ScheduleDelayedWork(const Time& delayed_work_time);
|
| +
|
| + struct event_base* getEventbase() { return evbase_; }
|
| +
|
| + private:
|
| + // This flag is set to false when Run should return.
|
| + bool keep_running_;
|
| +
|
| + // The time at which we should call DoDelayedWork.
|
| + Time delayed_work_time_;
|
| +
|
| + // Wakeup pipe to let other threads break us out of libevent loop.
|
| + int wakeup_pipe_gazinta_;
|
| + // need to fix friendship.
|
| +public:
|
| + int wakeup_pipe_gazouta_;
|
| +
|
| + // Libevent dispatcher
|
| + ::event_base *evbase_;
|
| +private:
|
| + struct event *wakeup_event_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(MessagePumpLibevent);
|
| +};
|
| +
|
| +} // namespace base
|
| +
|
| +#endif // BASE_MESSAGE_PUMP_LIBEVENT_H_
|
| +
|
|
|