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 // See net/disk_cache/disk_cache.h for the public interface of the cache. | 5 // See net/disk_cache/disk_cache.h for the public interface of the cache. |
6 | 6 |
7 #ifndef NET_DISK_CACHE_BACKEND_IMPL_H_ | 7 #ifndef NET_DISK_CACHE_BACKEND_IMPL_H_ |
8 #define NET_DISK_CACHE_BACKEND_IMPL_H_ | 8 #define NET_DISK_CACHE_BACKEND_IMPL_H_ |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 // Same behavior as OpenNextEntry but walks the list from back to front. | 67 // Same behavior as OpenNextEntry but walks the list from back to front. |
68 int OpenPrevEntry(void** iter, Entry** prev_entry, | 68 int OpenPrevEntry(void** iter, Entry** prev_entry, |
69 const CompletionCallback& callback); | 69 const CompletionCallback& callback); |
70 | 70 |
71 // Synchronous implementation of the asynchronous interface. | 71 // Synchronous implementation of the asynchronous interface. |
72 int SyncOpenEntry(const std::string& key, Entry** entry); | 72 int SyncOpenEntry(const std::string& key, Entry** entry); |
73 int SyncCreateEntry(const std::string& key, Entry** entry); | 73 int SyncCreateEntry(const std::string& key, Entry** entry); |
74 int SyncDoomEntry(const std::string& key); | 74 int SyncDoomEntry(const std::string& key); |
75 int SyncDoomAllEntries(); | 75 int SyncDoomAllEntries(); |
76 int SyncDoomEntriesBetween(const base::Time initial_time, | 76 int SyncDoomEntriesBetween(base::Time initial_time, |
77 const base::Time end_time); | 77 base::Time end_time); |
78 int SyncDoomEntriesSince(const base::Time initial_time); | 78 int SyncDoomEntriesSince(base::Time initial_time); |
79 int SyncOpenNextEntry(void** iter, Entry** next_entry); | 79 int SyncOpenNextEntry(void** iter, Entry** next_entry); |
80 int SyncOpenPrevEntry(void** iter, Entry** prev_entry); | 80 int SyncOpenPrevEntry(void** iter, Entry** prev_entry); |
81 void SyncEndEnumeration(void* iter); | 81 void SyncEndEnumeration(void* iter); |
82 void SyncOnExternalCacheHit(const std::string& key); | 82 void SyncOnExternalCacheHit(const std::string& key); |
83 | 83 |
84 // Open or create an entry for the given |key| or |iter|. | 84 // Open or create an entry for the given |key| or |iter|. |
85 EntryImpl* OpenEntryImpl(const std::string& key); | 85 EntryImpl* OpenEntryImpl(const std::string& key); |
86 EntryImpl* CreateEntryImpl(const std::string& key); | 86 EntryImpl* CreateEntryImpl(const std::string& key); |
87 EntryImpl* OpenNextEntryImpl(void** iter); | 87 EntryImpl* OpenNextEntryImpl(void** iter); |
88 EntryImpl* OpenPrevEntryImpl(void** iter); | 88 EntryImpl* OpenPrevEntryImpl(void** iter); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 // Backend implementation. | 262 // Backend implementation. |
263 virtual net::CacheType GetCacheType() const OVERRIDE; | 263 virtual net::CacheType GetCacheType() const OVERRIDE; |
264 virtual int32 GetEntryCount() const OVERRIDE; | 264 virtual int32 GetEntryCount() const OVERRIDE; |
265 virtual int OpenEntry(const std::string& key, Entry** entry, | 265 virtual int OpenEntry(const std::string& key, Entry** entry, |
266 const CompletionCallback& callback) OVERRIDE; | 266 const CompletionCallback& callback) OVERRIDE; |
267 virtual int CreateEntry(const std::string& key, Entry** entry, | 267 virtual int CreateEntry(const std::string& key, Entry** entry, |
268 const CompletionCallback& callback) OVERRIDE; | 268 const CompletionCallback& callback) OVERRIDE; |
269 virtual int DoomEntry(const std::string& key, | 269 virtual int DoomEntry(const std::string& key, |
270 const CompletionCallback& callback) OVERRIDE; | 270 const CompletionCallback& callback) OVERRIDE; |
271 virtual int DoomAllEntries(const CompletionCallback& callback) OVERRIDE; | 271 virtual int DoomAllEntries(const CompletionCallback& callback) OVERRIDE; |
272 virtual int DoomEntriesBetween(const base::Time initial_time, | 272 virtual int DoomEntriesBetween(base::Time initial_time, |
273 const base::Time end_time, | 273 base::Time end_time, |
274 const CompletionCallback& callback) OVERRIDE; | 274 const CompletionCallback& callback) OVERRIDE; |
275 virtual int DoomEntriesSince(const base::Time initial_time, | 275 virtual int DoomEntriesSince(base::Time initial_time, |
276 const CompletionCallback& callback) OVERRIDE; | 276 const CompletionCallback& callback) OVERRIDE; |
277 virtual int OpenNextEntry(void** iter, Entry** next_entry, | 277 virtual int OpenNextEntry(void** iter, Entry** next_entry, |
278 const CompletionCallback& callback) OVERRIDE; | 278 const CompletionCallback& callback) OVERRIDE; |
279 virtual void EndEnumeration(void** iter) OVERRIDE; | 279 virtual void EndEnumeration(void** iter) OVERRIDE; |
280 virtual void GetStats(StatsItems* stats) OVERRIDE; | 280 virtual void GetStats(StatsItems* stats) OVERRIDE; |
281 virtual void OnExternalCacheHit(const std::string& key) OVERRIDE; | 281 virtual void OnExternalCacheHit(const std::string& key) OVERRIDE; |
282 | 282 |
283 private: | 283 private: |
284 typedef base::hash_map<CacheAddr, EntryImpl*> EntriesMap; | 284 typedef base::hash_map<CacheAddr, EntryImpl*> EntriesMap; |
285 | 285 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 | 394 |
395 DISALLOW_COPY_AND_ASSIGN(BackendImpl); | 395 DISALLOW_COPY_AND_ASSIGN(BackendImpl); |
396 }; | 396 }; |
397 | 397 |
398 // Returns the preferred max cache size given the available disk space. | 398 // Returns the preferred max cache size given the available disk space. |
399 NET_EXPORT_PRIVATE int PreferedCacheSize(int64 available); | 399 NET_EXPORT_PRIVATE int PreferedCacheSize(int64 available); |
400 | 400 |
401 } // namespace disk_cache | 401 } // namespace disk_cache |
402 | 402 |
403 #endif // NET_DISK_CACHE_BACKEND_IMPL_H_ | 403 #endif // NET_DISK_CACHE_BACKEND_IMPL_H_ |
OLD | NEW |