| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 9 #pragma once |
| 10 | 10 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(const base::Time initial_time, |
| 77 const base::Time end_time); | 77 const base::Time end_time); |
| 78 int SyncDoomEntriesSince(const base::Time initial_time); | 78 int SyncDoomEntriesSince(const 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 | 83 |
| 83 // Open or create an entry for the given |key| or |iter|. | 84 // Open or create an entry for the given |key| or |iter|. |
| 84 EntryImpl* OpenEntryImpl(const std::string& key); | 85 EntryImpl* OpenEntryImpl(const std::string& key); |
| 85 EntryImpl* CreateEntryImpl(const std::string& key); | 86 EntryImpl* CreateEntryImpl(const std::string& key); |
| 86 EntryImpl* OpenNextEntryImpl(void** iter); | 87 EntryImpl* OpenNextEntryImpl(void** iter); |
| 87 EntryImpl* OpenPrevEntryImpl(void** iter); | 88 EntryImpl* OpenPrevEntryImpl(void** iter); |
| 88 | 89 |
| 89 // Sets the maximum size for the total amount of data stored by this instance. | 90 // Sets the maximum size for the total amount of data stored by this instance. |
| 90 bool SetMaxSize(int max_bytes); | 91 bool SetMaxSize(int max_bytes); |
| 91 | 92 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 virtual int DoomAllEntries(CompletionCallback* callback); | 257 virtual int DoomAllEntries(CompletionCallback* callback); |
| 257 virtual int DoomEntriesBetween(const base::Time initial_time, | 258 virtual int DoomEntriesBetween(const base::Time initial_time, |
| 258 const base::Time end_time, | 259 const base::Time end_time, |
| 259 CompletionCallback* callback); | 260 CompletionCallback* callback); |
| 260 virtual int DoomEntriesSince(const base::Time initial_time, | 261 virtual int DoomEntriesSince(const base::Time initial_time, |
| 261 CompletionCallback* callback); | 262 CompletionCallback* callback); |
| 262 virtual int OpenNextEntry(void** iter, Entry** next_entry, | 263 virtual int OpenNextEntry(void** iter, Entry** next_entry, |
| 263 CompletionCallback* callback); | 264 CompletionCallback* callback); |
| 264 virtual void EndEnumeration(void** iter); | 265 virtual void EndEnumeration(void** iter); |
| 265 virtual void GetStats(StatsItems* stats); | 266 virtual void GetStats(StatsItems* stats); |
| 267 virtual void OnExternalCacheHit(const std::string& key); |
| 266 | 268 |
| 267 private: | 269 private: |
| 268 typedef base::hash_map<CacheAddr, EntryImpl*> EntriesMap; | 270 typedef base::hash_map<CacheAddr, EntryImpl*> EntriesMap; |
| 269 | 271 |
| 270 // Creates a new backing file for the cache index. | 272 // Creates a new backing file for the cache index. |
| 271 bool CreateBackingStore(disk_cache::File* file); | 273 bool CreateBackingStore(disk_cache::File* file); |
| 272 bool InitBackingStore(bool* file_created); | 274 bool InitBackingStore(bool* file_created); |
| 273 void AdjustMaxCacheSize(int table_len); | 275 void AdjustMaxCacheSize(int table_len); |
| 274 | 276 |
| 275 // Deletes the cache and starts again. | 277 // Deletes the cache and starts again. |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 | 381 |
| 380 DISALLOW_COPY_AND_ASSIGN(BackendImpl); | 382 DISALLOW_COPY_AND_ASSIGN(BackendImpl); |
| 381 }; | 383 }; |
| 382 | 384 |
| 383 // Returns the prefered max cache size given the available disk space. | 385 // Returns the prefered max cache size given the available disk space. |
| 384 NET_TEST int PreferedCacheSize(int64 available); | 386 NET_TEST int PreferedCacheSize(int64 available); |
| 385 | 387 |
| 386 } // namespace disk_cache | 388 } // namespace disk_cache |
| 387 | 389 |
| 388 #endif // NET_DISK_CACHE_BACKEND_IMPL_H_ | 390 #endif // NET_DISK_CACHE_BACKEND_IMPL_H_ |
| OLD | NEW |