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

Unified Diff: udev_listener.h

Issue 6854002: Merge monitor_reconfigure into powerd. (Closed) Base URL: ssh://gitrw.chromium.org:9222/power_manager.git@master
Patch Set: Round 5 Created 9 years, 8 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
Index: udev_listener.h
diff --git a/udev_listener.h b/udev_listener.h
new file mode 100644
index 0000000000000000000000000000000000000000..db0ca7ae484824953c022746ce7d52b9df23e8c4
--- /dev/null
+++ b/udev_listener.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2011 The Chromium OS 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 POWER_MANAGER_UDEV_LISTENER_H_
+#define POWER_MANAGER_UDEV_LISTENER_H_
+
+#include <string>
+
+#include <glib.h>
+#include <libudev.h>
+
+namespace power_manager {
+
+class UdevCallback {
+ public:
+ virtual ~UdevCallback() {}
+ virtual void Run(GIOChannel* source, GIOCondition condition) = 0;
+};
+
+class UdevListener {
+ public:
+ UdevListener(UdevCallback* callback, std::string subsystem);
Daniel Erat 2011/04/14 19:18:46 nit: const std::string&
marcheu 2011/04/14 19:54:57 Done.
+ ~UdevListener();
+ bool Init();
+
+ private:
+ static gboolean EventHandler(GIOChannel* source,
+ GIOCondition condition,
+ gpointer data);
+
+ // Callback on udev event; not owned.
+ UdevCallback* callback_;
+
+ struct udev_monitor* monitor_;
+ struct udev* udev_;
+ std::string subsystem_;
+};
Daniel Erat 2011/04/14 19:18:46 include "base/basictypes.h" and add DISALLOW_COPY_
marcheu 2011/04/14 19:54:57 Done.
+
+} // namespace power_manager
+
+#endif // POWER_MANAGER_UDEV_LISTENER_H_
« powerd_unittest.cc ('K') | « resolution_selector_unittest.cc ('k') | udev_listener.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698