| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 204 | 204 | 
| 205     // Must remain at the end of the enum. | 205     // Must remain at the end of the enum. | 
| 206     kNumCacheEntryDataIndices | 206     kNumCacheEntryDataIndices | 
| 207   }; | 207   }; | 
| 208   friend class ViewCacheHelper; | 208   friend class ViewCacheHelper; | 
| 209 | 209 | 
| 210  private: | 210  private: | 
| 211   // Types -------------------------------------------------------------------- | 211   // Types -------------------------------------------------------------------- | 
| 212 | 212 | 
| 213   class MetadataWriter; | 213   class MetadataWriter; | 
|  | 214   class SSLHostInfoFactoryAdaptor; | 
| 214   class Transaction; | 215   class Transaction; | 
| 215   class WorkItem; | 216   class WorkItem; | 
| 216   friend class Transaction; | 217   friend class Transaction; | 
| 217   struct PendingOp;  // Info for an entry under construction. | 218   struct PendingOp;  // Info for an entry under construction. | 
| 218 | 219 | 
| 219   typedef std::list<Transaction*> TransactionList; | 220   typedef std::list<Transaction*> TransactionList; | 
| 220   typedef std::list<WorkItem*> WorkItemList; | 221   typedef std::list<WorkItem*> WorkItemList; | 
| 221 | 222 | 
| 222   struct ActiveEntry { | 223   struct ActiveEntry { | 
| 223     explicit ActiveEntry(disk_cache::Entry* entry); | 224     explicit ActiveEntry(disk_cache::Entry* entry); | 
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 374   // Variables ---------------------------------------------------------------- | 375   // Variables ---------------------------------------------------------------- | 
| 375 | 376 | 
| 376   NetLog* net_log_; | 377   NetLog* net_log_; | 
| 377 | 378 | 
| 378   // Used when lazily constructing the disk_cache_. | 379   // Used when lazily constructing the disk_cache_. | 
| 379   scoped_ptr<BackendFactory> backend_factory_; | 380   scoped_ptr<BackendFactory> backend_factory_; | 
| 380   bool building_backend_; | 381   bool building_backend_; | 
| 381 | 382 | 
| 382   Mode mode_; | 383   Mode mode_; | 
| 383 | 384 | 
|  | 385   const scoped_ptr<SSLHostInfoFactoryAdaptor> ssl_host_info_factory_; | 
|  | 386 | 
| 384   const scoped_ptr<HttpTransactionFactory> network_layer_; | 387   const scoped_ptr<HttpTransactionFactory> network_layer_; | 
| 385   scoped_ptr<disk_cache::Backend> disk_cache_; | 388   scoped_ptr<disk_cache::Backend> disk_cache_; | 
| 386 | 389 | 
| 387   // The set of active entries indexed by cache key. | 390   // The set of active entries indexed by cache key. | 
| 388   ActiveEntriesMap active_entries_; | 391   ActiveEntriesMap active_entries_; | 
| 389 | 392 | 
| 390   // The set of doomed entries. | 393   // The set of doomed entries. | 
| 391   ActiveEntriesSet doomed_entries_; | 394   ActiveEntriesSet doomed_entries_; | 
| 392 | 395 | 
| 393   // The set of entries "under construction". | 396   // The set of entries "under construction". | 
| 394   PendingOpsMap pending_ops_; | 397   PendingOpsMap pending_ops_; | 
| 395 | 398 | 
| 396   scoped_ptr<PlaybackCacheMap> playback_cache_map_; | 399   scoped_ptr<PlaybackCacheMap> playback_cache_map_; | 
| 397 | 400 | 
| 398   DISALLOW_COPY_AND_ASSIGN(HttpCache); | 401   DISALLOW_COPY_AND_ASSIGN(HttpCache); | 
| 399 }; | 402 }; | 
| 400 | 403 | 
| 401 }  // namespace net | 404 }  // namespace net | 
| 402 | 405 | 
| 403 #endif  // NET_HTTP_HTTP_CACHE_H_ | 406 #endif  // NET_HTTP_HTTP_CACHE_H_ | 
| OLD | NEW | 
|---|