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

Unified Diff: net/disk_cache/simple/simple_index_file.h

Issue 22406005: Index initialization improvements for Simple Cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add unit test, fix windows build. Created 7 years, 4 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
Index: net/disk_cache/simple/simple_index_file.h
diff --git a/net/disk_cache/simple/simple_index_file.h b/net/disk_cache/simple/simple_index_file.h
index 8a96a7208000dd7d1674345d3225b1d7fb1a662f..b536df9a1e72cbaaa8a32f01ef33e82fa6f915d3 100644
--- a/net/disk_cache/simple/simple_index_file.h
+++ b/net/disk_cache/simple/simple_index_file.h
@@ -97,6 +97,10 @@ class NET_EXPORT_PRIVATE SimpleIndexFile {
private:
friend class WrappedSimpleIndexFile;
+ // When loading the entries from disk, add this many extra hash buckets to
+ // prevent reallocation on the IO thread when merging in new live entries.
+ static const int kExtraSizeForMerge = 512;
+
// Synchronous (IO performing) implementation of LoadIndexEntries.
static void SyncLoadIndexEntries(base::Time cache_last_modified,
const base::FilePath& cache_directory,

Powered by Google App Engine
This is Rietveld 408576698