• reillyg's avatar
    Don't pass buffers to HidConnection::Read because it knows the size. · 0e9bf9bc
    reillyg authored
    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}
    0e9bf9bc
hid_connection.cc 5.45 KB