Index: ui/wayland/wayland_message_pump.h |
diff --git a/ui/wayland/wayland_message_pump.h b/ui/wayland/wayland_message_pump.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7ee40bd0071a5376daf8a9e8ae6397a66bfba726 |
--- /dev/null |
+++ b/ui/wayland/wayland_message_pump.h |
@@ -0,0 +1,40 @@ |
+// Copyright (c) 2011 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 WAYLAND_MESSAGE_PUMP_H_ |
+#define WAYLAND_MESSAGE_PUMP_H_ |
+ |
+#include <glib.h> |
+#include <stdint.h> |
+ |
+class WaylandDisplay; |
+ |
+class WaylandMessagePump { |
+ public: |
+ WaylandMessagePump(WaylandDisplay* display); |
+ virtual ~WaylandMessagePump(); |
+ |
+ protected: |
+ virtual int HandlePrepare(); |
+ virtual bool HandleCheck(); |
+ virtual void HandleDispatch(); |
+ private: |
+ struct WorkSource : public GSource { |
+ WaylandMessagePump* pump; |
+ }; |
+ |
+ static gboolean SourcePrepare(GSource* source, gint* timeout); |
+ static gboolean SourceCheck(GSource* source); |
+ static gboolean SourceDispatch(GSource* source, |
+ GSourceFunc callback, |
+ gpointer data); |
+ static int SourceUpdate(uint32_t mask, void* data); |
+ |
+ WaylandDisplay* display_; |
+ WorkSource* source_; |
+ GPollFD pfd_; |
+ uint32_t mask_; |
+}; |
+ |
+#endif |