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

Issue 25666010: Adding third party library hidapi (Closed)

Created:
7 years, 2 months ago by Bei Zhang
Modified:
6 years, 10 months ago
Reviewers:
Daniel Berlin, Kees Cook, cpu_(ooo_6.6-7.5), Paweł Hajdan Jr., Robert Sesek, open-source-third-party-reviews, meacer, Will Harris
CC:
chromium-reviews
Visibility:
Public.

Description

Adding third party library hidapi BUG=290428

Patch Set 1 : Adding third party library hidapi #

Total comments: 4

Patch Set 2 : Fix license #

Patch Set 3 : Rebase #

Total comments: 26

Patch Set 4 : Update Linux backend #

Total comments: 11
Unified diffs Side-by-side diffs Delta from patch set Stats (+3782 lines, -5 lines) Patch
M third_party/devscripts/licensecheck.pl View 1 2 3 chunks +4 lines, -4 lines 0 comments Download
A third_party/hidapi/AUTHORS.txt View 1 chunk +16 lines, -0 lines 0 comments Download
A third_party/hidapi/LICENSE-bsd.txt View 1 chunk +26 lines, -0 lines 0 comments Download
A + third_party/hidapi/OWNERS View 1 chunk +0 lines, -1 line 0 comments Download
A third_party/hidapi/README.chromium View 1 2 3 1 chunk +26 lines, -0 lines 0 comments Download
A third_party/hidapi/README.txt View 1 chunk +339 lines, -0 lines 0 comments Download
A third_party/hidapi/hidapi.h View 1 1 chunk +385 lines, -0 lines 0 comments Download
A third_party/hidapi/hidapi.gyp View 1 chunk +32 lines, -0 lines 1 comment Download
A third_party/hidapi/hidapi_linux.c View 1 2 3 1 chunk +800 lines, -0 lines 0 comments Download
A third_party/hidapi/hidapi_linux.c.patch View 1 2 3 1 chunk +118 lines, -0 lines 0 comments Download
A third_party/hidapi/hidapi_mac.c View 1 2 3 1 chunk +1112 lines, -0 lines 0 comments Download
A third_party/hidapi/hidapi_win.c View 1 1 chunk +923 lines, -0 lines 10 comments Download
M tools/checklicenses/checklicenses.py View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
Bei Zhang
Hi Pawel, Please review the change on licensecheck.pl. We are introducing a triple licensed library ...
7 years, 2 months ago (2013-10-02 23:42:49 UTC) #1
Paweł Hajdan Jr.
I think this is fine, I'll give final approval when it recognizes GPLv3. Please make ...
7 years, 2 months ago (2013-10-03 01:14:25 UTC) #2
Bei Zhang
https://codereview.chromium.org/25666010/diff/5001/third_party/devscripts/licensecheck.pl File third_party/devscripts/licensecheck.pl (right): https://codereview.chromium.org/25666010/diff/5001/third_party/devscripts/licensecheck.pl#newcode471 third_party/devscripts/licensecheck.pl:471: } elsif ($licensetext =~ /is distributed under the terms ...
7 years, 2 months ago (2013-10-03 19:15:14 UTC) #3
Paweł Hajdan Jr.
LGTM
7 years, 2 months ago (2013-10-03 19:40:36 UTC) #4
Bei Zhang
Hi teams, Please review. Thanks, Bei
7 years, 2 months ago (2013-10-03 20:59:04 UTC) #5
Bei Zhang
Hi meacer, Please review. I'm adding you to the OWNERS file. Thanks, Bei
7 years, 2 months ago (2013-10-03 21:48:12 UTC) #6
Bei Zhang
Hi Carlos, Please review. Thanks, Bei
7 years, 1 month ago (2013-11-11 20:46:56 UTC) #7
cpu_(ooo_6.6-7.5)
1- please add open-source-third-party-reviews@google.com and security@chromium.org. to this review, you need their approval. 2- Please ...
7 years, 1 month ago (2013-11-13 01:08:50 UTC) #8
cpu_(ooo_6.6-7.5)
the windows bits are pretty sketchy. I hope security review does a full pass here.
7 years, 1 month ago (2013-11-13 01:19:34 UTC) #9
Daniel Berlin
lgtm
7 years ago (2013-12-03 22:49:52 UTC) #10
Kees Cook
I didn't review Windows or Mac, but there's a lot of robustness changes needed (some ...
7 years ago (2013-12-04 20:49:36 UTC) #11
Bei Zhang
Hi Kees, Thanks for the review! Do you happened to have time to take a ...
7 years ago (2013-12-10 22:24:10 UTC) #12
Robert Sesek
I was asked by wfh@ to review the Mac file and it's not lgtm on ...
6 years, 11 months ago (2014-01-14 23:24:58 UTC) #13
Will Harris
6 years, 11 months ago (2014-01-14 23:40:00 UTC) #14
Comments.  The Win implementation doesn't seem quite as bad as the Mac version,
but I do worry that we're introducing an unnecessary third_party library when it
seems the actual logic to interface with the Win HID API is pretty small and
could be done in Chromium land using Chrome constructs.

https://codereview.chromium.org/25666010/diff/236001/third_party/hidapi/hidap...
File third_party/hidapi/hidapi.gyp (right):

https://codereview.chromium.org/25666010/diff/236001/third_party/hidapi/hidap...
third_party/hidapi/hidapi.gyp:20: 'msvs_disabled_warnings': [ 4267 ],
is it not possible to fix these truncations?

https://codereview.chromium.org/25666010/diff/236001/third_party/hidapi/hidap...
File third_party/hidapi/hidapi_win.c (right):

https://codereview.chromium.org/25666010/diff/236001/third_party/hidapi/hidap...
third_party/hidapi/hidapi_win.c:67: #pragma warning(disable:4996)
prefer to disable in the gyp file rather than inline

https://codereview.chromium.org/25666010/diff/236001/third_party/hidapi/hidap...
third_party/hidapi/hidapi_win.c:196: lib_handle = LoadLibraryA("hid.dll");
where will this code be called from?  Prefer not to have random LoadLibary
happening.

Can you get the HIDAPI_USE_DDK define to work to avoid this?

https://codereview.chromium.org/25666010/diff/236001/third_party/hidapi/hidap...
third_party/hidapi/hidapi_win.c:318: device_interface_detail_data =
(SP_DEVICE_INTERFACE_DETAIL_DATA_A*) malloc(required_size);
check return value of malloc

https://codereview.chromium.org/25666010/diff/236001/third_party/hidapi/hidap...
third_party/hidapi/hidapi_win.c:340: char driver_name[256];
where is 256 from?

https://codereview.chromium.org/25666010/diff/236001/third_party/hidapi/hidap...
third_party/hidapi/hidapi_win.c:371: goto cont_close;
CloseHandle() on invalid handle later on

https://codereview.chromium.org/25666010/diff/236001/third_party/hidapi/hidap...
third_party/hidapi/hidapi_win.c:392: wchar_t wstr[WSTR_LEN]; /* TODO: Determine
Size */
seems like a rather scary TODO

https://codereview.chromium.org/25666010/diff/236001/third_party/hidapi/hidap...
third_party/hidapi/hidapi_win.c:430: res =
HidD_GetSerialNumberString(write_handle, wstr, sizeof(wstr));
these functions all take number of bytes but sizeof() is giving number of wchars

https://codereview.chromium.org/25666010/diff/236001/third_party/hidapi/hidap...
third_party/hidapi/hidapi_win.c:585: dev->read_buf = (char*)
malloc(dev->input_report_length);
check return value

https://codereview.chromium.org/25666010/diff/236001/third_party/hidapi/hidap...
third_party/hidapi/hidapi_win.c:723: int HID_API_EXPORT HID_API_CALL
hid_read(hid_device *dev, unsigned char *data, size_t length)
your calls from Chromeland are using the blocking version, have you considered
using the non-blocking version instead?

https://codereview.chromium.org/25666010/diff/236001/third_party/hidapi/hidap...
third_party/hidapi/hidapi_win.c:876: int __cdecl main(int argc, char* argv[])
can this test code be removed and/or replaced with proper unit tests?

Powered by Google App Engine
This is Rietveld 408576698