| 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 14 matching lines...) Expand all Loading... |
| 25 #include "base/memory/weak_ptr.h" | 25 #include "base/memory/weak_ptr.h" |
| 26 #include "base/message_loop_proxy.h" | 26 #include "base/message_loop_proxy.h" |
| 27 #include "base/time.h" | 27 #include "base/time.h" |
| 28 #include "base/threading/non_thread_safe.h" | 28 #include "base/threading/non_thread_safe.h" |
| 29 #include "net/base/cache_type.h" | 29 #include "net/base/cache_type.h" |
| 30 #include "net/base/completion_callback.h" | 30 #include "net/base/completion_callback.h" |
| 31 #include "net/base/load_states.h" | 31 #include "net/base/load_states.h" |
| 32 #include "net/base/net_export.h" | 32 #include "net/base/net_export.h" |
| 33 #include "net/http/http_network_session.h" | 33 #include "net/http/http_network_session.h" |
| 34 #include "net/http/http_transaction_factory.h" | 34 #include "net/http/http_transaction_factory.h" |
| 35 #include "net/http/infinite_cache.h" |
| 35 | 36 |
| 36 class GURL; | 37 class GURL; |
| 37 | 38 |
| 38 namespace disk_cache { | 39 namespace disk_cache { |
| 39 class Backend; | 40 class Backend; |
| 40 class Entry; | 41 class Entry; |
| 41 } | 42 } |
| 42 | 43 |
| 43 namespace net { | 44 namespace net { |
| 44 | 45 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 }; | 202 }; |
| 202 friend class ViewCacheHelper; | 203 friend class ViewCacheHelper; |
| 203 | 204 |
| 204 private: | 205 private: |
| 205 // Types -------------------------------------------------------------------- | 206 // Types -------------------------------------------------------------------- |
| 206 | 207 |
| 207 class MetadataWriter; | 208 class MetadataWriter; |
| 208 class Transaction; | 209 class Transaction; |
| 209 class WorkItem; | 210 class WorkItem; |
| 210 friend class Transaction; | 211 friend class Transaction; |
| 212 friend class InfiniteCache; |
| 211 struct PendingOp; // Info for an entry under construction. | 213 struct PendingOp; // Info for an entry under construction. |
| 212 | 214 |
| 213 typedef std::list<Transaction*> TransactionList; | 215 typedef std::list<Transaction*> TransactionList; |
| 214 typedef std::list<WorkItem*> WorkItemList; | 216 typedef std::list<WorkItem*> WorkItemList; |
| 215 | 217 |
| 216 struct ActiveEntry { | 218 struct ActiveEntry { |
| 217 explicit ActiveEntry(disk_cache::Entry* entry); | 219 explicit ActiveEntry(disk_cache::Entry* entry); |
| 218 ~ActiveEntry(); | 220 ~ActiveEntry(); |
| 219 | 221 |
| 220 disk_cache::Entry* disk_entry; | 222 disk_cache::Entry* disk_entry; |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 ActiveEntriesMap active_entries_; | 381 ActiveEntriesMap active_entries_; |
| 380 | 382 |
| 381 // The set of doomed entries. | 383 // The set of doomed entries. |
| 382 ActiveEntriesSet doomed_entries_; | 384 ActiveEntriesSet doomed_entries_; |
| 383 | 385 |
| 384 // The set of entries "under construction". | 386 // The set of entries "under construction". |
| 385 PendingOpsMap pending_ops_; | 387 PendingOpsMap pending_ops_; |
| 386 | 388 |
| 387 scoped_ptr<PlaybackCacheMap> playback_cache_map_; | 389 scoped_ptr<PlaybackCacheMap> playback_cache_map_; |
| 388 | 390 |
| 391 InfiniteCache infinite_cache_; |
| 392 |
| 389 DISALLOW_COPY_AND_ASSIGN(HttpCache); | 393 DISALLOW_COPY_AND_ASSIGN(HttpCache); |
| 390 }; | 394 }; |
| 391 | 395 |
| 392 } // namespace net | 396 } // namespace net |
| 393 | 397 |
| 394 #endif // NET_HTTP_HTTP_CACHE_H_ | 398 #endif // NET_HTTP_HTTP_CACHE_H_ |
| OLD | NEW |