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

Issue 10827123: Add serial bulk reads. (Closed)

Created:
8 years, 4 months ago by miket_OOO
Modified:
8 years, 4 months ago
CC:
chromium-reviews, Aaron Boodman, mihaip-chromium-reviews_chromium.org
Visibility:
Public.

Description

Add serial bulk reads. As a curious shortcut, we originally implemented the serial read function to return exactly one byte at a time. This might have been back when we didn't yet have ArrayBuffer support, so it actually was easier to deal with a byte rather than a buffer. Now we read the requested number of bytes or a smaller number to avoid blocking. BUG=136897 TEST=changed existing tests to use new API, and replaced the test byte with a test sequence. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=149718

Patch Set 1 : #

Total comments: 2

Patch Set 2 : Replaced pretend ring buffer with std::deque<>. #

Total comments: 2

Patch Set 3 : Review nits from Peng. #

Total comments: 1

Patch Set 4 : asargent review changes. #

Patch Set 5 : Merge help. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+143 lines, -50 lines) Patch
M chrome/browser/extensions/api/serial/serial_api.cc View 1 2 3 4 chunks +13 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/serial/serial_apitest.cc View 1 2 4 chunks +15 lines, -17 lines 0 comments Download
M chrome/browser/extensions/api/serial/serial_connection.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/serial/serial_connection.cc View 1 chunk +4 lines, -3 lines 0 comments Download
M chrome/common/extensions/api/experimental_serial.idl View 2 chunks +7 lines, -1 line 0 comments Download
M chrome/common/extensions/docs/apps/api_index.html View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/common/extensions/docs/apps/experimental.serial.html View 3 chunks +26 lines, -2 lines 0 comments Download
M chrome/common/extensions/docs/examples/api/notifications.zip View 0 chunks +-1 lines, --1 lines 0 comments Download
M chrome/common/extensions/docs/extensions/api_index.html View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/common/extensions/docs/extensions/devtools.panels.html View 4 chunks +4 lines, -4 lines 0 comments Download
M chrome/common/extensions/docs/extensions/experimental.html View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/docs/extensions/experimental.serial.html View 3 chunks +26 lines, -2 lines 0 comments Download
M chrome/common/extensions/docs/extensions/samples.html View 1 2 3 4 2 chunks +8 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/api_test/serial/api/background.js View 3 chunks +33 lines, -17 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
miket_OOO
8 years, 4 months ago (2012-08-01 21:28:20 UTC) #1
Peng
http://codereview.chromium.org/10827123/diff/2001/chrome/browser/extensions/api/serial/serial_apitest.cc File chrome/browser/extensions/api/serial/serial_apitest.cc (right): http://codereview.chromium.org/10827123/diff/2001/chrome/browser/extensions/api/serial/serial_apitest.cc#newcode84 chrome/browser/extensions/api/serial/serial_apitest.cc:84: if (read_index_ >= write_index_) { As it is a ...
8 years, 4 months ago (2012-08-01 22:14:00 UTC) #2
miket_OOO
> As it is a ring bufer, I think just testing read_index >= write_index is ...
8 years, 4 months ago (2012-08-01 23:04:27 UTC) #3
miket_OOO
> You're right; I forgot that I never turned this into a real ring buffer. ...
8 years, 4 months ago (2012-08-02 16:17:46 UTC) #4
Peng
lgtm, with comments. BTW, I am not in OWNERS. http://codereview.chromium.org/10827123/diff/19/chrome/browser/extensions/api/serial/serial_apitest.cc File chrome/browser/extensions/api/serial/serial_apitest.cc (right): http://codereview.chromium.org/10827123/diff/19/chrome/browser/extensions/api/serial/serial_apitest.cc#newcode89 chrome/browser/extensions/api/serial/serial_apitest.cc:89: ...
8 years, 4 months ago (2012-08-02 16:31:32 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/miket@chromium.org/10827123/5003
8 years, 4 months ago (2012-08-02 19:18:26 UTC) #6
commit-bot: I haz the power
Failed to apply patch for chrome/common/extensions/docs/apps/experimental.html: While running patch -p1 --forward --force; patching file chrome/common/extensions/docs/apps/experimental.html ...
8 years, 4 months ago (2012-08-02 19:18:37 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/miket@chromium.org/10827123/5003
8 years, 4 months ago (2012-08-02 19:23:06 UTC) #8
commit-bot: I haz the power
Failed to apply patch for chrome/common/extensions/docs/apps/experimental.html: While running patch -p1 --forward --force; patching file chrome/common/extensions/docs/apps/experimental.html ...
8 years, 4 months ago (2012-08-02 19:23:14 UTC) #9
asargent_no_longer_on_chrome
LGTM http://codereview.chromium.org/10827123/diff/5003/chrome/browser/extensions/api/serial/serial_api.cc File chrome/browser/extensions/api/serial/serial_api.cc (right): http://codereview.chromium.org/10827123/diff/5003/chrome/browser/extensions/api/serial/serial_api.cc#newcode213 chrome/browser/extensions/api/serial/serial_api.cc:213: new net::IOBufferWithSize(params_->bytes_to_read)); nit: does IOBufferWithSize already properly handle ...
8 years, 4 months ago (2012-08-02 19:58:07 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/miket@chromium.org/10827123/3019
8 years, 4 months ago (2012-08-02 20:11:04 UTC) #11
commit-bot: I haz the power
Failed to apply patch for chrome/common/extensions/docs/apps/experimental.html: While running patch -p1 --forward --force; patching file chrome/common/extensions/docs/apps/experimental.html ...
8 years, 4 months ago (2012-08-02 20:11:10 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/miket@chromium.org/10827123/12002
8 years, 4 months ago (2012-08-02 20:38:13 UTC) #13
commit-bot: I haz the power
8 years, 4 months ago (2012-08-02 22:06:46 UTC) #14
Change committed as 149718

Powered by Google App Engine
This is Rietveld 408576698