| OLD | NEW |
| 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 |
| OLD | NEW |