| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_SPDY_SPDY_SESSION_POOL_H_ | 5 #ifndef NET_SPDY_SPDY_SESSION_POOL_H_ |
| 6 #define NET_SPDY_SPDY_SESSION_POOL_H_ | 6 #define NET_SPDY_SPDY_SESSION_POOL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <list> | 10 #include <list> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 namespace net { | 28 namespace net { |
| 29 | 29 |
| 30 class AddressList; | 30 class AddressList; |
| 31 class BoundNetLog; | 31 class BoundNetLog; |
| 32 class ClientSocketHandle; | 32 class ClientSocketHandle; |
| 33 class HostResolver; | 33 class HostResolver; |
| 34 class HttpServerProperties; | 34 class HttpServerProperties; |
| 35 class SpdySession; | 35 class SpdySession; |
| 36 | 36 |
| 37 namespace test_spdy2 { |
| 38 class SpdySessionPoolPeer; |
| 39 } // namespace test_spdy |
| 40 |
| 41 namespace test_spdy3 { |
| 42 class SpdySessionPoolPeer; |
| 43 } // namespace test_spdy |
| 44 |
| 37 // This is a very simple pool for open SpdySessions. | 45 // This is a very simple pool for open SpdySessions. |
| 38 class NET_EXPORT SpdySessionPool | 46 class NET_EXPORT SpdySessionPool |
| 39 : public NetworkChangeNotifier::IPAddressObserver, | 47 : public NetworkChangeNotifier::IPAddressObserver, |
| 40 public SSLConfigService::Observer, | 48 public SSLConfigService::Observer, |
| 41 public CertDatabase::Observer { | 49 public CertDatabase::Observer { |
| 42 public: | 50 public: |
| 43 SpdySessionPool(HostResolver* host_resolver, | 51 SpdySessionPool(HostResolver* host_resolver, |
| 44 SSLConfigService* ssl_config_service, | 52 SSLConfigService* ssl_config_service, |
| 45 HttpServerProperties* http_server_properties); | 53 HttpServerProperties* http_server_properties); |
| 46 virtual ~SpdySessionPool(); | 54 virtual ~SpdySessionPool(); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 136 |
| 129 // Controls whether the pool allows use of a common session for domains | 137 // Controls whether the pool allows use of a common session for domains |
| 130 // which share IP address resolutions. | 138 // which share IP address resolutions. |
| 131 static void enable_ip_pooling(bool value) { g_enable_ip_pooling = value; } | 139 static void enable_ip_pooling(bool value) { g_enable_ip_pooling = value; } |
| 132 | 140 |
| 133 // CertDatabase::Observer methods: | 141 // CertDatabase::Observer methods: |
| 134 virtual void OnUserCertAdded(const X509Certificate* cert) OVERRIDE; | 142 virtual void OnUserCertAdded(const X509Certificate* cert) OVERRIDE; |
| 135 virtual void OnCertTrustChanged(const X509Certificate* cert) OVERRIDE; | 143 virtual void OnCertTrustChanged(const X509Certificate* cert) OVERRIDE; |
| 136 | 144 |
| 137 private: | 145 private: |
| 138 friend class SpdySessionPoolPeer; // For testing. | 146 friend class test_spdy2::SpdySessionPoolPeer; // For testing. |
| 139 friend class SpdyNetworkTransactionTest; // For testing. | 147 friend class test_spdy3::SpdySessionPoolPeer; // For testing. |
| 140 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, WindowUpdateOverflow); | 148 friend class SpdyNetworkTransactionSpdy2Test; // For testing. |
| 149 friend class SpdyNetworkTransactionSpdy21Test; // For testing. |
| 150 friend class SpdyNetworkTransactionSpdy3Test; // For testing. |
| 151 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionSpdy2Test, |
| 152 WindowUpdateOverflow); |
| 153 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionSpdy21Test, |
| 154 WindowUpdateOverflow); |
| 155 FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionSpdy3Test, |
| 156 WindowUpdateOverflow); |
| 141 | 157 |
| 142 typedef std::list<scoped_refptr<SpdySession> > SpdySessionList; | 158 typedef std::list<scoped_refptr<SpdySession> > SpdySessionList; |
| 143 typedef std::map<HostPortProxyPair, SpdySessionList*> SpdySessionsMap; | 159 typedef std::map<HostPortProxyPair, SpdySessionList*> SpdySessionsMap; |
| 144 typedef std::map<IPEndPoint, HostPortProxyPair> SpdyAliasMap; | 160 typedef std::map<IPEndPoint, HostPortProxyPair> SpdyAliasMap; |
| 145 | 161 |
| 146 | 162 |
| 147 scoped_refptr<SpdySession> GetInternal( | 163 scoped_refptr<SpdySession> GetInternal( |
| 148 const HostPortProxyPair& host_port_proxy_pair, | 164 const HostPortProxyPair& host_port_proxy_pair, |
| 149 const BoundNetLog& net_log, | 165 const BoundNetLog& net_log, |
| 150 bool only_use_existing_sessions); | 166 bool only_use_existing_sessions); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 209 |
| 194 // Defaults to true. May be controlled via SpdySessionPoolPeer for tests. | 210 // Defaults to true. May be controlled via SpdySessionPoolPeer for tests. |
| 195 bool verify_domain_authentication_; | 211 bool verify_domain_authentication_; |
| 196 | 212 |
| 197 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); | 213 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); |
| 198 }; | 214 }; |
| 199 | 215 |
| 200 } // namespace net | 216 } // namespace net |
| 201 | 217 |
| 202 #endif // NET_SPDY_SPDY_SESSION_POOL_H_ | 218 #endif // NET_SPDY_SPDY_SESSION_POOL_H_ |
| OLD | NEW |