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

Issue 499713002: Don't pass buffers to HidConnection::Read because it knows the size. (Closed)

Created:
6 years, 4 months ago by Reilly Grant (use Gerrit)
Modified:
6 years, 3 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

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}

Patch Set 1 #

Total comments: 10

Patch Set 2 : Addressed rockot@'s nits. #

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

Messages

Total messages: 8 (0 generated)
Reilly Grant (use Gerrit)
6 years, 4 months ago (2014-08-22 22:02:04 UTC) #1
Ken Rockot(use gerrit already)
lgtm pending nits and verification of all the fun buffer size adjustment behavior. https://codereview.chromium.org/499713002/diff/1/device/hid/hid_connection_linux.cc File ...
6 years, 3 months ago (2014-08-26 16:32:04 UTC) #2
Reilly Grant (use Gerrit)
Patchset #2 (id:20001) has been deleted
6 years, 3 months ago (2014-08-26 17:16:47 UTC) #3
Reilly Grant (use Gerrit)
https://codereview.chromium.org/499713002/diff/1/device/hid/hid_connection_linux.cc File device/hid/hid_connection_linux.cc (right): https://codereview.chromium.org/499713002/diff/1/device/hid/hid_connection_linux.cc#newcode112 device/hid/hid_connection_linux.cc:112: new net::IOBufferWithSize(device_info().max_feature_report_size + 1)); On 2014/08/26 16:32:04, Ken Rockot ...
6 years, 3 months ago (2014-08-26 17:17:22 UTC) #4
Reilly Grant (use Gerrit)
The CQ bit was checked by reillyg@chromium.org
6 years, 3 months ago (2014-08-26 18:18:06 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/reillyg@chromium.org/499713002/40001
6 years, 3 months ago (2014-08-26 18:18:37 UTC) #6
commit-bot: I haz the power
Committed patchset #2 (40001) as 33cd493b35187731768ea8eaf4bc9b320422a252
6 years, 3 months ago (2014-08-26 19:10:24 UTC) #7
commit-bot: I haz the power
6 years, 3 months ago (2014-09-10 02:44:32 UTC) #8
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/0e9bf9bc05be91d727134887b3c453353be1024d
Cr-Commit-Position: refs/heads/master@{#291954}

Powered by Google App Engine
This is Rietveld 408576698