Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: net/disk_cache/backend_impl.h

Issue 12851: Disk cache: Add a tool to upgrade a set of cache files from one version to... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/build/dump_cache.vcproj ('k') | net/disk_cache/backend_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/backend_impl.h
===================================================================
--- net/disk_cache/backend_impl.h (revision 6178)
+++ net/disk_cache/backend_impl.h (working copy)
@@ -23,12 +23,12 @@
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 @@
// 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 @@
// 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 @@
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 @@
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.
« no previous file with comments | « net/build/dump_cache.vcproj ('k') | net/disk_cache/backend_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698