| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // Default to allow up to 6 connections per host. Experiment and tuning may | 23 // Default to allow up to 6 connections per host. Experiment and tuning may |
| 24 // try other values (greater than 0). Too large may cause many problems, such | 24 // try other values (greater than 0). Too large may cause many problems, such |
| 25 // as home routers blocking the connections!?!? See http://crbug.com/12066. | 25 // as home routers blocking the connections!?!? See http://crbug.com/12066. |
| 26 int g_max_sockets_per_group = 6; | 26 int g_max_sockets_per_group = 6; |
| 27 | 27 |
| 28 // The max number of sockets to allow per proxy server. This applies both to | 28 // The max number of sockets to allow per proxy server. This applies both to |
| 29 // http and SOCKS proxies. See http://crbug.com/12066 and | 29 // http and SOCKS proxies. See http://crbug.com/12066 and |
| 30 // http://crbug.com/44501 for details about proxy server connection limits. | 30 // http://crbug.com/44501 for details about proxy server connection limits. |
| 31 int g_max_sockets_per_proxy_server = 32; | 31 int g_max_sockets_per_proxy_server = 32; |
| 32 | 32 |
| 33 uint16 g_fixed_http_port = 0; | |
| 34 uint16 g_fixed_https_port = 0; | |
| 35 | |
| 36 } // namespace | 33 } // namespace |
| 37 | 34 |
| 38 HttpNetworkSession::HttpNetworkSession( | 35 HttpNetworkSession::HttpNetworkSession( |
| 39 HostResolver* host_resolver, | 36 HostResolver* host_resolver, |
| 40 ProxyService* proxy_service, | 37 ProxyService* proxy_service, |
| 41 ClientSocketFactory* client_socket_factory, | 38 ClientSocketFactory* client_socket_factory, |
| 42 SSLConfigService* ssl_config_service, | 39 SSLConfigService* ssl_config_service, |
| 43 SpdySessionPool* spdy_session_pool, | 40 SpdySessionPool* spdy_session_pool, |
| 44 HttpAuthHandlerFactory* http_auth_handler_factory, | 41 HttpAuthHandlerFactory* http_auth_handler_factory, |
| 45 HttpNetworkDelegate* network_delegate, | 42 HttpNetworkDelegate* network_delegate, |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 } | 138 } |
| 142 | 139 |
| 143 // static | 140 // static |
| 144 void HttpNetworkSession::set_max_sockets_per_group(int socket_count) { | 141 void HttpNetworkSession::set_max_sockets_per_group(int socket_count) { |
| 145 DCHECK_LT(0, socket_count); | 142 DCHECK_LT(0, socket_count); |
| 146 // The following is a sanity check... but we should NEVER be near this value. | 143 // The following is a sanity check... but we should NEVER be near this value. |
| 147 DCHECK_GT(100, socket_count); | 144 DCHECK_GT(100, socket_count); |
| 148 g_max_sockets_per_group = socket_count; | 145 g_max_sockets_per_group = socket_count; |
| 149 } | 146 } |
| 150 | 147 |
| 151 // static | |
| 152 uint16 HttpNetworkSession::fixed_http_port() { | |
| 153 return g_fixed_http_port; | |
| 154 } | |
| 155 | |
| 156 // static | |
| 157 void HttpNetworkSession::set_fixed_http_port(uint16 port) { | |
| 158 g_fixed_http_port = port; | |
| 159 } | |
| 160 | |
| 161 // static | |
| 162 uint16 HttpNetworkSession::fixed_https_port() { | |
| 163 return g_fixed_https_port; | |
| 164 } | |
| 165 | |
| 166 // static | |
| 167 void HttpNetworkSession::set_fixed_https_port(uint16 port) { | |
| 168 g_fixed_https_port = port; | |
| 169 } | |
| 170 | |
| 171 } // namespace net | 148 } // namespace net |
| OLD | NEW |