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

Issue 2815993002: Adds a method to TCPServerSocket to adopt a socket. (Closed)

Created:
3 years, 8 months ago by Raul Vera
Modified:
3 years, 7 months ago
Reviewers:
ortuno, *mmenke
CC:
cbentzel+watch_chromium.org, chromium-reviews, dvallet, net-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Adds a method to TCPServerSocket to adopt a socket. This is used by headless to adopt a socket opened by a parent process for remote debugging. In order to keep the interfaces as regular as possible, this also renames and adds a few methods to the underlying TCPSocketWin, TCPSocketPosix, and SocketPosix classes. The method rename resulted in bluetooth code changing, so ortuno@ is added as an owner reviewer for the bluetooth code. Also adds tests for the Adopt[C|Unc]onnectedSocket methods. The server method is just a single line, so there is no explicit test for it. The Dependent Patchset below uses this new method to adopt the socket as the devtools remote-debug server connection. BUG=624837 Review-Url: https://codereview.chromium.org/2815993002 Cr-Commit-Position: refs/heads/master@{#468793} Committed: https://chromium.googlesource.com/chromium/src/+/26f0a139eaac0d4554cd83c9b736724d2c6553be

Patch Set 1 #

Patch Set 2 : Fixed (I hope) Windows compile failure. #

Total comments: 8

Patch Set 3 : Corrected typo in new method name. #

Patch Set 4 : Refactored Adopt...Socket methods per mmenke's review comments #

Patch Set 5 : Rebased to fix merge conflict #

Total comments: 17

Patch Set 6 : Improved AdoptConnectedSocket test, per review. #

Patch Set 7 : Fixed typo in Windows code. #

Total comments: 6

Patch Set 8 : Refined GetSocketDescriptor per review. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+135 lines, -22 lines) Patch
M device/bluetooth/bluetooth_socket_win.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M net/socket/socket_posix.h View 1 2 3 4 5 1 chunk +9 lines, -1 line 0 comments Download
M net/socket/socket_posix.cc View 1 2 3 4 5 2 chunks +9 lines, -1 line 0 comments Download
M net/socket/tcp_server_socket.h View 1 2 3 4 5 2 chunks +7 lines, -0 lines 0 comments Download
M net/socket/tcp_server_socket.cc View 1 2 3 4 5 2 chunks +5 lines, -0 lines 0 comments Download
M net/socket/tcp_socket_posix.h View 1 2 3 4 5 6 7 3 chunks +16 lines, -2 lines 0 comments Download
M net/socket/tcp_socket_posix.cc View 1 2 3 4 5 6 7 3 chunks +18 lines, -2 lines 0 comments Download
M net/socket/tcp_socket_unittest.cc View 1 2 3 4 5 6 7 2 chunks +45 lines, -7 lines 0 comments Download
M net/socket/tcp_socket_win.h View 1 2 3 4 5 6 7 3 chunks +16 lines, -6 lines 0 comments Download
M net/socket/tcp_socket_win.cc View 1 2 3 4 5 6 7 3 chunks +9 lines, -2 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 60 (42 generated)
Raul Vera
Hi Jana, Andrew McGregor gave me your name as an appropriate owner to review a ...
3 years, 8 months ago (2017-04-13 01:59:54 UTC) #4
Jana
+mmenke, since he's better suited. https://codereview.chromium.org/2815993002/diff/20001/net/socket/tcp_server_socket.h File net/socket/tcp_server_socket.h (right): https://codereview.chromium.org/2815993002/diff/20001/net/socket/tcp_server_socket.h#newcode35 net/socket/tcp_server_socket.h:35: int AdopListeningRawSocket(int socket_fd); Use ...
3 years, 8 months ago (2017-04-17 17:27:58 UTC) #15
mmenke
https://codereview.chromium.org/2815993002/diff/20001/net/socket/tcp_server_socket.cc File net/socket/tcp_server_socket.cc (right): https://codereview.chromium.org/2815993002/diff/20001/net/socket/tcp_server_socket.cc#newcode24 net/socket/tcp_server_socket.cc:24: return socket_.AdoptConnectedSocket(socket_fd, IPEndPoint()); Using IPEndPoint() seems to violate the ...
3 years, 8 months ago (2017-04-17 17:42:18 UTC) #16
Raul Vera
Thanks for the review. Replies in the file comments. https://codereview.chromium.org/2815993002/diff/20001/net/socket/tcp_server_socket.cc File net/socket/tcp_server_socket.cc (right): https://codereview.chromium.org/2815993002/diff/20001/net/socket/tcp_server_socket.cc#newcode24 net/socket/tcp_server_socket.cc:24: ...
3 years, 8 months ago (2017-04-17 23:51:57 UTC) #17
mmenke
https://codereview.chromium.org/2815993002/diff/20001/net/socket/tcp_server_socket.cc File net/socket/tcp_server_socket.cc (right): https://codereview.chromium.org/2815993002/diff/20001/net/socket/tcp_server_socket.cc#newcode24 net/socket/tcp_server_socket.cc:24: return socket_.AdoptConnectedSocket(socket_fd, IPEndPoint()); On 2017/04/17 23:51:57, Raul Vera wrote: ...
3 years, 8 months ago (2017-04-18 16:15:25 UTC) #18
Raul Vera
OK. I see your points now. Thanks. I've refactored a bit to ensure that SocketPosix, ...
3 years, 8 months ago (2017-04-19 02:45:02 UTC) #19
Raul Vera
PTAL. Longer response below.
3 years, 8 months ago (2017-04-19 02:46:32 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2815993002/60001
3 years, 8 months ago (2017-04-19 02:47:05 UTC) #23
commit-bot: I haz the power
All required reviewers (with asterisk prefixes) have not yet approved this CL. No L-G-T-M from ...
3 years, 8 months ago (2017-04-19 02:47:07 UTC) #25
ortuno
lgtm. I didn't get an email about this O.O It might have been the '*' ...
3 years, 8 months ago (2017-04-20 06:13:28 UTC) #37
mmenke
Looking pretty good, thanks for updating things on Windows, too! https://codereview.chromium.org/2815993002/diff/80001/net/socket/socket_posix.cc File net/socket/socket_posix.cc (right): https://codereview.chromium.org/2815993002/diff/80001/net/socket/socket_posix.cc#newcode104 ...
3 years, 8 months ago (2017-04-21 19:20:38 UTC) #38
mmenke
Also, note that there's a "CQ dry run" button, so you don't have to get ...
3 years, 8 months ago (2017-04-21 19:22:32 UTC) #39
Raul Vera
Hi Matt, Here is my latest version. Have I paid enough technical debt yet? :-) ...
3 years, 7 months ago (2017-05-01 05:35:25 UTC) #46
mmenke
One more (hopefully minor) piece of technical debt I'd like to pay down: The double ...
3 years, 7 months ago (2017-05-01 18:44:19 UTC) #47
Raul Vera
Thanks Matt, No worries about the technical debt. It's just such a classic Google thing ...
3 years, 7 months ago (2017-05-02 00:08:53 UTC) #49
mmenke
LGTM, thanks!
3 years, 7 months ago (2017-05-02 15:44:01 UTC) #54
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2815993002/140001
3 years, 7 months ago (2017-05-02 22:19:10 UTC) #57
commit-bot: I haz the power
3 years, 7 months ago (2017-05-02 22:26:04 UTC) #60
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://chromium.googlesource.com/chromium/src/+/26f0a139eaac0d4554cd83c9b736...

Powered by Google App Engine
This is Rietveld 408576698