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

Side by Side Diff: net/socket/tcp_client_socket_pool.cc

Issue 176021: Control the amount of time to leave an unused socket idle before closing it. (Closed)
Patch Set: Address wtc's comments. Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/socket/client_socket_pool_base_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/socket/tcp_client_socket_pool.h" 5 #include "net/socket/tcp_client_socket_pool.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 base::TimeDelta::FromSeconds(kTCPConnectJobTimeoutInSeconds), 139 base::TimeDelta::FromSeconds(kTCPConnectJobTimeoutInSeconds),
140 client_socket_factory_, host_resolver_, delegate, load_log); 140 client_socket_factory_, host_resolver_, delegate, load_log);
141 } 141 }
142 142
143 TCPClientSocketPool::TCPClientSocketPool( 143 TCPClientSocketPool::TCPClientSocketPool(
144 int max_sockets, 144 int max_sockets,
145 int max_sockets_per_group, 145 int max_sockets_per_group,
146 HostResolver* host_resolver, 146 HostResolver* host_resolver,
147 ClientSocketFactory* client_socket_factory) 147 ClientSocketFactory* client_socket_factory)
148 : base_(max_sockets, max_sockets_per_group, 148 : base_(max_sockets, max_sockets_per_group,
149 base::TimeDelta::FromSeconds(kUnusedIdleSocketTimeout),
150 base::TimeDelta::FromSeconds(kUsedIdleSocketTimeout),
149 new TCPConnectJobFactory(client_socket_factory, host_resolver)) {} 151 new TCPConnectJobFactory(client_socket_factory, host_resolver)) {}
150 152
151 TCPClientSocketPool::~TCPClientSocketPool() {} 153 TCPClientSocketPool::~TCPClientSocketPool() {}
152 154
153 int TCPClientSocketPool::RequestSocket( 155 int TCPClientSocketPool::RequestSocket(
154 const std::string& group_name, 156 const std::string& group_name,
155 const void* resolve_info, 157 const void* resolve_info,
156 int priority, 158 int priority,
157 ClientSocketHandle* handle, 159 ClientSocketHandle* handle,
158 CompletionCallback* callback, 160 CompletionCallback* callback,
(...skipping 24 matching lines...) Expand all
183 const std::string& group_name) const { 185 const std::string& group_name) const {
184 return base_.IdleSocketCountInGroup(group_name); 186 return base_.IdleSocketCountInGroup(group_name);
185 } 187 }
186 188
187 LoadState TCPClientSocketPool::GetLoadState( 189 LoadState TCPClientSocketPool::GetLoadState(
188 const std::string& group_name, const ClientSocketHandle* handle) const { 190 const std::string& group_name, const ClientSocketHandle* handle) const {
189 return base_.GetLoadState(group_name, handle); 191 return base_.GetLoadState(group_name, handle);
190 } 192 }
191 193
192 } // namespace net 194 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/client_socket_pool_base_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698