Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: base/message_pump_libevent.h

Issue 3202: Make tcp_client_socket_unittest pass on Linux.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/message_loop.cc ('k') | base/message_pump_libevent.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
+
« no previous file with comments | « base/message_loop.cc ('k') | base/message_pump_libevent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698