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

Issue 8824006: Migrate net/socket/socket.h, net/socket/stream_socket.h to base::Bind(). (Closed)

Created:
9 years ago by awong
Modified:
9 years ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, eroman, darin-cc_chromium.org, mmenke, Paweł Hajdan Jr.
Visibility:
Public.

Description

Migrate net/socket/socket.h, net/socket/stream_socket.h to base::Bind(). This changes Socket::Read(), Socket::Write, and StreamSocket::Connect() to use CompletionCallback and fixes all users. BUG=none TEST=existing. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=113825

Patch Set 1 #

Patch Set 2 : Chrome compiles. #

Patch Set 3 : win fixed #

Patch Set 4 : Audited code. #

Patch Set 5 : fully audited, and compiling on linux #

Patch Set 6 : small win fix #

Total comments: 4

Patch Set 7 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1424 lines, -3316 lines) Patch
M chrome/browser/chromeos/web_socket_proxy.cc View 1 2 3 7 chunks +10 lines, -18 lines 0 comments Download
M chrome/browser/extensions/api/socket/socket_api_controller.cc View 1 2 3 4 5 6 3 chunks +4 lines, -7 lines 0 comments Download
M chrome/browser/net/network_stats.h View 1 2 chunks +0 lines, -9 lines 0 comments Download
M chrome/browser/net/network_stats.cc View 1 5 chunks +8 lines, -11 lines 0 comments Download
M content/browser/renderer_host/p2p/socket_host_tcp.h View 1 1 chunk +0 lines, -4 lines 0 comments Download
M content/browser/renderer_host/p2p/socket_host_tcp.cc View 1 4 chunks +7 lines, -10 lines 0 comments Download
M content/browser/renderer_host/p2p/socket_host_test_utils.h View 1 2 3 6 chunks +5 lines, -36 lines 0 comments Download
M content/browser/renderer_host/p2p/socket_host_udp.h View 1 1 chunk +0 lines, -3 lines 0 comments Download
M content/browser/renderer_host/p2p/socket_host_udp.cc View 1 4 chunks +6 lines, -7 lines 0 comments Download
M content/browser/renderer_host/p2p/socket_host_udp_unittest.cc View 1 2 5 chunks +9 lines, -9 lines 0 comments Download
M content/browser/renderer_host/pepper_tcp_socket.h View 1 1 chunk +0 lines, -5 lines 0 comments Download
M content/browser/renderer_host/pepper_tcp_socket.cc View 1 2 5 chunks +13 lines, -13 lines 0 comments Download
M content/browser/renderer_host/pepper_udp_socket.h View 1 1 chunk +0 lines, -3 lines 0 comments Download
M content/browser/renderer_host/pepper_udp_socket.cc View 1 2 3 chunks +8 lines, -13 lines 0 comments Download
M content/renderer/p2p/p2p_transport_impl.h View 1 1 chunk +0 lines, -2 lines 0 comments Download
M content/renderer/p2p/p2p_transport_impl.cc View 1 3 chunks +4 lines, -7 lines 0 comments Download
M content/renderer/p2p/p2p_transport_impl_unittest.cc View 1 2 8 chunks +11 lines, -16 lines 0 comments Download
M jingle/glue/channel_socket_adapter.h View 1 2 3 3 chunks +2 lines, -6 lines 0 comments Download
M jingle/glue/channel_socket_adapter.cc View 1 2 7 chunks +23 lines, -51 lines 0 comments Download
M jingle/glue/channel_socket_adapter_unittest.cc View 1 2 3 4 6 chunks +8 lines, -7 lines 0 comments Download
M jingle/glue/pseudotcp_adapter.h View 1 2 1 chunk +1 line, -4 lines 0 comments Download
M jingle/glue/pseudotcp_adapter.cc View 1 2 3 17 chunks +30 lines, -122 lines 0 comments Download
M jingle/glue/pseudotcp_adapter_unittest.cc View 1 2 3 4 13 chunks +27 lines, -60 lines 0 comments Download
M jingle/notifier/base/chrome_async_socket.h View 1 1 chunk +0 lines, -6 lines 0 comments Download
M jingle/notifier/base/chrome_async_socket.cc View 1 5 chunks +13 lines, -13 lines 0 comments Download
M jingle/notifier/base/fake_ssl_client_socket.h View 1 2 3 chunks +1 line, -12 lines 0 comments Download
M jingle/notifier/base/fake_ssl_client_socket.cc View 1 2 12 chunks +14 lines, -51 lines 0 comments Download
M jingle/notifier/base/fake_ssl_client_socket_unittest.cc View 1 2 3 4 5 chunks +12 lines, -10 lines 0 comments Download
M jingle/notifier/base/proxy_resolving_client_socket.h View 1 2 2 chunks +1 line, -5 lines 0 comments Download
M jingle/notifier/base/proxy_resolving_client_socket.cc View 1 2 6 chunks +9 lines, -50 lines 0 comments Download
M jingle/notifier/base/proxy_resolving_client_socket_unittest.cc View 1 2 3 4 2 chunks +4 lines, -4 lines 0 comments Download
M net/base/net_log.h View 1 chunk +1 line, -4 lines 0 comments Download
M net/curvecp/client_packetizer.h View 1 2 3 chunks +2 lines, -6 lines 0 comments Download
M net/curvecp/client_packetizer.cc View 1 2 3 9 chunks +14 lines, -36 lines 0 comments Download
M net/curvecp/curvecp_client_socket.h View 1 2 2 chunks +4 lines, -8 lines 0 comments Download
M net/curvecp/curvecp_client_socket.cc View 1 2 2 chunks +2 lines, -11 lines 0 comments Download
M net/curvecp/curvecp_server_socket.h View 1 2 3 1 chunk +1 line, -4 lines 0 comments Download
M net/curvecp/curvecp_server_socket.cc View 1 2 1 chunk +1 line, -6 lines 0 comments Download
M net/curvecp/curvecp_transfer_unittest.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M net/curvecp/messenger.h View 1 2 3 3 chunks +2 lines, -7 lines 0 comments Download
M net/curvecp/messenger.cc View 1 2 7 chunks +20 lines, -49 lines 0 comments Download
M net/curvecp/packetizer.h View 1 chunk +1 line, -1 line 0 comments Download
M net/curvecp/server_packetizer.h View 2 chunks +1 line, -4 lines 0 comments Download
M net/curvecp/server_packetizer.cc View 4 chunks +6 lines, -8 lines 0 comments Download
M net/curvecp/test_client.h View 1 2 3 4 2 chunks +2 lines, -5 lines 0 comments Download
M net/curvecp/test_client.cc View 1 2 3 4 6 chunks +14 lines, -17 lines 0 comments Download
M net/curvecp/test_server.h View 1 2 3 4 1 chunk +0 lines, -2 lines 0 comments Download
M net/curvecp/test_server.cc View 1 2 3 4 4 chunks +9 lines, -8 lines 0 comments Download
M net/dns/dns_transaction.h View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download
M net/dns/dns_transaction.cc View 1 2 3 4 5 6 3 chunks +4 lines, -4 lines 0 comments Download
M net/ftp/ftp_network_transaction.h View 1 2 chunks +7 lines, -7 lines 0 comments Download
M net/ftp/ftp_network_transaction.cc View 11 chunks +16 lines, -20 lines 0 comments Download
M net/ftp/ftp_network_transaction_unittest.cc View 8 chunks +17 lines, -10 lines 0 comments Download
M net/ftp/ftp_transaction.h View 3 chunks +6 lines, -6 lines 0 comments Download
M net/http/http_network_transaction_unittest.cc View 1 2 3 4 5 6 4 chunks +10 lines, -8 lines 0 comments Download
M net/http/http_proxy_client_socket.h View 1 2 3 3 chunks +1 line, -6 lines 0 comments Download
M net/http/http_proxy_client_socket.cc View 1 2 3 8 chunks +14 lines, -62 lines 0 comments Download
M net/http/http_proxy_client_socket_pool.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M net/http/http_proxy_client_socket_pool.cc View 1 2 6 chunks +9 lines, -6 lines 0 comments Download
M net/http/http_stream_parser.h View 1 chunk +1 line, -1 line 0 comments Download
M net/http/http_stream_parser.cc View 1 2 3 4 5 6 7 chunks +9 lines, -7 lines 0 comments Download
M net/socket/client_socket_pool_base_unittest.cc View 1 2 3 4 5 6 9 chunks +13 lines, -19 lines 0 comments Download
M net/socket/deterministic_socket_data_unittest.cc View 5 chunks +6 lines, -8 lines 0 comments Download
M net/socket/socket.h View 1 2 2 chunks +1 line, -3 lines 0 comments Download
M net/socket/socket_test_util.h View 1 2 3 19 chunks +67 lines, -87 lines 0 comments Download
M net/socket/socket_test_util.cc View 1 2 3 4 38 chunks +131 lines, -345 lines 0 comments Download
M net/socket/socks5_client_socket.h View 1 2 3 4 chunks +2 lines, -7 lines 0 comments Download
M net/socket/socks5_client_socket.cc View 1 2 12 chunks +18 lines, -56 lines 0 comments Download
M net/socket/socks5_client_socket_unittest.cc View 1 10 chunks +13 lines, -13 lines 0 comments Download
M net/socket/socks_client_socket.h View 1 2 3 3 chunks +2 lines, -9 lines 0 comments Download
M net/socket/socks_client_socket.cc View 1 2 3 10 chunks +18 lines, -60 lines 0 comments Download
M net/socket/socks_client_socket_pool.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M net/socket/socks_client_socket_pool.cc View 1 2 3 chunks +4 lines, -3 lines 0 comments Download
M net/socket/socks_client_socket_unittest.cc View 1 10 chunks +12 lines, -12 lines 0 comments Download
M net/socket/ssl_client_socket_mac.h View 1 2 3 4 3 chunks +2 lines, -11 lines 0 comments Download
M net/socket/ssl_client_socket_mac.cc View 1 2 3 4 9 chunks +31 lines, -88 lines 0 comments Download
M net/socket/ssl_client_socket_nss.h View 1 2 3 4 5 6 4 chunks +2 lines, -11 lines 0 comments Download
M net/socket/ssl_client_socket_nss.cc View 1 2 3 4 5 6 13 chunks +44 lines, -134 lines 0 comments Download
M net/socket/ssl_client_socket_openssl.h View 1 2 3 chunks +3 lines, -8 lines 0 comments Download
M net/socket/ssl_client_socket_openssl.cc View 1 2 3 8 chunks +22 lines, -80 lines 0 comments Download
M net/socket/ssl_client_socket_pool.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M net/socket/ssl_client_socket_pool.cc View 1 2 6 chunks +9 lines, -6 lines 0 comments Download
M net/socket/ssl_client_socket_unittest.cc View 1 37 chunks +54 lines, -50 lines 0 comments Download
M net/socket/ssl_client_socket_win.h View 1 2 2 chunks +19 lines, -27 lines 0 comments Download
M net/socket/ssl_client_socket_win.cc View 1 2 12 chunks +42 lines, -130 lines 0 comments Download
M net/socket/ssl_server_socket_nss.h View 1 2 3 3 chunks +2 lines, -8 lines 0 comments Download
M net/socket/ssl_server_socket_nss.cc View 1 2 6 chunks +22 lines, -58 lines 0 comments Download
M net/socket/ssl_server_socket_unittest.cc View 1 2 12 chunks +49 lines, -78 lines 0 comments Download
M net/socket/stream_socket.h View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M net/socket/tcp_client_socket_libevent.h View 1 2 3 5 chunks +3 lines, -10 lines 0 comments Download
M net/socket/tcp_client_socket_libevent.cc View 1 2 6 chunks +13 lines, -98 lines 0 comments Download
M net/socket/tcp_client_socket_unittest.cc View 1 3 chunks +6 lines, -6 lines 0 comments Download
M net/socket/tcp_client_socket_win.h View 1 2 3 chunks +3 lines, -5 lines 0 comments Download
M net/socket/tcp_client_socket_win.cc View 1 2 6 chunks +13 lines, -90 lines 0 comments Download
M net/socket/tcp_server_socket_unittest.cc View 1 4 chunks +10 lines, -10 lines 0 comments Download
M net/socket/transport_client_socket_pool.h View 1 2 2 chunks +0 lines, -2 lines 0 comments Download
M net/socket/transport_client_socket_pool.cc View 1 2 3 chunks +7 lines, -10 lines 0 comments Download
M net/socket/transport_client_socket_pool_unittest.cc View 1 2 3 6 chunks +4 lines, -43 lines 0 comments Download
M net/socket/transport_client_socket_unittest.cc View 1 18 chunks +30 lines, -29 lines 0 comments Download
M net/socket/web_socket_server_socket.cc View 1 2 3 16 chunks +21 lines, -121 lines 0 comments Download
M net/socket/web_socket_server_socket_unittest.cc View 1 2 10 chunks +32 lines, -68 lines 0 comments Download
M net/socket_stream/socket_stream.h View 1 1 chunk +0 lines, -2 lines 0 comments Download
M net/socket_stream/socket_stream.cc View 9 chunks +11 lines, -12 lines 0 comments Download
M net/spdy/spdy_proxy_client_socket.h View 1 2 3 3 chunks +2 lines, -7 lines 0 comments Download
M net/spdy/spdy_proxy_client_socket.cc View 1 2 10 chunks +22 lines, -80 lines 0 comments Download
M net/spdy/spdy_proxy_client_socket_unittest.cc View 1 22 chunks +49 lines, -34 lines 0 comments Download
M net/spdy/spdy_session.h View 1 2 3 chunks +2 lines, -7 lines 0 comments Download
M net/spdy/spdy_session.cc View 1 2 9 chunks +19 lines, -19 lines 0 comments Download
M net/udp/datagram_server_socket.h View 2 chunks +2 lines, -2 lines 0 comments Download
M net/udp/udp_client_socket.h View 1 2 3 1 chunk +1 line, -3 lines 0 comments Download
M net/udp/udp_client_socket.cc View 1 2 1 chunk +1 line, -6 lines 0 comments Download
M net/udp/udp_server_socket.h View 1 chunk +2 lines, -2 lines 0 comments Download
M net/udp/udp_server_socket.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M net/udp/udp_socket_libevent.h View 1 2 7 chunks +6 lines, -12 lines 0 comments Download
M net/udp/udp_socket_libevent.cc View 1 2 6 chunks +16 lines, -60 lines 0 comments Download
M net/udp/udp_socket_unittest.cc View 7 chunks +11 lines, -10 lines 0 comments Download
M net/udp/udp_socket_win.h View 1 2 5 chunks +4 lines, -10 lines 0 comments Download
M net/udp/udp_socket_win.cc View 1 2 3 4 5 6 chunks +15 lines, -49 lines 0 comments Download
M net/url_request/url_request_ftp_job.h View 2 chunks +1 line, -4 lines 0 comments Download
M net/url_request/url_request_ftp_job.cc View 7 chunks +19 lines, -16 lines 0 comments Download
M remoting/jingle_glue/ssl_socket_adapter.h View 1 2 3 4 chunks +3 lines, -9 lines 0 comments Download
M remoting/jingle_glue/ssl_socket_adapter.cc View 1 2 12 chunks +17 lines, -51 lines 0 comments Download
M remoting/protocol/buffered_socket_writer.h View 1 1 chunk +0 lines, -2 lines 0 comments Download
M remoting/protocol/buffered_socket_writer.cc View 1 2 chunks +4 lines, -4 lines 0 comments Download
M remoting/protocol/fake_session.h View 1 2 3 4 chunks +2 lines, -9 lines 0 comments Download
M remoting/protocol/fake_session.cc View 1 2 6 chunks +4 lines, -49 lines 0 comments Download
M remoting/protocol/jingle_session_unittest.cc View 1 2 3 4 5 6 8 chunks +12 lines, -16 lines 0 comments Download
M remoting/protocol/jingle_stream_connector.h View 1 1 chunk +0 lines, -3 lines 0 comments Download
M remoting/protocol/jingle_stream_connector.cc View 1 2 chunks +5 lines, -5 lines 0 comments Download
M remoting/protocol/message_reader.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M remoting/protocol/message_reader.cc View 1 2 chunks +3 lines, -4 lines 0 comments Download
M remoting/protocol/pepper_stream_channel.h View 1 1 chunk +0 lines, -3 lines 0 comments Download
M remoting/protocol/pepper_stream_channel.cc View 1 2 chunks +3 lines, -4 lines 0 comments Download
M remoting/protocol/pepper_transport_socket_adapter.h View 1 2 3 2 chunks +2 lines, -7 lines 0 comments Download
M remoting/protocol/pepper_transport_socket_adapter.cc View 1 2 5 chunks +19 lines, -77 lines 0 comments Download
M remoting/protocol/socket_reader_base.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M remoting/protocol/socket_reader_base.cc View 1 2 chunks +3 lines, -4 lines 0 comments Download
M remoting/protocol/v1_client_channel_authenticator.h View 1 1 chunk +0 lines, -5 lines 0 comments Download
M remoting/protocol/v1_client_channel_authenticator.cc View 1 3 chunks +8 lines, -9 lines 0 comments Download
M remoting/protocol/v1_host_channel_authenticator.h View 1 1 chunk +0 lines, -2 lines 0 comments Download
M remoting/protocol/v1_host_channel_authenticator.cc View 1 2 chunks +6 lines, -6 lines 0 comments Download
M webkit/plugins/ppapi/ppb_transport_impl.h View 1 1 chunk +0 lines, -3 lines 0 comments Download
M webkit/plugins/ppapi/ppb_transport_impl.cc View 1 2 3 4 5 6 3 chunks +7 lines, -8 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
awong
SOCKET API CHANGE OF DOOM! I'd like to get this quickly so if you cannot ...
9 years ago (2011-12-08 19:44:24 UTC) #1
willchan no longer on Chromium
I thought James Hawkins was doing this piecemeal? Not that I care too much. I'll ...
9 years ago (2011-12-08 20:33:10 UTC) #2
dmichael (off chromium)
+viettrungluu, who is an OWNER for webkit/plugins/ppapi and more familiar with ppb_transport
9 years ago (2011-12-08 20:35:35 UTC) #3
awong
On Thu, Dec 8, 2011 at 12:33 PM, William Chan (陈智昌) <willchan@chromium.org>wrote: > I thought ...
9 years ago (2011-12-08 20:37:25 UTC) #4
willchan no longer on Chromium
net/ LGTM
9 years ago (2011-12-08 20:38:52 UTC) #5
mmenke
net/udp and net/url_request LGTM
9 years ago (2011-12-08 20:58:45 UTC) #6
Avi (use Gerrit)
chrome/content LGTM
9 years ago (2011-12-08 21:23:26 UTC) #7
awong
Thanks guys! Esp Will for doing more than his fair share. Now all that's left ...
9 years ago (2011-12-08 21:25:48 UTC) #8
viettrungluu
lgtm
9 years ago (2011-12-08 21:53:15 UTC) #9
Sergey Ulanov
remoting LGTM
9 years ago (2011-12-08 21:55:12 UTC) #10
awong
sync team is on an offsite today. Since the changes are so mechanical, csilv@ a ...
9 years ago (2011-12-08 23:25:32 UTC) #11
csilv
LGTM on jingle/* http://codereview.chromium.org/8824006/diff/14144/jingle/glue/channel_socket_adapter_unittest.cc File jingle/glue/channel_socket_adapter_unittest.cc (right): http://codereview.chromium.org/8824006/diff/14144/jingle/glue/channel_socket_adapter_unittest.cc#newcode4 jingle/glue/channel_socket_adapter_unittest.cc:4: nit: include base/bind.h, base/bind_helpers.h http://codereview.chromium.org/8824006/diff/14144/jingle/glue/pseudotcp_adapter.cc File ...
9 years ago (2011-12-09 00:41:59 UTC) #12
Robert Nagy
Hello, This patchset breaks builds on *BSDs so I assume that something is used here ...
9 years ago (2011-12-11 14:28:54 UTC) #13
awong
Quit possibly. gcc 4.2.x is no longer supported and I don't have a setup to ...
9 years ago (2011-12-11 18:25:58 UTC) #14
Robert Nagy
Well even the wiki page says that gcc >= 4.2 is supported, or am I ...
9 years ago (2011-12-11 19:33:02 UTC) #15
Robert Nagy
Same issue on net/socket/web_socket_server_socket.cc:325 On 2011/12/11 19:33:02, Robert Nagy wrote: > Well even the wiki ...
9 years ago (2011-12-12 11:03:44 UTC) #16
awong
I think that's slightly out of date. 4.2 support is on its way out. That ...
9 years ago (2011-12-12 18:56:48 UTC) #17
Robert Nagy
9 years ago (2011-12-12 19:20:10 UTC) #18
If you have a change that removes this, I can probably wait for that.
The only problem with removing 4.2 support is that, 4.2.1 is the last GPLv2
version of GCC and a lot of people just don't like using a GPLv3 compiler.

On 2011/12/12 18:56:48, awong wrote:
> I think that's slightly out of date.  4.2 support is on its way out.
> 
> That having been said, I expect to be removing this code soon as part of an
> unrelated change.  If you'd like, you can open a change bug on it.
> 
> -Albert
> 
> 
> On Mon, Dec 12, 2011 at 3:03 AM, <mailto:robert.nagy@gmail.com> wrote:
> 
> > Same issue on net/socket/web_socket_server_**socket.cc:325
> >
> >
> > On 2011/12/11 19:33:02, Robert Nagy wrote:
> >
> >> Well even the wiki page says that gcc >= 4.2 is supported, or am I lookin
> >> at
> >>
> > the
> >
> >> wrong location?
> >>
> >
> >  On 2011/12/11 18:25:58, awong wrote:
> >> > Quit possibly.  gcc 4.2.x is no longer supported and I don't have a
> >> setup
> >> > to test it easily.
> >> >
> >> > However, that error looks strange.  I would now have expected that
> >> error on
> >> > gcc 4.2.1....
> >> >
> >> > On Sun, Dec 11, 2011 at 6:28 AM, <mailto:robert.nagy@gmail.com> wrote:
> >> >
> >> > > Hello,
> >> > >
> >> > > This patchset breaks builds on *BSDs so I assume that something is
> >> used
> >> > > here
> >> > > which is not supported by older gcc since linux was not broken which
> >> uses
> >>
> > a
> >
> >> > > newer gcc than 4.2.1.
> >> > >
> >> > > net/http/http_proxy_client_****socket.cc: In member function
> >> 'virtual int
> >> > > net::HttpProxyClientSocket::****RestartWithAuth(net::**
> >> > > OldCompletionCallback*)':
> >> > > net/http/http_proxy_client_****socket.cc:77: error: no matching
> >> function
> >> > > for call to
> >> > > 'Bind(<unresolved overloaded function type>,
> >> > > base::internal::****UnretainedWrapper<****CallbackRunner<Tuple1<int>
> >> > >)'
> >> > >
> >> > >
> >> > >
> >> >
> >>
> >
> > http://codereview.chromium.****org/8824006/%25253Chttp://codere**
> > view.chromium.org/8824006/ <http://codereview.chromium.org/8824006/>>
> >
> >> > >
> >>
> >
> >
> >
>
http://codereview.chromium.**org/8824006/%3Chttp://codereview.chromium.org/88...>
> >

Powered by Google App Engine
This is Rietveld 408576698