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 // 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 void CloseAllConnections(); | 184 void CloseAllConnections(); |
185 | 185 |
186 // Close all idle connections. Will close all sockets not in active use. | 186 // Close all idle connections. Will close all sockets not in active use. |
187 void CloseIdleConnections(); | 187 void CloseIdleConnections(); |
188 | 188 |
189 // Called whenever an external cache in the system reuses the resource | 189 // Called whenever an external cache in the system reuses the resource |
190 // referred to by |url| and |http_method|. | 190 // referred to by |url| and |http_method|. |
191 void OnExternalCacheHit(const GURL& url, const std::string& http_method); | 191 void OnExternalCacheHit(const GURL& url, const std::string& http_method); |
192 | 192 |
193 // HttpTransactionFactory implementation: | 193 // HttpTransactionFactory implementation: |
194 virtual int CreateTransaction(scoped_ptr<HttpTransaction>* trans) OVERRIDE; | 194 virtual int CreateTransaction(scoped_ptr<HttpTransaction>* trans, |
| 195 HttpTransactionDelegate* delegate) OVERRIDE; |
195 virtual HttpCache* GetCache() OVERRIDE; | 196 virtual HttpCache* GetCache() OVERRIDE; |
196 virtual HttpNetworkSession* GetSession() OVERRIDE; | 197 virtual HttpNetworkSession* GetSession() OVERRIDE; |
197 | 198 |
198 protected: | 199 protected: |
199 // Disk cache entry data indices. | 200 // Disk cache entry data indices. |
200 enum { | 201 enum { |
201 kResponseInfoIndex = 0, | 202 kResponseInfoIndex = 0, |
202 kResponseContentIndex, | 203 kResponseContentIndex, |
203 kMetadataIndex, | 204 kMetadataIndex, |
204 | 205 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 PendingOpsMap pending_ops_; | 392 PendingOpsMap pending_ops_; |
392 | 393 |
393 scoped_ptr<PlaybackCacheMap> playback_cache_map_; | 394 scoped_ptr<PlaybackCacheMap> playback_cache_map_; |
394 | 395 |
395 DISALLOW_COPY_AND_ASSIGN(HttpCache); | 396 DISALLOW_COPY_AND_ASSIGN(HttpCache); |
396 }; | 397 }; |
397 | 398 |
398 } // namespace net | 399 } // namespace net |
399 | 400 |
400 #endif // NET_HTTP_HTTP_CACHE_H_ | 401 #endif // NET_HTTP_HTTP_CACHE_H_ |
OLD | NEW |