| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 class QuicCryptoClientStreamFactory; | 49 class QuicCryptoClientStreamFactory; |
| 50 class QuicServerInfoFactory; | 50 class QuicServerInfoFactory; |
| 51 class SOCKSClientSocketPool; | 51 class SOCKSClientSocketPool; |
| 52 class SSLClientSocketPool; | 52 class SSLClientSocketPool; |
| 53 class SSLConfigService; | 53 class SSLConfigService; |
| 54 class TransportClientSocketPool; | 54 class TransportClientSocketPool; |
| 55 class TransportSecurityState; | 55 class TransportSecurityState; |
| 56 | 56 |
| 57 // This class holds session objects used by HttpNetworkTransaction objects. | 57 // This class holds session objects used by HttpNetworkTransaction objects. |
| 58 class NET_EXPORT HttpNetworkSession | 58 class NET_EXPORT HttpNetworkSession |
| 59 : public base::RefCounted<HttpNetworkSession>, | 59 : NON_EXPORTED_BASE(public base::NonThreadSafe) { |
| 60 NON_EXPORTED_BASE(public base::NonThreadSafe) { | |
| 61 public: | 60 public: |
| 62 struct NET_EXPORT Params { | 61 struct NET_EXPORT Params { |
| 63 Params(); | 62 Params(); |
| 64 ~Params(); | 63 ~Params(); |
| 65 | 64 |
| 66 ClientSocketFactory* client_socket_factory; | 65 ClientSocketFactory* client_socket_factory; |
| 67 HostResolver* host_resolver; | 66 HostResolver* host_resolver; |
| 68 CertVerifier* cert_verifier; | 67 CertVerifier* cert_verifier; |
| 69 CertPolicyEnforcer* cert_policy_enforcer; | 68 CertPolicyEnforcer* cert_policy_enforcer; |
| 70 ChannelIDService* channel_id_service; | 69 ChannelIDService* channel_id_service; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 ProxyDelegate* proxy_delegate; | 130 ProxyDelegate* proxy_delegate; |
| 132 }; | 131 }; |
| 133 | 132 |
| 134 enum SocketPoolType { | 133 enum SocketPoolType { |
| 135 NORMAL_SOCKET_POOL, | 134 NORMAL_SOCKET_POOL, |
| 136 WEBSOCKET_SOCKET_POOL, | 135 WEBSOCKET_SOCKET_POOL, |
| 137 NUM_SOCKET_POOL_TYPES | 136 NUM_SOCKET_POOL_TYPES |
| 138 }; | 137 }; |
| 139 | 138 |
| 140 explicit HttpNetworkSession(const Params& params); | 139 explicit HttpNetworkSession(const Params& params); |
| 140 ~HttpNetworkSession(); |
| 141 | 141 |
| 142 HttpAuthCache* http_auth_cache() { return &http_auth_cache_; } | 142 HttpAuthCache* http_auth_cache() { return &http_auth_cache_; } |
| 143 SSLClientAuthCache* ssl_client_auth_cache() { | 143 SSLClientAuthCache* ssl_client_auth_cache() { |
| 144 return &ssl_client_auth_cache_; | 144 return &ssl_client_auth_cache_; |
| 145 } | 145 } |
| 146 | 146 |
| 147 void AddResponseDrainer(HttpResponseBodyDrainer* drainer); | 147 void AddResponseDrainer(HttpResponseBodyDrainer* drainer); |
| 148 | 148 |
| 149 void RemoveResponseDrainer(HttpResponseBodyDrainer* drainer); | 149 void RemoveResponseDrainer(HttpResponseBodyDrainer* drainer); |
| 150 | 150 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 bool IsProtocolEnabled(AlternateProtocol protocol) const; | 203 bool IsProtocolEnabled(AlternateProtocol protocol) const; |
| 204 | 204 |
| 205 // Populates |*next_protos| with protocols. | 205 // Populates |*next_protos| with protocols. |
| 206 void GetNextProtos(NextProtoVector* next_protos) const; | 206 void GetNextProtos(NextProtoVector* next_protos) const; |
| 207 | 207 |
| 208 // Convenience function for searching through |params_| for | 208 // Convenience function for searching through |params_| for |
| 209 // |forced_spdy_exclusions|. | 209 // |forced_spdy_exclusions|. |
| 210 bool HasSpdyExclusion(HostPortPair host_port_pair) const; | 210 bool HasSpdyExclusion(HostPortPair host_port_pair) const; |
| 211 | 211 |
| 212 private: | 212 private: |
| 213 friend class base::RefCounted<HttpNetworkSession>; | |
| 214 friend class HttpNetworkSessionPeer; | 213 friend class HttpNetworkSessionPeer; |
| 215 | 214 |
| 216 ~HttpNetworkSession(); | |
| 217 | |
| 218 ClientSocketPoolManager* GetSocketPoolManager(SocketPoolType pool_type); | 215 ClientSocketPoolManager* GetSocketPoolManager(SocketPoolType pool_type); |
| 219 | 216 |
| 220 NetLog* const net_log_; | 217 NetLog* const net_log_; |
| 221 NetworkDelegate* const network_delegate_; | 218 NetworkDelegate* const network_delegate_; |
| 222 const base::WeakPtr<HttpServerProperties> http_server_properties_; | 219 const base::WeakPtr<HttpServerProperties> http_server_properties_; |
| 223 CertVerifier* const cert_verifier_; | 220 CertVerifier* const cert_verifier_; |
| 224 HttpAuthHandlerFactory* const http_auth_handler_factory_; | 221 HttpAuthHandlerFactory* const http_auth_handler_factory_; |
| 225 | 222 |
| 226 // Not const since it's modified by HttpNetworkSessionPeer for testing. | 223 // Not const since it's modified by HttpNetworkSessionPeer for testing. |
| 227 ProxyService* proxy_service_; | 224 ProxyService* proxy_service_; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 239 | 236 |
| 240 NextProtoVector next_protos_; | 237 NextProtoVector next_protos_; |
| 241 bool enabled_protocols_[NUM_VALID_ALTERNATE_PROTOCOLS]; | 238 bool enabled_protocols_[NUM_VALID_ALTERNATE_PROTOCOLS]; |
| 242 | 239 |
| 243 Params params_; | 240 Params params_; |
| 244 }; | 241 }; |
| 245 | 242 |
| 246 } // namespace net | 243 } // namespace net |
| 247 | 244 |
| 248 #endif // NET_HTTP_HTTP_NETWORK_SESSION_H_ | 245 #endif // NET_HTTP_HTTP_NETWORK_SESSION_H_ |
| OLD | NEW |