diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-02 19:14:29 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-02 19:14:29 +0000 |
commit | 07c3f84910a6bc63a69d5f7fe0725090cf2af1ce (patch) | |
tree | 6450123619273152c71b984d2565d22565dec244 /net/disk_cache/backend_impl.h | |
parent | 606843faf131685e7802df12f2ee97efc7cf2f3b (diff) | |
download | chromium_src-07c3f84910a6bc63a69d5f7fe0725090cf2af1ce.zip chromium_src-07c3f84910a6bc63a69d5f7fe0725090cf2af1ce.tar.gz chromium_src-07c3f84910a6bc63a69d5f7fe0725090cf2af1ce.tar.bz2 |
Disk cache: Add a tool to upgrade a set of cache files from one version to
another.
Also moves crash_cache project to the "tools folder" on the solution.
Review URL: http://codereview.chromium.org/12851
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6226 0039d316-1c4b-4281-b951-d872f2087c98
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. |