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

Issue 3171017: Only create the backup ConnectJob when it is needed. (Closed)

Created:
10 years, 4 months ago by willchan no longer on Chromium
Modified:
9 years, 7 months ago
Reviewers:
Mike Belshe
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org
Base URL:
http://src.chromium.org/git/chromium.git
Visibility:
Public.

Description

Only create the backup ConnectJob when it is needed. This reduces the unnecessary NetLog spam, since we would log to the NetLog everytime we created the backup ConnectJob, even though we usually wouldn't actually call Connect() on it. Now, we only create the backup ConnectJob when we intend to call Connect() on it. Includes some various cleanup necessary for this: * struct Group => class Group * method_factory moves from CSP to Group

Patch Set 1 #

Patch Set 2 : Fix a leak. More cleanups. #

Total comments: 4

Patch Set 3 : Address mbelshe's comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+215 lines, -188 lines) Patch
M net/socket/client_socket_pool_base.h View 1 5 chunks +49 lines, -42 lines 0 comments Download
M net/socket/client_socket_pool_base.cc View 1 2 22 chunks +166 lines, -146 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
willchan no longer on Chromium
10 years, 4 months ago (2010-08-19 15:09:25 UTC) #1
Mike Belshe
LGTM http://codereview.chromium.org/3171017/diff/2001/3001 File net/socket/client_socket_pool_base.cc (right): http://codereview.chromium.org/3171017/diff/2001/3001#newcode250 net/socket/client_socket_pool_base.cc:250: group->StartBackupSocketTimer(group_name, this); I wonder if you couldn't put ...
10 years, 4 months ago (2010-08-23 04:41:00 UTC) #2
willchan no longer on Chromium
10 years, 4 months ago (2010-08-23 16:21:01 UTC) #3
http://codereview.chromium.org/3171017/diff/2001/3001
File net/socket/client_socket_pool_base.cc (right):

http://codereview.chromium.org/3171017/diff/2001/3001#newcode250
net/socket/client_socket_pool_base.cc:250:
group->StartBackupSocketTimer(group_name, this);
On 2010/08/23 04:41:00, Mike Belshe wrote:
> I wonder if you couldn't put this into Group::AddJob?  The Group class should
be
> smart enough to handle it automatically without help from the SocketPool now?

I looked into doing this, but AddJob() would have to pass in the |group_name|
and the |pool|.  It looks ugly.  I need to fix this by passing in those values
to Group's constructor or something.  I'm going to defer this to a later
refactor (I think I can move all the backup job stuff to the Group and then kick
it out to TCPClientSocketPool).

http://codereview.chromium.org/3171017/diff/2001/3001#newcode717
net/socket/client_socket_pool_base.cc:717: RemoveGroup(i++);
On 2010/08/23 04:41:00, Mike Belshe wrote:
> nit:  I find this late i++ stuff a little weird.  Why not put it into the
> for(;;++i) clause?

Legacy code.  I've fixed it now.

Powered by Google App Engine
This is Rietveld 408576698