OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 28 matching lines...) Expand all Loading... |
39 namespace net { | 39 namespace net { |
40 | 40 |
41 class HostResolver; | 41 class HostResolver; |
42 class HttpAuthHandlerFactory; | 42 class HttpAuthHandlerFactory; |
43 class HttpNetworkDelegate; | 43 class HttpNetworkDelegate; |
44 class HttpNetworkSession; | 44 class HttpNetworkSession; |
45 struct HttpRequestInfo; | 45 struct HttpRequestInfo; |
46 class HttpResponseInfo; | 46 class HttpResponseInfo; |
47 class IOBuffer; | 47 class IOBuffer; |
48 class NetLog; | 48 class NetLog; |
49 class NetworkChangeNotifier; | |
50 class ProxyService; | 49 class ProxyService; |
51 class SSLConfigService; | 50 class SSLConfigService; |
52 class ViewCacheHelper; | 51 class ViewCacheHelper; |
53 | 52 |
54 class HttpCache : public HttpTransactionFactory, | 53 class HttpCache : public HttpTransactionFactory, |
55 public base::SupportsWeakPtr<HttpCache> { | 54 public base::SupportsWeakPtr<HttpCache> { |
56 public: | 55 public: |
57 ~HttpCache(); | 56 ~HttpCache(); |
58 | 57 |
59 // The cache mode of operation. | 58 // The cache mode of operation. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 105 |
107 private: | 106 private: |
108 CacheType type_; | 107 CacheType type_; |
109 const FilePath path_; | 108 const FilePath path_; |
110 int max_bytes_; | 109 int max_bytes_; |
111 scoped_refptr<base::MessageLoopProxy> thread_; | 110 scoped_refptr<base::MessageLoopProxy> thread_; |
112 }; | 111 }; |
113 | 112 |
114 // The disk cache is initialized lazily (by CreateTransaction) in this case. | 113 // The disk cache is initialized lazily (by CreateTransaction) in this case. |
115 // The HttpCache takes ownership of the |backend_factory|. | 114 // The HttpCache takes ownership of the |backend_factory|. |
116 HttpCache(NetworkChangeNotifier* network_change_notifier, | 115 HttpCache(HostResolver* host_resolver, |
117 HostResolver* host_resolver, ProxyService* proxy_service, | 116 ProxyService* proxy_service, |
118 SSLConfigService* ssl_config_service, | 117 SSLConfigService* ssl_config_service, |
119 HttpAuthHandlerFactory* http_auth_handler_factory, | 118 HttpAuthHandlerFactory* http_auth_handler_factory, |
120 HttpNetworkDelegate* network_delegate, | 119 HttpNetworkDelegate* network_delegate, |
121 NetLog* net_log, | 120 NetLog* net_log, |
122 BackendFactory* backend_factory); | 121 BackendFactory* backend_factory); |
123 | 122 |
124 // The disk cache is initialized lazily (by CreateTransaction) in this case. | 123 // The disk cache is initialized lazily (by CreateTransaction) in this case. |
125 // Provide an existing HttpNetworkSession, the cache can construct a | 124 // Provide an existing HttpNetworkSession, the cache can construct a |
126 // network layer with a shared HttpNetworkSession in order for multiple | 125 // network layer with a shared HttpNetworkSession in order for multiple |
127 // network layers to share information (e.g. authenication data). The | 126 // network layers to share information (e.g. authenication data). The |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 | 363 |
365 typedef base::hash_map<std::string, int> PlaybackCacheMap; | 364 typedef base::hash_map<std::string, int> PlaybackCacheMap; |
366 scoped_ptr<PlaybackCacheMap> playback_cache_map_; | 365 scoped_ptr<PlaybackCacheMap> playback_cache_map_; |
367 | 366 |
368 DISALLOW_COPY_AND_ASSIGN(HttpCache); | 367 DISALLOW_COPY_AND_ASSIGN(HttpCache); |
369 }; | 368 }; |
370 | 369 |
371 } // namespace net | 370 } // namespace net |
372 | 371 |
373 #endif // NET_HTTP_HTTP_CACHE_H_ | 372 #endif // NET_HTTP_HTTP_CACHE_H_ |
OLD | NEW |