Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef POWER_MANAGER_UDEV_LISTENER_H_ | |
| 6 #define POWER_MANAGER_UDEV_LISTENER_H_ | |
| 7 | |
| 8 #include <glib.h> | |
| 9 #include <libudev.h> | |
| 10 #include <string> | |
|
Daniel Erat
2011/04/13 23:33:26
nit: this should come first, followed by a blank l
marcheu
2011/04/14 02:23:55
Done.
| |
| 11 | |
| 12 namespace power_manager { | |
| 13 | |
| 14 class UdevCallBack { | |
| 15 public: | |
|
Daniel Erat
2011/04/13 23:33:26
classes with virtual methods should have virtual d
marcheu
2011/04/14 02:23:55
Done.
| |
| 16 virtual void CallBack(GIOChannel* source, GIOCondition condition) = 0; | |
|
Daniel Erat
2011/04/13 23:33:26
nit: rename to something like Run()
marcheu
2011/04/14 02:23:55
Done.
| |
| 17 }; | |
| 18 | |
| 19 class UdevListener { | |
| 20 public: | |
| 21 UdevListener(UdevCallBack* callback, std::string subsystem); | |
| 22 ~UdevListener() {} | |
| 23 bool Init(); | |
| 24 | |
| 25 private: | |
| 26 static gboolean EventHandler(GIOChannel* source, | |
| 27 GIOCondition condition, | |
| 28 gpointer data); | |
|
Daniel Erat
2011/04/13 23:33:26
nit: add blank line after this
marcheu
2011/04/14 02:23:55
Done.
| |
| 29 // Callback on udev event; not owned. | |
| 30 UdevCallBack* callback_; | |
| 31 | |
|
Daniel Erat
2011/04/13 23:33:26
nit: delete extra blank line
marcheu
2011/04/14 02:23:55
Done.
| |
| 32 | |
| 33 struct udev_monitor* monitor_; | |
| 34 std::string subsystem_; | |
| 35 }; | |
| 36 | |
| 37 } // namespace power_manager | |
| 38 | |
| 39 #endif // POWER_MANAGER_UDEV_LISTENER_H_ | |
| 40 | |
| OLD | NEW |