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 // This file declares a HttpTransactionFactory implementation that can be | 5 // This file declares a HttpTransactionFactory implementation that can be |
6 // layered on top of another HttpTransactionFactory to add HTTP caching. The | 6 // layered on top of another HttpTransactionFactory to add HTTP caching. The |
7 // caching logic follows RFC 2616 (any exceptions are called out in the code). | 7 // caching logic follows RFC 2616 (any exceptions are called out in the code). |
8 // | 8 // |
9 // The HttpCache takes a disk_cache::Backend as a parameter, and uses that for | 9 // The HttpCache takes a disk_cache::Backend as a parameter, and uses that for |
10 // the cache storage. | 10 // the cache storage. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 class HostResolver; | 48 class HostResolver; |
49 class HttpAuthHandlerFactory; | 49 class HttpAuthHandlerFactory; |
50 class HttpNetworkSession; | 50 class HttpNetworkSession; |
51 struct HttpRequestInfo; | 51 struct HttpRequestInfo; |
52 class HttpResponseInfo; | 52 class HttpResponseInfo; |
53 class IOBuffer; | 53 class IOBuffer; |
54 class NetLog; | 54 class NetLog; |
55 class NetworkDelegate; | 55 class NetworkDelegate; |
56 class OriginBoundCertService; | 56 class OriginBoundCertService; |
57 class ProxyService; | 57 class ProxyService; |
| 58 class SpdyConfigService; |
58 class SSLConfigService; | 59 class SSLConfigService; |
59 class ViewCacheHelper; | 60 class ViewCacheHelper; |
60 | 61 |
61 class NET_EXPORT HttpCache : public HttpTransactionFactory, | 62 class NET_EXPORT HttpCache : public HttpTransactionFactory, |
62 public base::SupportsWeakPtr<HttpCache>, | 63 public base::SupportsWeakPtr<HttpCache>, |
63 NON_EXPORTED_BASE(public base::NonThreadSafe) { | 64 NON_EXPORTED_BASE(public base::NonThreadSafe) { |
64 public: | 65 public: |
65 // The cache mode of operation. | 66 // The cache mode of operation. |
66 enum Mode { | 67 enum Mode { |
67 // Normal mode just behaves like a standard web cache. | 68 // Normal mode just behaves like a standard web cache. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 }; | 119 }; |
119 | 120 |
120 // The disk cache is initialized lazily (by CreateTransaction) in this case. | 121 // The disk cache is initialized lazily (by CreateTransaction) in this case. |
121 // The HttpCache takes ownership of the |backend_factory|. | 122 // The HttpCache takes ownership of the |backend_factory|. |
122 HttpCache(HostResolver* host_resolver, | 123 HttpCache(HostResolver* host_resolver, |
123 CertVerifier* cert_verifier, | 124 CertVerifier* cert_verifier, |
124 OriginBoundCertService* origin_bound_cert_service, | 125 OriginBoundCertService* origin_bound_cert_service, |
125 DnsRRResolver* dnsrr_resolver, | 126 DnsRRResolver* dnsrr_resolver, |
126 DnsCertProvenanceChecker* dns_cert_checker, | 127 DnsCertProvenanceChecker* dns_cert_checker, |
127 ProxyService* proxy_service, | 128 ProxyService* proxy_service, |
| 129 SpdyConfigService* spdy_config_service, |
128 SSLConfigService* ssl_config_service, | 130 SSLConfigService* ssl_config_service, |
129 HttpAuthHandlerFactory* http_auth_handler_factory, | 131 HttpAuthHandlerFactory* http_auth_handler_factory, |
130 NetworkDelegate* network_delegate, | 132 NetworkDelegate* network_delegate, |
131 NetLog* net_log, | 133 NetLog* net_log, |
132 BackendFactory* backend_factory); | 134 BackendFactory* backend_factory); |
133 | 135 |
134 // The disk cache is initialized lazily (by CreateTransaction) in this case. | 136 // The disk cache is initialized lazily (by CreateTransaction) in this case. |
135 // Provide an existing HttpNetworkSession, the cache can construct a | 137 // Provide an existing HttpNetworkSession, the cache can construct a |
136 // network layer with a shared HttpNetworkSession in order for multiple | 138 // network layer with a shared HttpNetworkSession in order for multiple |
137 // network layers to share information (e.g. authentication data). The | 139 // network layers to share information (e.g. authentication data). The |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 ScopedRunnableMethodFactory<HttpCache> task_factory_; | 380 ScopedRunnableMethodFactory<HttpCache> task_factory_; |
379 | 381 |
380 scoped_ptr<PlaybackCacheMap> playback_cache_map_; | 382 scoped_ptr<PlaybackCacheMap> playback_cache_map_; |
381 | 383 |
382 DISALLOW_COPY_AND_ASSIGN(HttpCache); | 384 DISALLOW_COPY_AND_ASSIGN(HttpCache); |
383 }; | 385 }; |
384 | 386 |
385 } // namespace net | 387 } // namespace net |
386 | 388 |
387 #endif // NET_HTTP_HTTP_CACHE_H_ | 389 #endif // NET_HTTP_HTTP_CACHE_H_ |
OLD | NEW |