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 26 matching lines...) Expand all Loading... |
37 | 37 |
38 namespace disk_cache { | 38 namespace disk_cache { |
39 class Backend; | 39 class Backend; |
40 class Entry; | 40 class Entry; |
41 } | 41 } |
42 | 42 |
43 namespace net { | 43 namespace net { |
44 | 44 |
45 class CertVerifier; | 45 class CertVerifier; |
46 class DnsCertProvenanceChecker; | 46 class DnsCertProvenanceChecker; |
47 class DnsRRResolver; | |
48 class HostResolver; | 47 class HostResolver; |
49 class HttpAuthHandlerFactory; | 48 class HttpAuthHandlerFactory; |
50 class HttpNetworkSession; | 49 class HttpNetworkSession; |
51 struct HttpRequestInfo; | |
52 class HttpResponseInfo; | 50 class HttpResponseInfo; |
53 class HttpServerProperties; | 51 class HttpServerProperties; |
54 class IOBuffer; | 52 class IOBuffer; |
55 class NetLog; | 53 class NetLog; |
56 class NetworkDelegate; | 54 class NetworkDelegate; |
57 class OriginBoundCertService; | 55 class OriginBoundCertService; |
58 class ProxyService; | 56 class ProxyService; |
59 class SSLConfigService; | 57 class SSLConfigService; |
| 58 class TransportSecurityState; |
60 class ViewCacheHelper; | 59 class ViewCacheHelper; |
| 60 struct HttpRequestInfo; |
61 | 61 |
62 class NET_EXPORT HttpCache : public HttpTransactionFactory, | 62 class NET_EXPORT HttpCache : public HttpTransactionFactory, |
63 public base::SupportsWeakPtr<HttpCache>, | 63 public base::SupportsWeakPtr<HttpCache>, |
64 NON_EXPORTED_BASE(public base::NonThreadSafe) { | 64 NON_EXPORTED_BASE(public base::NonThreadSafe) { |
65 public: | 65 public: |
66 // The cache mode of operation. | 66 // The cache mode of operation. |
67 enum Mode { | 67 enum Mode { |
68 // Normal mode just behaves like a standard web cache. | 68 // Normal mode just behaves like a standard web cache. |
69 NORMAL = 0, | 69 NORMAL = 0, |
70 // Record mode caches everything for purposes of offline playback. | 70 // Record mode caches everything for purposes of offline playback. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 const FilePath path_; | 116 const FilePath path_; |
117 int max_bytes_; | 117 int max_bytes_; |
118 scoped_refptr<base::MessageLoopProxy> thread_; | 118 scoped_refptr<base::MessageLoopProxy> thread_; |
119 }; | 119 }; |
120 | 120 |
121 // The disk cache is initialized lazily (by CreateTransaction) in this case. | 121 // The disk cache is initialized lazily (by CreateTransaction) in this case. |
122 // The HttpCache takes ownership of the |backend_factory|. | 122 // The HttpCache takes ownership of the |backend_factory|. |
123 HttpCache(HostResolver* host_resolver, | 123 HttpCache(HostResolver* host_resolver, |
124 CertVerifier* cert_verifier, | 124 CertVerifier* cert_verifier, |
125 OriginBoundCertService* origin_bound_cert_service, | 125 OriginBoundCertService* origin_bound_cert_service, |
126 DnsRRResolver* dnsrr_resolver, | 126 TransportSecurityState* transport_security_state, |
127 DnsCertProvenanceChecker* dns_cert_checker, | 127 DnsCertProvenanceChecker* dns_cert_checker, |
128 ProxyService* proxy_service, | 128 ProxyService* proxy_service, |
129 SSLConfigService* ssl_config_service, | 129 SSLConfigService* ssl_config_service, |
130 HttpAuthHandlerFactory* http_auth_handler_factory, | 130 HttpAuthHandlerFactory* http_auth_handler_factory, |
131 NetworkDelegate* network_delegate, | 131 NetworkDelegate* network_delegate, |
132 HttpServerProperties* http_server_properties, | 132 HttpServerProperties* http_server_properties, |
133 NetLog* net_log, | 133 NetLog* net_log, |
134 BackendFactory* backend_factory); | 134 BackendFactory* backend_factory); |
135 | 135 |
136 // The disk cache is initialized lazily (by CreateTransaction) in this case. | 136 // The disk cache is initialized lazily (by CreateTransaction) in this case. |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 PendingOpsMap pending_ops_; | 382 PendingOpsMap pending_ops_; |
383 | 383 |
384 scoped_ptr<PlaybackCacheMap> playback_cache_map_; | 384 scoped_ptr<PlaybackCacheMap> playback_cache_map_; |
385 | 385 |
386 DISALLOW_COPY_AND_ASSIGN(HttpCache); | 386 DISALLOW_COPY_AND_ASSIGN(HttpCache); |
387 }; | 387 }; |
388 | 388 |
389 } // namespace net | 389 } // namespace net |
390 | 390 |
391 #endif // NET_HTTP_HTTP_CACHE_H_ | 391 #endif // NET_HTTP_HTTP_CACHE_H_ |
OLD | NEW |