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

Unified Diff: chrome/browser/extensions/api/serial/serial_connection_win.cc

Issue 100813002: Remove timeout behavior from Windows serial I/O (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698