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

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

Issue 14230009: Write the Simple Cache Index file to disk once in a while (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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/simple/simple_index.cc » ('j') | net/disk_cache/simple/simple_index.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/simple/simple_index.h
diff --git a/net/disk_cache/simple/simple_index.h b/net/disk_cache/simple/simple_index.h
index 76cf55ff5df6e51e09aad04bc60d82f0856624e6..5d9ddcdf814019195c8cc8bbb63c5f3e774dc353 100644
--- a/net/disk_cache/simple/simple_index.h
+++ b/net/disk_cache/simple/simple_index.h
@@ -16,6 +16,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/time.h"
+#include "base/timer.h"
#include "net/base/net_export.h"
class Pickle;
@@ -103,7 +104,10 @@ class NET_EXPORT_PRIVATE SimpleIndex
EntrySet* entry_set);
private:
- typedef base::Callback<void(scoped_ptr<EntrySet>)> IndexCompletionCallback;
+ typedef base::Callback<void(scoped_ptr<EntrySet>, bool must_write_to_disk)>
gavinp 2013/04/17 07:54:41 Maybe: force_index_flush ?
felipeg 2013/04/17 15:01:48 Done.
+ IndexCompletionCallback;
+
+ void PostponeWriteToDisk();
gavinp 2013/04/17 07:54:41 naming: PostponeWritingToDisk ?
felipeg 2013/04/17 15:01:48 Done.
static void LoadFromDisk(
const base::FilePath& index_filename,
@@ -118,7 +122,8 @@ class NET_EXPORT_PRIVATE SimpleIndex
scoped_ptr<Pickle> pickle);
// Must run on IO Thread.
- void MergeInitializingSet(scoped_ptr<EntrySet> index_file_entries);
+ void MergeInitializingSet(scoped_ptr<EntrySet> index_file_entries,
+ bool must_write_to_disk);
EntrySet entries_set_;
uint64 cache_size_; // Total cache storage size in bytes.
@@ -136,6 +141,8 @@ class NET_EXPORT_PRIVATE SimpleIndex
// All nonstatic SimpleEntryImpl methods should always be called on the IO
// thread, in all cases. |io_thread_checker_| documents and enforces this.
base::ThreadChecker io_thread_checker_;
+
+ base::OneShotTimer<SimpleIndex> write_to_disk_timer_;
};
} // namespace disk_cache
« no previous file with comments | « no previous file | net/disk_cache/simple/simple_index.cc » ('j') | net/disk_cache/simple/simple_index.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698