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

Issue 10827390: Implement chrome.socket.bind/listen/accept for TCP server socket. (Closed)

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

Description

Implement chrome.socket.listen/accept for TCP server socket. BUG=130050 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=159172

Patch Set 1 #

Total comments: 14

Patch Set 2 : Addressed comments, fixes and added unit tests. #

Patch Set 3 : Remove unrelated changes. #

Total comments: 33

Patch Set 4 : Address review comments #

Total comments: 6

Patch Set 5 : comments #

Total comments: 2

Patch Set 6 : Revert net::socket change, check permissions for listen. #

Total comments: 1

Patch Set 7 : Remove need to bind before calling listen. #

Total comments: 2

Patch Set 8 : Add error if trying to bind TCP socket, remove TCP client socket bind. #

Total comments: 19

Patch Set 9 : Address comments, set default for listen backlog to 5 #

Total comments: 8

Patch Set 10 : Address review comments, add permissions test, fix bug with accept() #

Total comments: 9

Patch Set 11 : Address comments #

Patch Set 12 : Fix tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+465 lines, -21 lines) Patch
M chrome/browser/extensions/api/socket/socket.h View 1 2 3 4 5 6 3 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/socket/socket.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +12 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/socket/socket_api.h View 1 2 3 5 6 7 8 2 chunks +36 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/socket/socket_api.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +95 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/socket/socket_apitest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +25 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/socket/tcp_socket.h View 1 2 3 4 5 6 7 5 chunks +27 lines, -3 lines 0 comments Download
M chrome/browser/extensions/api/socket/tcp_socket.cc View 1 2 3 4 5 6 7 8 9 10 11 10 chunks +106 lines, -13 lines 0 comments Download
M chrome/browser/extensions/api/socket/tcp_socket_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +33 lines, -1 line 0 comments Download
M chrome/common/extensions/api/socket.idl View 1 2 3 4 5 6 7 8 9 10 2 chunks +36 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/api_test/socket/api/background.js View 1 2 3 4 5 6 7 8 9 1 chunk +56 lines, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/socket/api/manifest.json View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/socket/experimental/background.js View 1 2 3 4 5 6 7 8 9 10 1 chunk +29 lines, -0 lines 0 comments Download
A + chrome/test/data/extensions/api_test/socket/experimental/manifest.json View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -1 line 0 comments Download

Messages

Total messages: 26 (0 generated)
justinlin
Hi Peng, Mike, Mihai, This is still very much work in progress, but I wanted ...
8 years, 4 months ago (2012-08-17 00:25:20 UTC) #1
Peng
Those two API look good to me. But it is not very clear how to ...
8 years, 4 months ago (2012-08-18 12:17:12 UTC) #2
Peng
Those two API look good to me. But it is not very clear how to ...
8 years, 4 months ago (2012-08-18 12:17:14 UTC) #3
miket_OOO
Drive-by, as you requested. I know you're still working on this, but I couldn't help ...
8 years, 3 months ago (2012-08-31 23:18:01 UTC) #4
justinlin
Hi Mike, Peng, Please take another look. Addressed comments and added tests. Note: this depends ...
8 years, 3 months ago (2012-09-11 04:32:31 UTC) #5
Peng
http://codereview.chromium.org/10827390/diff/9002/chrome/browser/extensions/api/socket/socket_api.cc File chrome/browser/extensions/api/socket/socket_api.cc (right): http://codereview.chromium.org/10827390/diff/9002/chrome/browser/extensions/api/socket/socket_api.cc#newcode150 chrome/browser/extensions/api/socket/socket_api.cc:150: manager_->Remove(socket_id_); Could we check if the listen port is ...
8 years, 3 months ago (2012-09-11 14:01:18 UTC) #6
justinlin
Thanks for the review, PTAL. http://codereview.chromium.org/10827390/diff/9002/chrome/browser/extensions/api/socket/socket_api.cc File chrome/browser/extensions/api/socket/socket_api.cc (right): http://codereview.chromium.org/10827390/diff/9002/chrome/browser/extensions/api/socket/socket_api.cc#newcode150 chrome/browser/extensions/api/socket/socket_api.cc:150: manager_->Remove(socket_id_); I think the ...
8 years, 3 months ago (2012-09-12 07:29:42 UTC) #7
Peng
http://codereview.chromium.org/10827390/diff/9002/chrome/browser/extensions/api/socket/socket_api.cc File chrome/browser/extensions/api/socket/socket_api.cc (right): http://codereview.chromium.org/10827390/diff/9002/chrome/browser/extensions/api/socket/socket_api.cc#newcode150 chrome/browser/extensions/api/socket/socket_api.cc:150: manager_->Remove(socket_id_); On 2012/09/12 07:29:42, justinlin wrote: > I think ...
8 years, 3 months ago (2012-09-12 19:49:49 UTC) #8
justinlin
http://codereview.chromium.org/10827390/diff/9002/chrome/browser/extensions/api/socket/socket_api.h File chrome/browser/extensions/api/socket/socket_api.h (right): http://codereview.chromium.org/10827390/diff/9002/chrome/browser/extensions/api/socket/socket_api.h#newcode166 chrome/browser/extensions/api/socket/socket_api.h:166: DECLARE_EXTENSION_FUNCTION_NAME("socket.listen"); On 2012/09/12 19:49:49, Peng wrote: > On 2012/09/12 ...
8 years, 3 months ago (2012-09-13 08:21:12 UTC) #9
Peng
almost look good to me. except one problem. I did not find you check permission ...
8 years, 3 months ago (2012-09-13 16:51:04 UTC) #10
justinlin
PTAL, Thanks! http://codereview.chromium.org/10827390/diff/6014/chrome/browser/extensions/api/socket/socket_api.cc File chrome/browser/extensions/api/socket/socket_api.cc (right): http://codereview.chromium.org/10827390/diff/6014/chrome/browser/extensions/api/socket/socket_api.cc#newcode266 chrome/browser/extensions/api/socket/socket_api.cc:266: if (!GetExtension()->CheckAPIPermissionWithParam(APIPermission::kSocket, On 2012/09/13 16:51:04, Peng wrote: ...
8 years, 3 months ago (2012-09-14 05:26:52 UTC) #11
Peng
http://codereview.chromium.org/10827390/diff/16013/chrome/browser/extensions/api/socket/socket_api.cc File chrome/browser/extensions/api/socket/socket_api.cc (right): http://codereview.chromium.org/10827390/diff/16013/chrome/browser/extensions/api/socket/socket_api.cc#newcode295 chrome/browser/extensions/api/socket/socket_api.cc:295: if (socket && socket->GetBindAddress(&bindAddress)) { The permissions for bind ...
8 years, 3 months ago (2012-09-14 16:27:16 UTC) #12
justinlin
On 2012/09/14 16:27:16, Peng wrote: > http://codereview.chromium.org/10827390/diff/16013/chrome/browser/extensions/api/socket/socket_api.cc > File chrome/browser/extensions/api/socket/socket_api.cc (right): > > http://codereview.chromium.org/10827390/diff/16013/chrome/browser/extensions/api/socket/socket_api.cc#newcode295 > ...
8 years, 3 months ago (2012-09-17 05:17:32 UTC) #13
Peng
lgtm with a suggestion. http://codereview.chromium.org/10827390/diff/10012/chrome/browser/extensions/api/socket/socket_api.cc File chrome/browser/extensions/api/socket/socket_api.cc (right): http://codereview.chromium.org/10827390/diff/10012/chrome/browser/extensions/api/socket/socket_api.cc#newcode272 chrome/browser/extensions/api/socket/socket_api.cc:272: } As you implemented bind() ...
8 years, 3 months ago (2012-09-17 15:02:48 UTC) #14
justinlin
Sorry for the delay. Thanks, done. Yea, bind() was for the TCP client socket at ...
8 years, 3 months ago (2012-09-20 23:11:22 UTC) #15
miket_OOO
Getting close. Please see the email referenced below & make changes. http://codereview.chromium.org/10827390/diff/22001/chrome/browser/extensions/api/socket/socket.cc File chrome/browser/extensions/api/socket/socket.cc (right): ...
8 years, 3 months ago (2012-09-24 18:14:20 UTC) #16
justinlin
Address all the comments except for 1 (see comment). Please take another look, thanks! http://codereview.chromium.org/10827390/diff/22001/chrome/browser/extensions/api/socket/socket.cc ...
8 years, 2 months ago (2012-09-26 08:59:59 UTC) #17
miket_OOO
We're almost there, thanks. I'd feel more comfortable if I saw a test showing we ...
8 years, 2 months ago (2012-09-26 17:17:55 UTC) #18
justinlin
Done, added the test. Also found a bug with accept() in the process. PTAL, thanks! ...
8 years, 2 months ago (2012-09-26 20:53:11 UTC) #19
miket_OOO
LGTM, thanks. See a few comments below. http://codereview.chromium.org/10827390/diff/34002/chrome/browser/extensions/api/socket/socket.cc File chrome/browser/extensions/api/socket/socket.cc (right): http://codereview.chromium.org/10827390/diff/34002/chrome/browser/extensions/api/socket/socket.cc#newcode92 chrome/browser/extensions/api/socket/socket.cc:92: return net::ERR_FAILED; ...
8 years, 2 months ago (2012-09-26 21:02:44 UTC) #20
Mihai Parparita -not on Chrome
http://codereview.chromium.org/10827390/diff/34002/chrome/browser/extensions/api/socket/socket_api.cc File chrome/browser/extensions/api/socket/socket_api.cc (right): http://codereview.chromium.org/10827390/diff/34002/chrome/browser/extensions/api/socket/socket_api.cc#newcode41 chrome/browser/extensions/api/socket/socket_api.cc:41: "Caller does not have permission for experimental api"; Nit: ...
8 years, 2 months ago (2012-09-26 21:50:33 UTC) #21
justinlin
http://codereview.chromium.org/10827390/diff/34002/chrome/browser/extensions/api/socket/socket.cc File chrome/browser/extensions/api/socket/socket.cc (right): http://codereview.chromium.org/10827390/diff/34002/chrome/browser/extensions/api/socket/socket.cc#newcode92 chrome/browser/extensions/api/socket/socket.cc:92: return net::ERR_FAILED; On 2012/09/26 21:02:44, miket wrote: > Good ...
8 years, 2 months ago (2012-09-26 23:03:57 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/justinlin@chromium.org/10827390/40002
8 years, 2 months ago (2012-09-28 00:16:06 UTC) #23
commit-bot: I haz the power
Change committed as 159172
8 years, 2 months ago (2012-09-28 01:34:13 UTC) #24
Mihai Parparita -not on Chrome
Once this change makes it to a canary build, feel free to send out an ...
8 years, 2 months ago (2012-09-28 14:41:03 UTC) #25
justinlin
8 years, 2 months ago (2012-10-01 21:47:16 UTC) #26
On 2012/09/28 14:41:03, Mihai Parparita wrote:
> Once this change makes it to a canary build, feel free to send out an email
> to chrome-apps-announce@ (internal) and
> chromium-apps@chromium.org(external) encouraging people to try it out.
> 
> Also, building a sample app that uses it (for
> http://github.com/GoogleChrome/chrome-app-samples) would be great too.
> 
> Mihai
> 
> On Thu, Sep 27, 2012 at 6:34 PM, <mailto:commit-bot@chromium.org> wrote:
> 
> > Change committed as 159172
> >
> >
>
https://chromiumcodereview.**appspot.com/10827390/%3Chttps://chromiumcoderevi...>
> >

Will do, I'll try to cleanup the small app I wrote for testing and submit it to
github.

Powered by Google App Engine
This is Rietveld 408576698