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

Side by Side Diff: content/browser/udev_linux.h

Issue 10824036: Linux: Refactor udev device monitoring code into its own class so it can be reused more easily. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 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
« no previous file with comments | « content/browser/gamepad/platform_data_fetcher_linux.cc ('k') | content/browser/udev_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium 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 CONTENT_BROWSER_UDEV_LINUX_H_
6 #define CONTENT_BROWSER_UDEV_LINUX_H_
7
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/message_pump_libevent.h"
11
12 extern "C" {
13 struct udev;
14 struct udev_device;
15 struct udev_monitor;
16 }
17
Lei Zhang 2012/07/26 01:44:31 I probably need to add a description here and an e
18 namespace content {
19
20 class UdevLinux : public base::MessagePumpLibevent::Watcher {
21 public:
22 UdevLinux();
23 virtual ~UdevLinux();
24
25 virtual void Notify(udev_device* device) = 0;
jam 2012/07/26 02:11:33 Instead of implementation inheritance, can you mak
26
27 protected:
28 virtual void StartMonitoring();
29 udev* udev_handle();
30 udev_monitor* monitor();
31
32 private:
33 // base::MessagePump:Libevent::Watcher:
34 virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE;
35 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE;
36
37 // libudev-related items, the main context, and the monitoring context to be
38 // notified about changes to device states.
39 udev* udev_;
40 udev_monitor* monitor_;
41 int monitor_fd_;
42 base::MessagePumpLibevent::FileDescriptorWatcher monitor_watcher_;
43
44 DISALLOW_COPY_AND_ASSIGN(UdevLinux);
45 };
46
47 } // namespace content
48
49 #endif // CONTENT_BROWSER_UDEV_LINUX_H_
OLDNEW
« no previous file with comments | « content/browser/gamepad/platform_data_fetcher_linux.cc ('k') | content/browser/udev_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698