| Index: chrome/browser/extensions/api/serial/serial_connection_win.cc
|
| diff --git a/chrome/browser/extensions/api/serial/serial_connection_win.cc b/chrome/browser/extensions/api/serial/serial_connection_win.cc
|
| index f5efec752e8da042b2810ffd3e4f20bd8a92fea6..ed383027cb85def60b9ecb4d4c13e3750619ae9c 100644
|
| --- a/chrome/browser/extensions/api/serial/serial_connection_win.cc
|
| +++ b/chrome/browser/extensions/api/serial/serial_connection_win.cc
|
| @@ -158,12 +158,12 @@ bool SerialConnection::ConfigurePort(
|
| }
|
|
|
| bool SerialConnection::PostOpen() {
|
| - // Set a very brief read interval timeout. This prevents the asynchronous I/O
|
| - // system from being way too eager to fire off completion events which would
|
| - // in turn result in a lot of onReceive events being fired (i.e., one for
|
| - // every individual byte received on the serial buffer.)
|
| + // A ReadIntervalTimeout of MAXDWORD will cause async reads to complete
|
| + // immediately with any data that's available, even if there is none.
|
| + // This is OK because we never issue a read request until WaitCommEvent
|
| + // signals that data is available.
|
| COMMTIMEOUTS timeouts = { 0 };
|
| - timeouts.ReadIntervalTimeout = 10;
|
| + timeouts.ReadIntervalTimeout = MAXDWORD;
|
| if (!::SetCommTimeouts(file_, &timeouts)) {
|
| return false;
|
| }
|
|
|