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

Side by Side 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: Second version with nits. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698