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

Issue 23454010: POSIX only: Move client socket functionality from TCPClientSocket into TCPSocket. (Closed)

Created:
7 years, 3 months ago by yzshen1
Modified:
7 years, 3 months ago
Reviewers:
wtc, akalin
CC:
chromium-reviews, cbentzel+watch_chromium.org, Wez
Visibility:
Public.

Description

POSIX only: Move client socket functionality from TCPClientSocket into TCPSocket. TCPClientSocket becomes a wrapper around TCPSocket to expose a client-only interface. BUG=262601 TEST=tcp_socket_unittest.cc Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=223945

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 6

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 46

Patch Set 7 : #

Patch Set 8 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+909 lines, -1252 lines) Patch
M net/net.gyp View 1 2 2 chunks +1 line, -4 lines 0 comments Download
M net/socket/tcp_client_socket.h View 1 2 3 4 2 chunks +1 line, -26 lines 0 comments Download
M net/socket/tcp_client_socket.cc View 1 2 3 4 3 chunks +0 lines, -53 lines 0 comments Download
D net/socket/tcp_client_socket_libevent.h View 1 2 1 chunk +0 lines, -256 lines 0 comments Download
D net/socket/tcp_client_socket_libevent.cc View 1 2 1 chunk +0 lines, -830 lines 0 comments Download
M net/socket/tcp_server_socket.cc View 1 2 3 4 2 chunks +1 line, -20 lines 0 comments Download
M net/socket/tcp_socket.h View 2 chunks +8 lines, -0 lines 0 comments Download
A net/socket/tcp_socket.cc View 1 2 3 4 5 6 1 chunk +59 lines, -0 lines 0 comments Download
M net/socket/tcp_socket_libevent.h View 1 2 3 4 5 6 2 chunks +177 lines, -14 lines 0 comments Download
M net/socket/tcp_socket_libevent.cc View 1 2 3 4 5 6 7 10 chunks +662 lines, -42 lines 0 comments Download
M net/socket/tcp_socket_unittest.cc View 1 2 3 4 3 chunks +0 lines, -7 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
yzshen1
Hi, Fred and Wan-Teh. Would you please take a look? Thanks!
7 years, 3 months ago (2013-09-05 21:32:33 UTC) #1
akalin
few nits, will wait for other CL to land and then I'll review again https://codereview.chromium.org/23454010/diff/3002/net/socket/tcp_server_socket.cc ...
7 years, 3 months ago (2013-09-05 22:58:12 UTC) #2
yzshen1
Thanks Fred! https://codereview.chromium.org/23454010/diff/3002/net/socket/tcp_server_socket.cc File net/socket/tcp_server_socket.cc (right): https://codereview.chromium.org/23454010/diff/3002/net/socket/tcp_server_socket.cc#newcode93 net/socket/tcp_server_socket.cc:93: *output_accepted_socket = client_socket.Pass(); On 2013/09/05 22:58:12, akalin ...
7 years, 3 months ago (2013-09-06 17:19:44 UTC) #3
yzshen1
Hi, Wan-Teh and Fred. I have updated the code and addressed issues that you raised ...
7 years, 3 months ago (2013-09-13 06:56:18 UTC) #4
wtc
Patch set 6 LGTM. Did someone suggest the use of Closure in the Watcher class? ...
7 years, 3 months ago (2013-09-13 22:22:44 UTC) #5
yzshen1
Thanks Wan-Teh! https://codereview.chromium.org/23454010/diff/23001/net/socket/tcp_socket.cc File net/socket/tcp_socket.cc (right): https://codereview.chromium.org/23454010/diff/23001/net/socket/tcp_socket.cc#newcode47 net/socket/tcp_socket.cc:47: } On 2013/09/13 22:22:44, wtc wrote: > ...
7 years, 3 months ago (2013-09-13 23:52:40 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yzshen@chromium.org/23454010/33001
7 years, 3 months ago (2013-09-18 04:46:38 UTC) #7
commit-bot: I haz the power
Retried try job too often on linux_rel for step(s) content_browsertests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_rel&number=169129
7 years, 3 months ago (2013-09-18 06:05:50 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yzshen@chromium.org/23454010/73001
7 years, 3 months ago (2013-09-18 19:03:27 UTC) #9
commit-bot: I haz the power
Change committed as 223945
7 years, 3 months ago (2013-09-18 21:50:28 UTC) #10
wtc
Patch set 8 (what you committed) LGTM. Thanks! https://codereview.chromium.org/23454010/diff/23001/net/socket/tcp_socket_libevent.cc File net/socket/tcp_socket_libevent.cc (right): https://codereview.chromium.org/23454010/diff/23001/net/socket/tcp_socket_libevent.cc#newcode158 net/socket/tcp_socket_libevent.cc:158: Close(); ...
7 years, 3 months ago (2013-09-18 23:26:16 UTC) #11
yzshen1
7 years, 3 months ago (2013-09-18 23:40:34 UTC) #12
Message was sent while issue was closed.
Thank you Wan-Teh!

Btw, I realized I didn't reply to one of your question earlier:
> Did someone suggest the use of Closure in the Watcher class?
> That is one big change to the original code. This change is
> fine by me. I am just curious where it comes from.

I did this change because it looks nicer this way. Previously TCPSocketLibevent
inherited MessageLoopForIO::Watcher itself for Accept(). And migrating the
client socket operations would have added two more subclasses of
MessageLoopForIO::Watcher for Read() and Write(). It seems better to have a
single class to handle all the three cases.

https://codereview.chromium.org/23454010/diff/23001/net/socket/tcp_socket_lib...
File net/socket/tcp_socket_libevent.cc (right):

https://codereview.chromium.org/23454010/diff/23001/net/socket/tcp_socket_lib...
net/socket/tcp_socket_libevent.cc:158: Close();
On 2013/09/18 23:26:17, wtc wrote:
> 
> On 2013/09/13 23:52:40, yzshen1 wrote:
> > That will reset |tcp_fastopen_connected_| and cause the previous if-block to
> > never run.
> 
> I see. So the original code worked because it never reset
> tcp_fastopen_connected_ to false, right?

Right. It is never set to false again.

https://codereview.chromium.org/23454010/diff/23001/net/socket/tcp_socket_lib...
File net/socket/tcp_socket_libevent.h (right):

https://codereview.chromium.org/23454010/diff/23001/net/socket/tcp_socket_lib...
net/socket/tcp_socket_libevent.h:192: Watcher write_watcher_;
I see. I will look into the code and see whether it is okay to merge the two.

On 2013/09/18 23:26:17, wtc wrote:
> 
> On 2013/09/13 23:52:40, yzshen1 wrote:
> > I slightly prefer to have one Watcher object for each FileDescriptorWatcher.
> > That is also what the original code did. What do you think?
> 
> We should use Watcher in the intended way. It is fine to
> match the original code in the first iteration. If one
> Watcher object can handle both Read and Write, we should
> give that a try. (I am not familiar with Watcher, so I
> don't know if this is a good idea.)

Powered by Google App Engine
This is Rietveld 408576698