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

Issue 240873003: Create WebSocketTransportClientSocketPool (Closed)

Created:
6 years, 8 months ago by Adam Rice
Modified:
6 years, 5 months ago
CC:
cbentzel+watch_chromium.org, chromium-reviews, erikwright+watch_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Create WebSocketTransportClientSocketPool It is a variant of TransportClientSocketPool that performs RFC6455-style connection throttling. Design doc: https://docs.google.com/a/chromium.org/document/d/1a8sUFQsbN5uve7ziW61ATkrFr3o9A-Tiyw8ig6T3puA/edit BUG=343107 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=279524

Patch Set 1 #

Patch Set 2 : Still very broken. #

Patch Set 3 : Still plenty of test failures. #

Patch Set 4 : Implement WebSocketTransportClientSocketPool without Base. #

Patch Set 5 : Fix IsStalled() and remove broken tests. #

Patch Set 6 : Minor fixes and comment tidying. #

Total comments: 6

Patch Set 7 : Document and test new LinkNode<> semantics. #

Patch Set 8 : Revert formatting change harder. #

Patch Set 9 : Factor out common code from *TransportClientSocketPool #

Patch Set 10 : Rebase. #

Patch Set 11 : Small cleanups and add tests. #

Patch Set 12 : Rebase. #

Total comments: 18

Patch Set 13 : Changes from tyoshino review. #

Total comments: 2

Patch Set 14 : Rename TransportClientJobCommon to TransportClientJobHelper #

Patch Set 15 : Remove WebSocketTransportClientSocketPool::CancelJob() #

Patch Set 16 : Add a comment explaining the timing of the net logging of the handle binding. Update copyright mess… #

Total comments: 10

Patch Set 17 : Factor out CurrentAddress() method in SubJob class. #

Total comments: 57

Patch Set 18 : Fixes from reviews and corrected stalled socket implementation. #

Patch Set 19 : Fixes for clang style complaints. #

Total comments: 32

Patch Set 20 : Fix re-entrancy and destruction issue. #

Total comments: 6

Patch Set 21 : Add missing header includes. Fix typos. #

Total comments: 12

Patch Set 22 : Add a comment that ActivateStalledRequest() is not called re-entrantly. #

Patch Set 23 : Header and comment fixes by tyoshino. #

Patch Set 24 : Rebase. #

Total comments: 14
Unified diffs Side-by-side diffs Delta from patch set Stats (+3575 lines, -631 lines) Patch
M base/containers/linked_list.h View 1 2 3 4 5 6 5 chunks +13 lines, -1 line 0 comments Download
M base/containers/linked_list_unittest.cc View 1 2 3 4 5 6 1 chunk +47 lines, -0 lines 0 comments Download
M net/http/http_stream_factory_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 3 chunks +0 lines, -9 lines 0 comments Download
M net/net.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 chunks +10 lines, -0 lines 0 comments Download
M net/socket/client_socket_pool_manager_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +16 lines, -6 lines 0 comments Download
M net/socket/transport_client_socket_pool.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 5 chunks +132 lines, -19 lines 10 comments Download
M net/socket/transport_client_socket_pool.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 14 chunks +161 lines, -154 lines 0 comments Download
A net/socket/transport_client_socket_pool_test_util.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +127 lines, -0 lines 2 comments Download
A net/socket/transport_client_socket_pool_test_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +421 lines, -0 lines 0 comments Download
M net/socket/transport_client_socket_pool_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 16 chunks +30 lines, -436 lines 0 comments Download
A net/socket/websocket_endpoint_lock_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +85 lines, -0 lines 0 comments Download
A net/socket/websocket_endpoint_lock_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +95 lines, -0 lines 0 comments Download
A net/socket/websocket_endpoint_lock_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +211 lines, -0 lines 0 comments Download
A net/socket/websocket_transport_client_socket_pool.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +245 lines, -0 lines 0 comments Download
A net/socket/websocket_transport_client_socket_pool.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +645 lines, -0 lines 0 comments Download
A net/socket/websocket_transport_client_socket_pool_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +1066 lines, -0 lines 2 comments Download
A net/socket/websocket_transport_connect_sub_job.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +90 lines, -0 lines 0 comments Download
A net/socket/websocket_transport_connect_sub_job.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +170 lines, -0 lines 0 comments Download
M net/websockets/websocket_basic_handshake_stream.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 chunks +2 lines, -0 lines 0 comments Download
M net/websockets/websocket_test_util.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -2 lines 0 comments Download
M net/websockets/websocket_test_util.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +7 lines, -4 lines 0 comments Download

Messages

Total messages: 44 (0 generated)
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/240873003/diff/100001/net/socket/client_socket_pool_manager_impl.cc File net/socket/client_socket_pool_manager_impl.cc (right): https://codereview.chromium.org/240873003/diff/100001/net/socket/client_socket_pool_manager_impl.cc#newcode92 net/socket/client_socket_pool_manager_impl.cc:92: net_log)), please revert style only change so that reviewers ...
6 years, 7 months ago (2014-05-22 05:20:03 UTC) #1
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/240873003/diff/100001/base/containers/linked_list.h File base/containers/linked_list.h (right): https://codereview.chromium.org/240873003/diff/100001/base/containers/linked_list.h#newcode112 base/containers/linked_list.h:112: this->previous_ = NULL; use 0 or NULL for both ...
6 years, 7 months ago (2014-05-22 06:04:00 UTC) #2
Adam Rice
https://codereview.chromium.org/240873003/diff/100001/base/containers/linked_list.h File base/containers/linked_list.h (right): https://codereview.chromium.org/240873003/diff/100001/base/containers/linked_list.h#newcode112 base/containers/linked_list.h:112: this->previous_ = NULL; On 2014/05/22 06:04:01, tyoshino wrote: > ...
6 years, 7 months ago (2014-05-22 06:49:07 UTC) #3
Adam Rice
https://codereview.chromium.org/240873003/diff/100001/net/socket/websocket_transport_client_socket_pool.cc File net/socket/websocket_transport_client_socket_pool.cc (right): https://codereview.chromium.org/240873003/diff/100001/net/socket/websocket_transport_client_socket_pool.cc#newcode502 net/socket/websocket_transport_client_socket_pool.cc:502: DCHECK(!connect_timing_.connect_start.is_null()); On 2014/05/22 06:04:01, tyoshino wrote: > please try ...
6 years, 7 months ago (2014-05-22 14:08:00 UTC) #4
Adam Rice
Ready for review. PTAL.
6 years, 6 months ago (2014-06-10 07:04:30 UTC) #5
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/240873003/diff/220001/net/socket/client_socket_pool_manager_impl.cc File net/socket/client_socket_pool_manager_impl.cc (right): https://codereview.chromium.org/240873003/diff/220001/net/socket/client_socket_pool_manager_impl.cc#newcode76 net/socket/client_socket_pool_manager_impl.cc:76: net_log)), do we need to set WebSocketTransportClientSocketPool to transport_socket_pool_?
6 years, 6 months ago (2014-06-11 03:32:54 UTC) #6
Adam Rice
https://codereview.chromium.org/240873003/diff/220001/net/socket/client_socket_pool_manager_impl.cc File net/socket/client_socket_pool_manager_impl.cc (right): https://codereview.chromium.org/240873003/diff/220001/net/socket/client_socket_pool_manager_impl.cc#newcode76 net/socket/client_socket_pool_manager_impl.cc:76: net_log)), On 2014/06/11 03:32:54, tyoshino wrote: > do we ...
6 years, 6 months ago (2014-06-11 05:33:42 UTC) #7
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/240873003/diff/220001/net/socket/client_socket_pool_manager_impl.cc File net/socket/client_socket_pool_manager_impl.cc (right): https://codereview.chromium.org/240873003/diff/220001/net/socket/client_socket_pool_manager_impl.cc#newcode63 net/socket/client_socket_pool_manager_impl.cc:63: ? static_cast<TransportClientSocketPool*>( remove static_cast? https://codereview.chromium.org/240873003/diff/220001/net/socket/transport_client_socket_pool.h File net/socket/transport_client_socket_pool.h (right): https://codereview.chromium.org/240873003/diff/220001/net/socket/transport_client_socket_pool.h#newcode60 ...
6 years, 6 months ago (2014-06-11 06:46:45 UTC) #8
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/240873003/diff/220001/net/socket/websocket_transport_client_socket_pool.cc File net/socket/websocket_transport_client_socket_pool.cc (right): https://codereview.chromium.org/240873003/diff/220001/net/socket/websocket_transport_client_socket_pool.cc#newcode680 net/socket/websocket_transport_client_socket_pool.cc:680: void WebSocketTransportClientSocketPool::AddHigherLayeredPool( no need to override? https://codereview.chromium.org/240873003/diff/220001/net/socket/websocket_transport_client_socket_pool.cc#newcode687 net/socket/websocket_transport_client_socket_pool.cc:687: void ...
6 years, 6 months ago (2014-06-11 06:55:05 UTC) #9
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/240873003/diff/220001/net/socket/websocket_transport_client_socket_pool.cc File net/socket/websocket_transport_client_socket_pool.cc (right): https://codereview.chromium.org/240873003/diff/220001/net/socket/websocket_transport_client_socket_pool.cc#newcode574 net/socket/websocket_transport_client_socket_pool.cc:574: connect_job->net_log().source().ToEventParametersCallback()); should we log this even when rv == ...
6 years, 6 months ago (2014-06-11 07:55:11 UTC) #10
Adam Rice
https://codereview.chromium.org/240873003/diff/220001/net/socket/client_socket_pool_manager_impl.cc File net/socket/client_socket_pool_manager_impl.cc (right): https://codereview.chromium.org/240873003/diff/220001/net/socket/client_socket_pool_manager_impl.cc#newcode63 net/socket/client_socket_pool_manager_impl.cc:63: ? static_cast<TransportClientSocketPool*>( On 2014/06/11 06:46:45, tyoshino wrote: > remove ...
6 years, 6 months ago (2014-06-11 08:17:09 UTC) #11
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/240873003/diff/220001/net/socket/transport_client_socket_pool.h File net/socket/transport_client_socket_pool.h (right): https://codereview.chromium.org/240873003/diff/220001/net/socket/transport_client_socket_pool.h#newcode60 net/socket/transport_client_socket_pool.h:60: class NET_EXPORT_PRIVATE TransportConnectJobCommon { On 2014/06/11 08:17:09, Adam Rice ...
6 years, 6 months ago (2014-06-11 08:22:22 UTC) #12
Adam Rice
https://codereview.chromium.org/240873003/diff/240001/net/socket/websocket_transport_client_socket_pool_unittest.cc File net/socket/websocket_transport_client_socket_pool_unittest.cc (right): https://codereview.chromium.org/240873003/diff/240001/net/socket/websocket_transport_client_socket_pool_unittest.cc#newcode1 net/socket/websocket_transport_client_socket_pool_unittest.cc:1: // Copyright (c) 2012 The Chromium Authors. All rights ...
6 years, 6 months ago (2014-06-11 08:28:28 UTC) #13
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/240873003/diff/300001/net/socket/websocket_transport_client_socket_pool.cc File net/socket/websocket_transport_client_socket_pool.cc (right): https://codereview.chromium.org/240873003/diff/300001/net/socket/websocket_transport_client_socket_pool.cc#newcode54 net/socket/websocket_transport_client_socket_pool.cc:54: // the call to RememberSocket(). maybe this should be ...
6 years, 6 months ago (2014-06-12 06:39:21 UTC) #14
Adam Rice
https://codereview.chromium.org/240873003/diff/300001/net/socket/websocket_transport_client_socket_pool.cc File net/socket/websocket_transport_client_socket_pool.cc (right): https://codereview.chromium.org/240873003/diff/300001/net/socket/websocket_transport_client_socket_pool.cc#newcode54 net/socket/websocket_transport_client_socket_pool.cc:54: // the call to RememberSocket(). On 2014/06/12 06:39:20, tyoshino ...
6 years, 6 months ago (2014-06-12 10:17:33 UTC) #15
Adam Rice
+jgraettinger, please take a look.
6 years, 6 months ago (2014-06-16 10:20:42 UTC) #16
Adam Rice
+eroman Please review the LinkedList<T> changes.
6 years, 6 months ago (2014-06-16 10:26:17 UTC) #17
Johnny
Looks good in general, though there's a lot here and I'm not confident my review ...
6 years, 6 months ago (2014-06-16 23:41:11 UTC) #18
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/240873003/diff/320001/net/socket/transport_client_socket_pool.h File net/socket/transport_client_socket_pool.h (right): https://codereview.chromium.org/240873003/diff/320001/net/socket/transport_client_socket_pool.h#newcode316 net/socket/transport_client_socket_pool.h:316: case STATE_RESOLVE_HOST: DCHECK_EQ(OK, rv); https://codereview.chromium.org/240873003/diff/320001/net/socket/websocket_transport_client_socket_pool.cc File net/socket/websocket_transport_client_socket_pool.cc (right): https://codereview.chromium.org/240873003/diff/320001/net/socket/websocket_transport_client_socket_pool.cc#newcode78 ...
6 years, 6 months ago (2014-06-18 06:49:43 UTC) #19
Adam Rice
Sorry for the volume of changes. There's more files, but less lines in each one. ...
6 years, 6 months ago (2014-06-19 13:55:21 UTC) #20
Adam Rice
-eroman, +darin for base::LinkedList<> changes OWNER approval.
6 years, 6 months ago (2014-06-19 13:56:20 UTC) #21
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/240873003/diff/320001/net/socket/websocket_transport_client_socket_pool.cc File net/socket/websocket_transport_client_socket_pool.cc (right): https://codereview.chromium.org/240873003/diff/320001/net/socket/websocket_transport_client_socket_pool.cc#newcode360 net/socket/websocket_transport_client_socket_pool.cc:360: // LOAD_STATE_CONNECTING is better than On 2014/06/19 13:55:20, Adam ...
6 years, 6 months ago (2014-06-20 12:12:07 UTC) #22
Johnny
This looks good to me. My only remaining question is whether there are potential re-entrance ...
6 years, 6 months ago (2014-06-20 21:32:58 UTC) #23
darin (slow to review)
src/base/ changes LGTM
6 years, 6 months ago (2014-06-21 04:04:06 UTC) #24
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/240873003/diff/360001/net/socket/websocket_endpoint_lock_manager_unittest.cc File net/socket/websocket_endpoint_lock_manager_unittest.cc (right): https://codereview.chromium.org/240873003/diff/360001/net/socket/websocket_endpoint_lock_manager_unittest.cc#newcode6 net/socket/websocket_endpoint_lock_manager_unittest.cc:6: include net_errors.h https://codereview.chromium.org/240873003/diff/360001/net/socket/websocket_endpoint_lock_manager_unittest.cc#newcode16 net/socket/websocket_endpoint_lock_manager_unittest.cc:16: // A SocketStream implementation with ...
6 years, 6 months ago (2014-06-23 09:31:36 UTC) #25
Adam Rice
https://codereview.chromium.org/240873003/diff/360001/net/socket/websocket_endpoint_lock_manager.h File net/socket/websocket_endpoint_lock_manager.h (right): https://codereview.chromium.org/240873003/diff/360001/net/socket/websocket_endpoint_lock_manager.h#newcode57 net/socket/websocket_endpoint_lock_manager.h:57: // Checks that |endpoint_job_map_| and |socket_endpoint_map_| are empty. For ...
6 years, 6 months ago (2014-06-23 10:06:27 UTC) #26
Johnny
LGTM for net
6 years, 6 months ago (2014-06-23 16:10:00 UTC) #27
Adam Rice
https://codereview.chromium.org/240873003/diff/360001/net/socket/websocket_endpoint_lock_manager_unittest.cc File net/socket/websocket_endpoint_lock_manager_unittest.cc (right): https://codereview.chromium.org/240873003/diff/360001/net/socket/websocket_endpoint_lock_manager_unittest.cc#newcode6 net/socket/websocket_endpoint_lock_manager_unittest.cc:6: On 2014/06/23 09:31:35, tyoshino wrote: > include net_errors.h Done. ...
6 years, 6 months ago (2014-06-24 02:12:08 UTC) #28
tyoshino (SeeGerritForStatus)
lgtm https://codereview.chromium.org/240873003/diff/380001/net/socket/transport_client_socket_pool_test_util.cc File net/socket/transport_client_socket_pool_test_util.cc (right): https://codereview.chromium.org/240873003/diff/380001/net/socket/transport_client_socket_pool_test_util.cc#newcode9 net/socket/transport_client_socket_pool_test_util.cc:9: #include "base/run_loop.h" include base/logging.h https://codereview.chromium.org/240873003/diff/380001/net/socket/transport_client_socket_pool_test_util.cc#newcode13 net/socket/transport_client_socket_pool_test_util.cc:13: #include "net/base/net_util.h" ...
6 years, 6 months ago (2014-06-24 05:46:53 UTC) #29
Adam Rice
https://codereview.chromium.org/240873003/diff/380001/net/socket/transport_client_socket_pool_test_util.cc File net/socket/transport_client_socket_pool_test_util.cc (right): https://codereview.chromium.org/240873003/diff/380001/net/socket/transport_client_socket_pool_test_util.cc#newcode9 net/socket/transport_client_socket_pool_test_util.cc:9: #include "base/run_loop.h" On 2014/06/24 05:46:52, tyoshino wrote: > include ...
6 years, 6 months ago (2014-06-24 06:28:38 UTC) #30
Adam Rice
The CQ bit was checked by ricea@chromium.org
6 years, 6 months ago (2014-06-24 09:52:47 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ricea@chromium.org/240873003/480001
6 years, 6 months ago (2014-06-24 09:53:46 UTC) #32
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_gpu_triggered_tests on tryserver.chromium.gpu ...
6 years, 6 months ago (2014-06-24 12:54:22 UTC) #33
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-24 13:28:29 UTC) #34
commit-bot: I haz the power
Try jobs failed on following builders: win_gpu_triggered_tests on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/win_gpu_triggered_tests/builds/21363)
6 years, 6 months ago (2014-06-24 13:28:30 UTC) #35
Adam Rice
The CQ bit was checked by ricea@chromium.org
6 years, 6 months ago (2014-06-24 22:47:15 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ricea@chromium.org/240873003/480001
6 years, 6 months ago (2014-06-24 22:49:04 UTC) #37
commit-bot: I haz the power
Change committed as 279524
6 years, 6 months ago (2014-06-24 22:53:36 UTC) #38
Ryan Sleevi
Hi Adam, I was alerted to this change earlier, and I apologize for not noticing ...
6 years, 5 months ago (2014-07-08 18:50:03 UTC) #39
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/240873003/diff/480001/net/socket/transport_client_socket_pool.h File net/socket/transport_client_socket_pool.h (right): https://codereview.chromium.org/240873003/diff/480001/net/socket/transport_client_socket_pool.h#newcode88 net/socket/transport_client_socket_pool.h:88: Sorry about this. I saw use of ClientSocketPoolBaseHelper and ...
6 years, 5 months ago (2014-07-09 00:17:40 UTC) #40
Ryan Sleevi
https://codereview.chromium.org/240873003/diff/480001/net/socket/transport_client_socket_pool.h File net/socket/transport_client_socket_pool.h (right): https://codereview.chromium.org/240873003/diff/480001/net/socket/transport_client_socket_pool.h#newcode88 net/socket/transport_client_socket_pool.h:88: On 2014/07/09 00:17:40, tyoshino wrote: > Sorry about this. ...
6 years, 5 months ago (2014-07-09 00:20:46 UTC) #41
Adam Rice
Ryan, Thank you for your review. I am happy to meet with you to discuss ...
6 years, 5 months ago (2014-07-09 08:33:03 UTC) #42
Ryan Sleevi
On 2014/07/09 08:33:03, Adam Rice wrote: > Ryan, > > Thank you for your review. ...
6 years, 5 months ago (2014-07-09 22:48:07 UTC) #43
Adam Rice
6 years, 5 months ago (2014-07-10 03:35:21 UTC) #44
Message was sent while issue was closed.
On 2014/07/09 22:48:07, Ryan Sleevi wrote:
>
https://codereview.chromium.org/240873003/diff/480001/net/socket/transport_cl...
> > net/socket/transport_client_socket_pool.h:246: const
> > scoped_refptr<TransportSocketParams>* casted_params);
> > On 2014/07/08 18:50:02, Ryan Sleevi wrote:
> > > This doesn't look right at all. A pointer to a const scoped-refptr?
> > 
> > Whereas the void* argument to RequestSocket() is totally cool?
> 
> I'm not sure your point? We should always strive to do the best, independent
of
> what other code.

The point is that you look at that type and say "wtf?". Which is the correct
response. But it's the same type that is being passed into RequestSocket(),
disguised as void*. By wearing its ugliness on its sleeve, it is intended to
help the reader understand what is going on.

> (And no, it's not ideal, but it's an entirely separate rationale. I'm solely
> looking at this code in isolation)

This CL has an explicit design goal of not damaging the readability or
performance
of the existing code. Looking at it in isolation it is impossible to see how far
it
falls short of that goal.

Powered by Google App Engine
This is Rietveld 408576698