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

Issue 14471023: Refactor pooled socket request code to prepare for implementation of pretend-to-preconnect. (Closed)

Created:
7 years, 8 months ago by kouhei (in TOK)
Modified:
6 years, 2 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, haraken, tburkard
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Refactor pooled socket request code to prepare for implementation of pretend-to-preconnect. For pretend-to-preconnect details, please see BUG=235361 I am trying to resolve 2 major issues: 1. InitSocketPoolHelper is responsible for too many things: InitSocketPoolHelper is a all-in-one function which does all of the following: - make connection_group identifier string - decide which pool to use and make corresponding SocketParams - call RequestSocketForPool/RequestSocketsForPool depending on the context This patch separates the previous InitSocketPoolHelper function into the below components: - HostPortPairFromUrlForSession - ConnectionGroupForUrl - InvokeWithSocketParamsAndPool - RequestSocketForPool - RequestSocketsForPool Also, I tried to limit the scope of auto variables for clarity. 2. SSLSocketParams constructor accepting three SocketParams at once. SSLSocketParams constructor accepts all kind of SocketParams at once, but only one of them is used per instance. BUG=235361 TEST=net_unittests

Patch Set 1 #

Total comments: 2

Patch Set 2 : don't overload SSLSocketParams c-tor #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+473 lines, -329 lines) Patch
M net/http/http_proxy_client_socket_pool_spdy2_unittest.cc View 1 1 chunk +7 lines, -9 lines 0 comments Download
M net/http/http_proxy_client_socket_pool_spdy3_unittest.cc View 1 1 chunk +7 lines, -9 lines 0 comments Download
M net/socket/client_socket_pool.h View 1 chunk +0 lines, -10 lines 0 comments Download
M net/socket/client_socket_pool_manager.cc View 1 6 chunks +247 lines, -182 lines 1 comment Download
M net/socket/ssl_client_socket_pool.h View 1 2 chunks +36 lines, -9 lines 0 comments Download
M net/socket/ssl_client_socket_pool.cc View 1 3 chunks +75 lines, -5 lines 0 comments Download
M net/socket/ssl_client_socket_pool_unittest.cc View 1 1 chunk +37 lines, -11 lines 0 comments Download
M net/spdy/spdy_http_stream_spdy3_unittest.cc View 1 1 chunk +8 lines, -12 lines 0 comments Download
M net/spdy/spdy_session_spdy2_unittest.cc View 1 3 chunks +24 lines, -36 lines 0 comments Download
M net/spdy/spdy_session_spdy3_unittest.cc View 1 4 chunks +32 lines, -46 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
kouhei (in TOK)
Could you review this patch? Please forward if not appropriate.
7 years, 8 months ago (2013-04-25 07:14:00 UTC) #1
willchan no longer on Chromium
+mmenke On Apr 25, 2013 12:14 AM, <kouhei@chromium.org> wrote: > Reviewers: willchan, > > Message: ...
7 years, 8 months ago (2013-04-25 15:35:25 UTC) #2
mmenke
I'll try and get back to you later today. I'm not as familiar with ClientSocketPoolManager ...
7 years, 8 months ago (2013-04-25 15:50:42 UTC) #3
mmenke
Sorry for being slow. I think we may be going a bit overboard on templates ...
7 years, 7 months ago (2013-04-29 15:43:13 UTC) #4
mmenke
One other high[ish] level comment. https://codereview.chromium.org/14471023/diff/1/net/socket/ssl_client_socket_pool.h File net/socket/ssl_client_socket_pool.h (right): https://codereview.chromium.org/14471023/diff/1/net/socket/ssl_client_socket_pool.h#newcode52 net/socket/ssl_client_socket_pool.h:52: SSLSocketParams(const scoped_refptr<TransportSocketParams>& transport_params, I ...
7 years, 7 months ago (2013-04-29 16:15:46 UTC) #5
kouhei (in TOK)
Updated patch. Could you review? > Why is this a prerequisite for issue 235361? I ...
7 years, 7 months ago (2013-04-30 01:38:33 UTC) #6
mmenke
On 2013/04/30 01:38:33, Kouhei_UENO wrote: > Updated patch. Could you review? > > > Why ...
7 years, 7 months ago (2013-04-30 14:58:05 UTC) #7
kouhei (in TOK)
> I'm sorry about being so slow on this. No problem. FYI: This is the ...
7 years, 7 months ago (2013-05-01 08:06:23 UTC) #8
mmenke
7 years, 7 months ago (2013-05-01 19:31:12 UTC) #9
https://codereview.chromium.org/14471023/diff/7001/net/socket/client_socket_p...
File net/socket/client_socket_pool_manager.cc (right):

https://codereview.chromium.org/14471023/diff/7001/net/socket/client_socket_p...
net/socket/client_socket_pool_manager.cc:308: class RequestSocketForPool {
I think that these are sufficiently ugly that we should just get rid of them. 
Creating a single templated function that takes both sets of parameters, and
figures out which to use, works.  It isn't pretty, but the nested templates like
this just seems to ugly to me.

In the other CL, I suggested another way of doing this that avoids the need for
the callback, and is less prone to regress.

I'm also not convinced that we gain a whole lot by measuring at the network
level instead of the predictor level.  I think that histograming there would get
us much more important / useful data (If the potentially preconnected site was
visited).  I don't think the number of preconnects that we would have used for
each motivation is at all useful without that knowledge, and I don't think it
adds a whole lot of value on top of that knowledge, either.

I also think it wouldn't be unreasonable to improve our histograms a bit and
just enable preconnecting in the new cases on Canary, individually, and keep an
eye on the histograms.  The network histograms I suggest (May or may not already
be present):  How often a request can be served by an existing socket (Either
one already connected, or one currently being connected), how long requests have
to wait for idle sockets, and how many sockets we connect but never use.  Higher
level histograms, like time per request, may also be worth looking at, but tend
to be very noisy.

If you disagree, I'm fine with a temporary load flag, though I don't want to
keep it around too long.

Powered by Google App Engine
This is Rietveld 408576698