diff options
Diffstat (limited to 'net/disk_cache/backend_impl.h')
-rw-r--r-- | net/disk_cache/backend_impl.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/net/disk_cache/backend_impl.h b/net/disk_cache/backend_impl.h index 40b6f51..5c88682 100644 --- a/net/disk_cache/backend_impl.h +++ b/net/disk_cache/backend_impl.h @@ -23,12 +23,12 @@ class BackendImpl : public Backend { public: explicit BackendImpl(const std::wstring& path) : path_(path), block_files_(path), mask_(0), max_size_(0), - init_(false), restarted_(false), unit_test_(false), + init_(false), restarted_(false), unit_test_(false), read_only_(false), ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)) {} // mask can be used to limit the usable size of the hash table, for testing. BackendImpl(const std::wstring& path, uint32 mask) : path_(path), block_files_(path), mask_(mask), max_size_(0), - init_(false), restarted_(false), unit_test_(false), + init_(false), restarted_(false), unit_test_(false), read_only_(false), ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)) {} ~BackendImpl(); @@ -109,6 +109,9 @@ class BackendImpl : public Backend { // Sets internal parameters to enable unit testing mode. void SetUnitTestMode(); + // Sets internal parameters to enable upgrade mode (for internal tools). + void SetUpgradeMode(); + // Clears the counter of references to test handling of corruptions. void ClearRefCountForTest(); @@ -116,6 +119,9 @@ class BackendImpl : public Backend { // or an error code (negative value). int SelfCheck(); + // Same bahavior as OpenNextEntry but walks the list from back to front. + bool OpenPrevEntry(void** iter, Entry** prev_entry); + private: // Creates a new backing file for the cache index. bool CreateBackingStore(disk_cache::File* file); @@ -135,6 +141,9 @@ class BackendImpl : public Backend { EntryImpl* MatchEntry(const std::string& key, uint32 hash, bool find_parent); + // Opens the next or previous entry on a cache iteration. + bool OpenFollowingEntry(bool forward, void** iter, Entry** next_entry); + void DestroyInvalidEntry(Addr address, EntryImpl* entry); // Deletes entries from the cache until the current size is below the limit. @@ -175,6 +184,7 @@ class BackendImpl : public Backend { bool init_; // controls the initialization of the system. bool restarted_; bool unit_test_; + bool read_only_; // Prevents updates of the rankings data (used by tools). bool disabled_; Stats stats_; // Usage statistcs. |