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