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

Unified Diff: net/disk_cache/backend_impl.h

Issue 6292011: Disk cache: Prevent obscure file corruption and deal... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 months 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 | « no previous file | net/disk_cache/backend_impl.cc » ('j') | net/disk_cache/backend_impl.cc » ('J')
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 71365)
+++ net/disk_cache/backend_impl.h (working copy)
@@ -240,6 +240,14 @@
// Starts or stops throttling requests.
void ThrottleRequestsForTest(bool throttle);
+ // Trims an entry (all if |empty| is true) from the list of deleted
+ // entries. This method should be called directly on the cache thread.
+ void TrimForTest(bool empty);
+
+ // Trims an entry (all if |empty| is true) from the list of deleted
+ // entries. This method should be called directly on the cache thread.
+ void TrimDeletedListForTest(bool empty);
+
// Peforms a simple self-check, and returns the number of dirty items
// or an error code (negative value).
int SelfCheck();
@@ -280,8 +288,13 @@
// Returns a given entry from the cache. The entry to match is determined by
// key and hash, and the returned entry may be the matched one or it's parent
- // on the list of entries with the same hash (or bucket).
- EntryImpl* MatchEntry(const std::string& key, uint32 hash, bool find_parent);
+ // on the list of entries with the same hash (or bucket). To look for a parent
+ // of a given entry, |entry_addr| should be grabbed from that entry, so that
+ // if it doesn't match the entry on the index, we know that it was replaced
+ // with a new entry; in this case |*match_error| will be set to true and the
+ // return value will be NULL.
+ EntryImpl* MatchEntry(const std::string& key, uint32 hash, bool find_parent,
+ Addr entry_addr, bool* match_error);
// Opens the next or previous entry on a cache iteration.
EntryImpl* OpenFollowingEntry(bool forward, void** iter);
@@ -293,9 +306,8 @@
CacheRankingsBlock** from_entry,
EntryImpl** next_entry);
- // Returns the entry that is pointed by |next|. If we are trimming the cache,
- // |to_evict| should be true so that we don't perform extra disk writes.
- EntryImpl* GetEnumeratedEntry(CacheRankingsBlock* next, bool to_evict);
+ // Returns the entry that is pointed by |next|.
+ EntryImpl* GetEnumeratedEntry(CacheRankingsBlock* next);
// Re-opens an entry that was previously deleted.
EntryImpl* ResurrectEntry(EntryImpl* deleted_entry);
« no previous file with comments | « no previous file | net/disk_cache/backend_impl.cc » ('j') | net/disk_cache/backend_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698