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

Side by Side Diff: net/http/http_network_session.cc

Issue 149027: Limit total number of sockets in the system.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: reorder Created 11 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « net/http/http_network_session.h ('k') | net/socket/client_socket_pool_base.h » ('j') | 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/http/http_network_session.h" 5 #include "net/http/http_network_session.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace net { 9 namespace net {
10 10
11 // static 11 // static
12 int HttpNetworkSession::max_sockets_ = 100;
13
14 // static
12 int HttpNetworkSession::max_sockets_per_group_ = 6; 15 int HttpNetworkSession::max_sockets_per_group_ = 6;
13 16
17 HttpNetworkSession::HttpNetworkSession(
18 HostResolver* host_resolver,
19 ProxyService* proxy_service,
20 ClientSocketFactory* client_socket_factory)
21 : connection_pool_(new TCPClientSocketPool(
22 max_sockets_, max_sockets_per_group_, host_resolver,
23 client_socket_factory)),
24 host_resolver_(host_resolver),
25 proxy_service_(proxy_service) {
26 DCHECK(proxy_service);
27 }
28
14 // static 29 // static
15 void HttpNetworkSession::set_max_sockets_per_group(int socket_count) { 30 void HttpNetworkSession::set_max_sockets_per_group(int socket_count) {
16 DCHECK(0 < socket_count); 31 DCHECK(0 < socket_count);
17 // The following is a sanity check... but we should NEVER be near this value. 32 // The following is a sanity check... but we should NEVER be near this value.
18 DCHECK(100 > socket_count); 33 DCHECK(100 > socket_count);
19 max_sockets_per_group_ = socket_count; 34 max_sockets_per_group_ = socket_count;
20 } 35 }
21 36
22 } // namespace net 37 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_network_session.h ('k') | net/socket/client_socket_pool_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698