|
Don't pass buffers to HidConnection::Read because it knows the size.
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=
Committed: https://crrev.com/0e9bf9bc05be91d727134887b3c453353be1024d
Cr-Commit-Position: refs/heads/master@{#291954}
Total comments: 10
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+438 lines, -447 lines) |
Patch |
 |
M |
device/hid/hid_connection.h
|
View
|
|
3 chunks |
+38 lines, -32 lines |
0 comments
|
Download
|
 |
M |
device/hid/hid_connection.cc
|
View
|
|
3 chunks |
+56 lines, -56 lines |
0 comments
|
Download
|
 |
M |
device/hid/hid_connection_linux.h
|
View
|
1
|
1 chunk |
+14 lines, -17 lines |
0 comments
|
Download
|
 |
M |
device/hid/hid_connection_linux.cc
|
View
|
1
|
6 chunks |
+55 lines, -72 lines |
0 comments
|
Download
|
 |
M |
device/hid/hid_connection_mac.h
|
View
|
1
|
3 chunks |
+16 lines, -19 lines |
0 comments
|
Download
|
 |
M |
device/hid/hid_connection_mac.cc
|
View
|
|
6 chunks |
+57 lines, -62 lines |
0 comments
|
Download
|
 |
M |
device/hid/hid_connection_unittest.cc
|
View
|
1
|
3 chunks |
+37 lines, -16 lines |
0 comments
|
Download
|
 |
M |
device/hid/hid_connection_win.h
|
View
|
1
|
1 chunk |
+23 lines, -17 lines |
0 comments
|
Download
|
 |
M |
device/hid/hid_connection_win.cc
|
View
|
|
6 chunks |
+107 lines, -114 lines |
0 comments
|
Download
|
 |
M |
extensions/browser/api/hid/hid_api.h
|
View
|
|
4 chunks |
+8 lines, -7 lines |
0 comments
|
Download
|
 |
M |
extensions/browser/api/hid/hid_api.cc
|
View
|
1
|
4 chunks |
+27 lines, -35 lines |
0 comments
|
Download
|
Total messages: 8 (0 generated)
|