Chromium Code Reviews| Index: content/browser/udev_linux.h |
| =================================================================== |
| --- content/browser/udev_linux.h (revision 0) |
| +++ content/browser/udev_linux.h (revision 0) |
| @@ -0,0 +1,49 @@ |
| +// Copyright (c) 2012 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 CONTENT_BROWSER_UDEV_LINUX_H_ |
| +#define CONTENT_BROWSER_UDEV_LINUX_H_ |
| + |
| +#include "base/basictypes.h" |
| +#include "base/compiler_specific.h" |
| +#include "base/message_pump_libevent.h" |
| + |
| +extern "C" { |
| +struct udev; |
| +struct udev_device; |
| +struct udev_monitor; |
| +} |
| + |
|
Lei Zhang
2012/07/26 01:44:31
I probably need to add a description here and an e
|
| +namespace content { |
| + |
| +class UdevLinux : public base::MessagePumpLibevent::Watcher { |
| + public: |
| + UdevLinux(); |
| + virtual ~UdevLinux(); |
| + |
| + virtual void Notify(udev_device* device) = 0; |
|
jam
2012/07/26 02:11:33
Instead of implementation inheritance, can you mak
|
| + |
| + protected: |
| + virtual void StartMonitoring(); |
| + udev* udev_handle(); |
| + udev_monitor* monitor(); |
| + |
| + private: |
| + // base::MessagePump:Libevent::Watcher: |
| + virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE; |
| + virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE; |
| + |
| + // libudev-related items, the main context, and the monitoring context to be |
| + // notified about changes to device states. |
| + udev* udev_; |
| + udev_monitor* monitor_; |
| + int monitor_fd_; |
| + base::MessagePumpLibevent::FileDescriptorWatcher monitor_watcher_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(UdevLinux); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_UDEV_LINUX_H_ |
| Property changes on: content/browser/udev_linux.h |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| + LF |