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

Unified Diff: content/browser/gamepad/platform_data_fetcher_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: fix typo Created 8 years, 5 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
« no previous file with comments | « no previous file | content/browser/gamepad/platform_data_fetcher_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gamepad/platform_data_fetcher_linux.h
===================================================================
--- content/browser/gamepad/platform_data_fetcher_linux.h (revision 148200)
+++ content/browser/gamepad/platform_data_fetcher_linux.h (working copy)
@@ -9,47 +9,33 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
-#include "base/message_pump_libevent.h"
-#include "build/build_config.h"
+#include "base/memory/scoped_ptr.h"
#include "content/browser/gamepad/data_fetcher.h"
#include "content/browser/gamepad/gamepad_standard_mappings.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGamepads.h"
extern "C" {
-struct udev;
struct udev_device;
-struct udev_monitor;
}
namespace content {
-class GamepadPlatformDataFetcherLinux :
- public GamepadDataFetcher,
- public base::MessagePumpLibevent::Watcher {
+class UdevLinux;
+
+class GamepadPlatformDataFetcherLinux : public GamepadDataFetcher {
public:
GamepadPlatformDataFetcherLinux();
virtual ~GamepadPlatformDataFetcherLinux();
- // GamepadDataFetcher:
+ // GamepadDataFetcher implementation.
virtual void GetGamepadData(WebKit::WebGamepads* pads,
bool devices_changed_hint) OVERRIDE;
- // base::MessagePump:Libevent::Watcher:
- virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE;
- virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE;
-
private:
void RefreshDevice(udev_device* dev);
void EnumerateDevices();
void ReadDeviceData(size_t index);
- // 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_;
-
// File descriptors for the /dev/input/js* devices. -1 if not in use.
int device_fds_[WebKit::WebGamepads::itemsLengthCap];
@@ -60,6 +46,8 @@
// Data that's returned to the consumer.
WebKit::WebGamepads data_;
+ scoped_ptr<UdevLinux> udev_;
+
DISALLOW_COPY_AND_ASSIGN(GamepadPlatformDataFetcherLinux);
};
« no previous file with comments | « no previous file | content/browser/gamepad/platform_data_fetcher_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698