| OLD | NEW |
| 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 #ifndef NET_HTTP_HTTP_NETWORK_SESSION_H_ | 5 #ifndef NET_HTTP_HTTP_NETWORK_SESSION_H_ |
| 6 #define NET_HTTP_HTTP_NETWORK_SESSION_H_ | 6 #define NET_HTTP_HTTP_NETWORK_SESSION_H_ |
| 7 | 7 |
| 8 #include "base/ref_counted.h" | 8 #include "base/ref_counted.h" |
| 9 #include "net/base/client_socket_pool.h" | 9 #include "net/base/client_socket_pool.h" |
| 10 #include "net/base/ssl_config_service.h" | 10 #include "net/base/ssl_config_service.h" |
| 11 #include "net/http/http_auth_cache.h" | 11 #include "net/http/http_auth_cache.h" |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 | 14 |
| 15 class ProxyService; | 15 class ProxyService; |
| 16 | 16 |
| 17 // This class holds session objects used by HttpNetworkTransaction objects. | 17 // This class holds session objects used by HttpNetworkTransaction objects. |
| 18 class HttpNetworkSession : public base::RefCounted<HttpNetworkSession> { | 18 class HttpNetworkSession : public base::RefCounted<HttpNetworkSession> { |
| 19 public: | 19 public: |
| 20 // Allow up to 64 connections across all hosts. |
| 21 enum { |
| 22 MAX_SOCKETS = 64, |
| 23 }; |
| 24 |
| 20 explicit HttpNetworkSession(ProxyService* proxy_service) | 25 explicit HttpNetworkSession(ProxyService* proxy_service) |
| 21 : connection_pool_(new ClientSocketPool(max_sockets_per_group_)), | 26 : connection_pool_( |
| 27 new ClientSocketPool(max_sockets_per_group_, MAX_SOCKETS)), |
| 22 proxy_service_(proxy_service) { | 28 proxy_service_(proxy_service) { |
| 23 DCHECK(proxy_service); | 29 DCHECK(proxy_service); |
| 24 } | 30 } |
| 25 | 31 |
| 26 HttpAuthCache* auth_cache() { return &auth_cache_; } | 32 HttpAuthCache* auth_cache() { return &auth_cache_; } |
| 27 ClientSocketPool* connection_pool() { return connection_pool_; } | 33 ClientSocketPool* connection_pool() { return connection_pool_; } |
| 28 ProxyService* proxy_service() { return proxy_service_; } | 34 ProxyService* proxy_service() { return proxy_service_; } |
| 29 #if defined(OS_WIN) | 35 #if defined(OS_WIN) |
| 30 SSLConfigService* ssl_config_service() { return &ssl_config_service_; } | 36 SSLConfigService* ssl_config_service() { return &ssl_config_service_; } |
| 31 #endif | 37 #endif |
| (...skipping 11 matching lines...) Expand all Loading... |
| 43 ProxyService* proxy_service_; | 49 ProxyService* proxy_service_; |
| 44 #if defined(OS_WIN) | 50 #if defined(OS_WIN) |
| 45 // TODO(port): Port the SSLConfigService class to Linux and Mac OS X. | 51 // TODO(port): Port the SSLConfigService class to Linux and Mac OS X. |
| 46 SSLConfigService ssl_config_service_; | 52 SSLConfigService ssl_config_service_; |
| 47 #endif | 53 #endif |
| 48 }; | 54 }; |
| 49 | 55 |
| 50 } // namespace net | 56 } // namespace net |
| 51 | 57 |
| 52 #endif // NET_HTTP_HTTP_NETWORK_SESSION_H_ | 58 #endif // NET_HTTP_HTTP_NETWORK_SESSION_H_ |
| OLD | NEW |