diff options
author | rockot@chromium.org <rockot@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-27 17:29:10 +0000 |
---|---|---|
committer | rockot@chromium.org <rockot@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-27 17:29:10 +0000 |
commit | 26958d1d63547e6ff5f9f254e718905709fb6daf (patch) | |
tree | 2cc5f9553d8bd8d56f8d438fec805e11c2e2e01c /device/hid/hid_service_linux.h | |
parent | 76d03f895522ae0ea5106c31618115b1a1d2c575 (diff) | |
download | chromium_src-26958d1d63547e6ff5f9f254e718905709fb6daf.zip chromium_src-26958d1d63547e6ff5f9f254e718905709fb6daf.tar.gz chromium_src-26958d1d63547e6ff5f9f254e718905709fb6daf.tar.bz2 |
Clean up HID backend and API.
The Mac backend no longer creates its own thread and instead simply enforces single-threaded usage on any thread which supports I/O. Ref management has also been sanitized.
The Linux backend now implements feature report support.
The backend interface no longer expects implicit report IDs in buffers passed to Write or SetFeatureReport. Instead these interfaces (as well as GetFeatureReport) take explicit report ID arguments.
The API interface has been updated to reflect the improved report ID treatment.
Finally, the API also now exposes opaque device identifiers on enumeration, rather than exposing raw system paths or other information that could be potentially sensitive.
BUG=347294
Review URL: https://codereview.chromium.org/161823002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253853 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'device/hid/hid_service_linux.h')
-rw-r--r-- | device/hid/hid_service_linux.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/device/hid/hid_service_linux.h b/device/hid/hid_service_linux.h index ba58fad..ae730ce 100644 --- a/device/hid/hid_service_linux.h +++ b/device/hid/hid_service_linux.h @@ -1,4 +1,4 @@ -// Copyright (c) 2014 The Chromium Authors. All rights reserved. +// Copyright 2014 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. @@ -7,6 +7,9 @@ #include <libudev.h> +#include <map> +#include <string> + #include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_pump_libevent.h" @@ -50,7 +53,8 @@ class HidServiceLinux : public HidService, public: HidServiceLinux(); - virtual scoped_refptr<HidConnection> Connect(std::string device_id) OVERRIDE; + virtual scoped_refptr<HidConnection> Connect(const HidDeviceId& device_id) + OVERRIDE; // Implements base::MessagePumpLibevent::Watcher virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE; @@ -60,8 +64,8 @@ class HidServiceLinux : public HidService, virtual ~HidServiceLinux(); void Enumerate(); - void PlatformDeviceAdd(udev_device* device); - void PlatformDeviceRemove(udev_device* raw_dev); + void PlatformAddDevice(udev_device* device); + void PlatformRemoveDevice(udev_device* raw_dev); scoped_ptr<udev, UdevDeleter> udev_; scoped_ptr<udev_monitor, UdevMonitorDeleter> monitor_; |