| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Log events and debugging information related to HID devices through the
device event log component so that these errors are visible at
chrome://device-log. A DEVICE_PLOG macro has been added which includes
the last reported system error in the log message.
BUG=448901
Review URL: https://codereview.chromium.org/947663002
Cr-Commit-Position: refs/heads/master@{#317722}
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change documents that these helper classes live on the FILE thread
by naming them HidServiceLinux::FileThreadHelper and
HidConnectionLinux::FileThreadHelper.
BUG=
Review URL: https://codereview.chromium.org/851543002
Cr-Commit-Position: refs/heads/master@{#311120}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The HidDeviceInfo object for a device is passed around a lot, including
being copied every time enumeration of a device is requested. Since this
data is constant once a device is enumerated it is better to keep one
copy around for the device for as long as it is connected. This will
make it similar to the device::UsbDevice class.
I consider this a pre-requisite for storing more information in
HidDeviceInfo such as the raw report descriptor. Later patches will
revisit how this object is constructed and possibly reduce the number of
friend classes.
BUG=442818
Review URL: https://codereview.chromium.org/825523003
Cr-Commit-Position: refs/heads/master@{#310692}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Google C++ style guide states:
Explicitly annotate overrides of virtual functions or virtual
destructors with an override or (less frequently) final specifier.
Older (pre-C++11) code will use the virtual keyword as an inferior
alternative annotation. For clarity, use exactly one of override,
final, or virtual when declaring an override.
To better conform to these guidelines, the following constructs have
been rewritten:
- if a base class has a virtual destructor, then:
virtual ~Foo(); -> ~Foo() override;
- virtual void Foo() override; -> void Foo() override;
- virtual void Foo() override final; -> void Foo() final;
This patch was automatically generated. The clang plugin can generate
fixit hints, which are suggested edits when it is 100% sure it knows how
to fix a problem. The hints from the clang plugin were applied to the
source tree using the tool in https://codereview.chromium.org/598073004.
Several formatting edits by clang-format were manually reverted, due to
mangling of some of the more complicate IPC macros.
BUG=417463
Review URL: https://codereview.chromium.org/818093003
Cr-Commit-Position: refs/heads/master@{#309481}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a HID connection is broken read(2) will start returning errors. If
the app that opened the device does not notice that it is disconnected
then the file thread will spin on trying (and failing) to read more
data from the device. This change stops the FileDescriptorWatcher when
a read error is encountered.
BUG=
Review URL: https://codereview.chromium.org/809253002
Cr-Commit-Position: refs/heads/master@{#309103}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The creation of this object on the FILE thread races with the possible
destruction of the object on the UI thread. The scoped_ptr<> that owns
the pointer may try to destroy the object on the UI thread if the
connection is closed before the helper is started. Generally, updating
the helper_ pointer from the FILE thread is a bad idea.
This patch moves creation of the helper to the UI thread, it is then
detached from that thread when it is started. The HidConnectionLinux no
longer uses a scoped_ptr<> to hold it and instead must always free it
explicitly with DeleteSoon.
BUG=
Review URL: https://codereview.chromium.org/786343003
Cr-Commit-Position: refs/heads/master@{#307850}
|
|
|
|
|
|
|
|
|
|
| |
TEST=compile
BUG=None
TBR=jam@chromium.org
Review URL: https://codereview.chromium.org/790623002
Cr-Commit-Position: refs/heads/master@{#307457}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch is a follow-up to https://crrev.com/e8fa00efd0965a7eb5816a
that moves the HidService and HidConnection implementations on Linux
from the browser's FILE thread to the UI thread. This is being done
because the HID APIs on platforms other than Linux are more natural to
use on the UI thread. The users of these objects are also usually on
the UI thread. (For example, the extension API bindings.)
BUG=422540
Review URL: https://codereview.chromium.org/771393002
Cr-Commit-Position: refs/heads/master@{#306729}
|
|
|
|
|
|
|
|
|
|
| |
Funnel all libudev access through a wrapper for the udev library loader.
BUG=415212
Review URL: https://codereview.chromium.org/674703002
Cr-Commit-Position: refs/heads/master@{#305348}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GetShortData() and IOHIDElementGetUsage() both return uint32s, so raise the size
of various containing types to uint32.
I tried to look in the USB HID spec to see if any of the affected fields here
were limited to e.g. <2^16, meaning that it'd be safe to just cast down to the
existing uint16s instead, but I couldn't find any limits.
BUG=81439
TEST=none
Review URL: https://codereview.chromium.org/656583003
Cr-Commit-Position: refs/heads/master@{#300201}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The platform implementation of a HID connection may need to cancel I/O
operations when the connection is closed. If this is done during the
object destructor then any pointers held by those pending operations are
immediately invalid. A separate Close method allows the cleanup to
happen while the object is still available to handle asynchronous
cancellation events.
The OS X implementation will take advantage of this immediately to
register and unregister its input report callback from the UI thread to
avoid a race between event delivery and object cleanup. I've added
comments explaining why not all operations on the IOHIDDevice object
could be moved to the UI thread.
BUG=418207
Review URL: https://codereview.chromium.org/615633008
Cr-Commit-Position: refs/heads/master@{#298384}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The USB HID GET_REPORT(Feature) request includes the report ID that the
host is requesting in the SETUP packet. When the report ID is not zero
the device will send this back to the host as the first byte of the
report. Unlike input and output reports we want to preserve this part of
the report because the device may in fact by sending a value other than
the report ID as the first byte of the response.
To achieve this, on Windows this patch stops stripping the report ID
from the buffer received from the OS. On OS X this was already the
behavior. On Linux this was the behavior if the report ID was non-zero,
otherwise it would artificially prepend a zero to the buffer which must
be removed.
BUG=420112
Review URL: https://codereview.chromium.org/623963003
Cr-Commit-Position: refs/heads/master@{#298135}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The HidConnection knows the appropriate read buffer size and the
platform-specific implementation may already have a buffer that it is
waiting to return to the next caller. Passing a buffer in is therefore
unnecessary, one can be provided in the callback.
By standardizing on a buffer format which always includes the report ID
as the first byte (even when it is zero) most of the buffer copying can
be removed except in the case of OS X's persistent read buffer and
getting feature reports on Windows.
BUG=
Review URL: https://codereview.chromium.org/499713002
Cr-Commit-Position: refs/heads/master@{#291954}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Unlike Linux and OS X, Windows always writes a report ID into the
buffer passed to ReadFile. If the device does not use report IDs the
first byte of the buffer will always be zero. Because of this, and
contrary to the MSDN documentation, the maximum report size reported
in the HIDP_CAPS structure always includes a byte for the report ID.
This patch fixes the interpretation of the values in HIDP_CAPS and
the size of the buffer passed to ReadFile. To prevent uninitialized
bytes from being passed back to an app when a shorter report is read
the true number of bytes read is provided to the completion callback
on all platforms.
BUG=404253
Review URL: https://codereview.chromium.org/474273004
Cr-Commit-Position: refs/heads/master@{#290337}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290337 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This enables the Chrome to query permission_broker for access
to hidraw device paths when running on Chrome OS.
HidService has been refactored so that it is owned by the
extensions API embedder, rather than being a singleton.
Because hid has just moved to //extensions as well, this also establishes a new ShellExtensionsAPIClient to create a HidService for app_shell.
BUG=367145
TEST=manual test on ChromeOS dev build
TBR=derat@chromium.org for mechanical app_shell changes
Review URL: https://codereview.chromium.org/419713002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285774 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Linux hidraw interface expects the buffer written to the device to
always have the report ID as the first byte. Remove the conditional that
only added this data when the report ID was non-zero.
BUG=
R=rockot@chromium.org
Review URL: https://codereview.chromium.org/411463005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285041 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Tests still failed, undoing revert.
> Revert 281133 "chrome.hid: enrich model with report IDs"
>
> Speculative revert to try and fix Win browser tests.
>
> > chrome.hid: enrich model with report IDs
> >
> > - add report IDs and max report size
> > - don't expose sensitive usages
> >
> > BUG=364423
> > R=rockot@chromium.org
> > TESTS=run device_unittests (HidReportDescriptorTest)
> >
> > Review URL: https://codereview.chromium.org/317783010
>
> TBR=jracle@logitech.com
>
> Review URL: https://codereview.chromium.org/369923002
TBR=csharp@chromium.org
Review URL: https://codereview.chromium.org/364213005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281300 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Speculative revert to try and fix Win browser tests.
> chrome.hid: enrich model with report IDs
>
> - add report IDs and max report size
> - don't expose sensitive usages
>
> BUG=364423
> R=rockot@chromium.org
> TESTS=run device_unittests (HidReportDescriptorTest)
>
> Review URL: https://codereview.chromium.org/317783010
TBR=jracle@logitech.com
Review URL: https://codereview.chromium.org/369923002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281282 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- add report IDs and max report size
- don't expose sensitive usages
BUG=364423
R=rockot@chromium.org
TESTS=run device_unittests (HidReportDescriptorTest)
Review URL: https://codereview.chromium.org/317783010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281133 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
| |
Log human readable descriptions of the errors generated by system calls
executed on Linux against HID devices.
BUG=
Review URL: https://codereview.chromium.org/348733002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278899 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
| |
Log a human readable message describing the reason why Chromium failed
to open a HID device node on Linux instead of the base::File error code.
BUG=
Review URL: https://codereview.chromium.org/339503007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278684 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
| |
Disabled compiling of classes and unittests that require Udev.
BUG=none
TESTS=Ran device_unittests with use_udev=0 and use_udev=1
Review URL: https://codereview.chromium.org/316953002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275161 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This CL exists as an effort to actually land
https://codereview.chromium.org/225513005/.
This applies a small fix to the hid_service_win.cc module.
BUG=359560
TBR=rpaquay
TBR=jracle@logitech.com
Review URL: https://codereview.chromium.org/256673002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266066 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- for Windows and Linux
- open device with read access when read/write fails
BUG=364438
R=rockot@chromium.org
Review URL: https://codereview.chromium.org/240263003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266022 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
is present on Linux
Fix : HidConnectionLinux::FindHidrawDevNode should look for presence of
"hidraw" string immediately after matching parent udev path, so that we
do not match devnodes created by bus enumerator driver
BUG=358666
TBR=rockot@chromium.org
Review URL: https://codereview.chromium.org/223803002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261502 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove exclusive flags so that 2 apps can communicate with same device.
This is coherent with Windows and Mac implementation.
Note that a non-chrome app (e.g. desktop app on Windows) can open same
device.
BUG=358631
TBR=rockot@chromium.org
Review URL: https://codereview.chromium.org/213743009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261019 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The other changes follow from that.
BUG=82098
TBR=haruki@chromium.org (for chrome/browser/chromeos/drive/drive_file_system_util.h)
TBR=hidehiko@chromium.org (for chrome/browser/chromeos/drive/webkit_file_stream_writer_impl.h)
TBR=noamsml@chromium.org (for chrome/browser/local_discovery/storage/privet_filesystem_attribute_cache_unittest.cc)
TBR=rvargas@chromium.org (for device/hid/hid_connection_linux.cc)
TBR=clamy@chromium.org (for net/disk_cache/simple/simple_test_util.cc)
Review URL: https://codereview.chromium.org/184583008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255841 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
BUG=322664
R=rockot@chromium.org
Review URL: https://codereview.chromium.org/173003002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252479 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a continuation of https://codereview.chromium.org/143883005.
[ps#1 here is (post-revert) ps#12 there.]
BUG=290428
TBR=miket@chromium.org
Review URL: https://codereview.chromium.org/150773004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@248250 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Breaks CrOS buildbots
http://build.chromium.org/p/chromium.chromiumos/buildstatus?builder=ChromiumOS%20%28daisy%29&number=16073
http://build.chromium.org/p/chromium.chromiumos/buildstatus?builder=ChromiumOS%20%28amd64%29&number=13917
http://build.chromium.org/p/chromium.memory/buildstatus?builder=Chromium%20OS%20%28x86%29%20ASAN&number=8064
> HID backend
>
> BUG=290428
>
> Review URL: https://codereview.chromium.org/143883005
TBR=ikarienator@chromium.org
Review URL: https://codereview.chromium.org/148183015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247934 0039d316-1c4b-4281-b951-d872f2087c98
|
|
BUG=290428
Review URL: https://codereview.chromium.org/143883005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247926 0039d316-1c4b-4281-b951-d872f2087c98
|