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 #include "net/http/http_cache.h" | 5 #include "net/http/http_cache.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include "net/http/http_util.h" | 35 #include "net/http/http_util.h" |
36 #include "net/socket/ssl_host_info.h" | 36 #include "net/socket/ssl_host_info.h" |
37 | 37 |
38 namespace net { | 38 namespace net { |
39 | 39 |
40 namespace { | 40 namespace { |
41 | 41 |
42 HttpNetworkSession* CreateNetworkSession( | 42 HttpNetworkSession* CreateNetworkSession( |
43 HostResolver* host_resolver, | 43 HostResolver* host_resolver, |
44 CertVerifier* cert_verifier, | 44 CertVerifier* cert_verifier, |
| 45 OriginBoundCertService* origin_bound_cert_service, |
45 DnsRRResolver* dnsrr_resolver, | 46 DnsRRResolver* dnsrr_resolver, |
46 DnsCertProvenanceChecker* dns_cert_checker, | 47 DnsCertProvenanceChecker* dns_cert_checker, |
47 ProxyService* proxy_service, | 48 ProxyService* proxy_service, |
48 SSLHostInfoFactory* ssl_host_info_factory, | 49 SSLHostInfoFactory* ssl_host_info_factory, |
49 SSLConfigService* ssl_config_service, | 50 SSLConfigService* ssl_config_service, |
50 HttpAuthHandlerFactory* http_auth_handler_factory, | 51 HttpAuthHandlerFactory* http_auth_handler_factory, |
51 NetworkDelegate* network_delegate, | 52 NetworkDelegate* network_delegate, |
52 NetLog* net_log) { | 53 NetLog* net_log) { |
53 HttpNetworkSession::Params params; | 54 HttpNetworkSession::Params params; |
54 params.host_resolver = host_resolver; | 55 params.host_resolver = host_resolver; |
55 params.cert_verifier = cert_verifier; | 56 params.cert_verifier = cert_verifier; |
| 57 params.origin_bound_cert_service = origin_bound_cert_service; |
56 params.dnsrr_resolver = dnsrr_resolver; | 58 params.dnsrr_resolver = dnsrr_resolver; |
57 params.dns_cert_checker = dns_cert_checker; | 59 params.dns_cert_checker = dns_cert_checker; |
58 params.proxy_service = proxy_service; | 60 params.proxy_service = proxy_service; |
59 params.ssl_host_info_factory = ssl_host_info_factory; | 61 params.ssl_host_info_factory = ssl_host_info_factory; |
60 params.ssl_config_service = ssl_config_service; | 62 params.ssl_config_service = ssl_config_service; |
61 params.http_auth_handler_factory = http_auth_handler_factory; | 63 params.http_auth_handler_factory = http_auth_handler_factory; |
62 params.network_delegate = network_delegate; | 64 params.network_delegate = network_delegate; |
63 params.net_log = net_log; | 65 params.net_log = net_log; |
64 return new HttpNetworkSession(params); | 66 return new HttpNetworkSession(params); |
65 } | 67 } |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 } | 306 } |
305 | 307 |
306 private: | 308 private: |
307 CertVerifier* const cert_verifier_; | 309 CertVerifier* const cert_verifier_; |
308 HttpCache* const http_cache_; | 310 HttpCache* const http_cache_; |
309 }; | 311 }; |
310 | 312 |
311 //----------------------------------------------------------------------------- | 313 //----------------------------------------------------------------------------- |
312 HttpCache::HttpCache(HostResolver* host_resolver, | 314 HttpCache::HttpCache(HostResolver* host_resolver, |
313 CertVerifier* cert_verifier, | 315 CertVerifier* cert_verifier, |
| 316 OriginBoundCertService* origin_bound_cert_service, |
314 DnsRRResolver* dnsrr_resolver, | 317 DnsRRResolver* dnsrr_resolver, |
315 DnsCertProvenanceChecker* dns_cert_checker_, | 318 DnsCertProvenanceChecker* dns_cert_checker_, |
316 ProxyService* proxy_service, | 319 ProxyService* proxy_service, |
317 SSLConfigService* ssl_config_service, | 320 SSLConfigService* ssl_config_service, |
318 HttpAuthHandlerFactory* http_auth_handler_factory, | 321 HttpAuthHandlerFactory* http_auth_handler_factory, |
319 NetworkDelegate* network_delegate, | 322 NetworkDelegate* network_delegate, |
320 NetLog* net_log, | 323 NetLog* net_log, |
321 BackendFactory* backend_factory) | 324 BackendFactory* backend_factory) |
322 : net_log_(net_log), | 325 : net_log_(net_log), |
323 backend_factory_(backend_factory), | 326 backend_factory_(backend_factory), |
324 building_backend_(false), | 327 building_backend_(false), |
325 mode_(NORMAL), | 328 mode_(NORMAL), |
326 ssl_host_info_factory_(new SSLHostInfoFactoryAdaptor( | 329 ssl_host_info_factory_(new SSLHostInfoFactoryAdaptor( |
327 cert_verifier, | 330 cert_verifier, |
328 ALLOW_THIS_IN_INITIALIZER_LIST(this))), | 331 ALLOW_THIS_IN_INITIALIZER_LIST(this))), |
329 network_layer_( | 332 network_layer_( |
330 new HttpNetworkLayer( | 333 new HttpNetworkLayer( |
331 CreateNetworkSession( | 334 CreateNetworkSession( |
332 host_resolver, | 335 host_resolver, |
333 cert_verifier, | 336 cert_verifier, |
| 337 origin_bound_cert_service, |
334 dnsrr_resolver, | 338 dnsrr_resolver, |
335 dns_cert_checker_, | 339 dns_cert_checker_, |
336 proxy_service, | 340 proxy_service, |
337 ssl_host_info_factory_.get(), | 341 ssl_host_info_factory_.get(), |
338 ssl_config_service, | 342 ssl_config_service, |
339 http_auth_handler_factory, | 343 http_auth_handler_factory, |
340 network_delegate, | 344 network_delegate, |
341 net_log))), | 345 net_log))), |
342 ALLOW_THIS_IN_INITIALIZER_LIST(task_factory_(this)) { | 346 ALLOW_THIS_IN_INITIALIZER_LIST(task_factory_(this)) { |
343 } | 347 } |
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 building_backend_ = false; | 1137 building_backend_ = false; |
1134 DeletePendingOp(pending_op); | 1138 DeletePendingOp(pending_op); |
1135 } | 1139 } |
1136 | 1140 |
1137 // The cache may be gone when we return from the callback. | 1141 // The cache may be gone when we return from the callback. |
1138 if (!item->DoCallback(result, backend)) | 1142 if (!item->DoCallback(result, backend)) |
1139 item->NotifyTransaction(result, NULL); | 1143 item->NotifyTransaction(result, NULL); |
1140 } | 1144 } |
1141 | 1145 |
1142 } // namespace net | 1146 } // namespace net |
OLD | NEW |