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

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

Issue 14295013: Simple Cache: DoomEntriesBetween() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix an actual bug in DoomEntry 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 | « net/disk_cache/simple/simple_entry_impl.cc ('k') | net/disk_cache/simple/simple_index.cc » ('j') | no next file with comments »
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 0dd86c4530346f70fb862831ed44ea2ead415d8e..4f3c4046daa7c3f2989f3752d8767272d8ea86ef 100644
--- a/net/disk_cache/simple/simple_index.h
+++ b/net/disk_cache/simple/simple_index.h
@@ -5,8 +5,9 @@
#ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_
#define NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_
-#include <map>
+#include <list>
#include <string>
+#include <vector>
#include "base/basictypes.h"
#include "base/callback.h"
@@ -18,6 +19,7 @@
#include "base/threading/thread_checker.h"
#include "base/time.h"
#include "base/timer.h"
+#include "net/base/completion_callback.h"
#include "net/base/net_export.h"
class Pickle;
@@ -104,6 +106,20 @@ class NET_EXPORT_PRIVATE SimpleIndex
static void InsertInEntrySet(const EntryMetadata& entry_metadata,
EntrySet* entry_set);
+ // Executes the |callback| when the index is ready. Allows multiple callbacks.
+ int ExecuteWhenReady(const net::CompletionCallback& callback);
+
+ // Takes out entries from the index that have last accessed time matching the
+ // range between |initial_time| and |end_time| where open intervals are
+ // possible according to the definition given in |DoomEntriesBetween()| in the
+ // disk cache backend interface. Returns the set of hashes taken out.
+ scoped_ptr<std::vector<uint64> > RemoveEntriesBetween(
+ const base::Time initial_time,
+ const base::Time end_time);
+
+ // Returns number of indexed entries.
+ int32 GetEntryCount() const;
+
private:
typedef base::Callback<void(scoped_ptr<EntrySet>, bool force_index_flush)>
IndexCompletionCallback;
@@ -148,6 +164,9 @@ class NET_EXPORT_PRIVATE SimpleIndex
// has been a while since last time we wrote.
base::Time last_write_to_disk_;
base::OneShotTimer<SimpleIndex> write_to_disk_timer_;
+
+ typedef std::list<net::CompletionCallback> CallbackList;
+ CallbackList to_run_when_initialized_;
};
} // namespace disk_cache
« no previous file with comments | « net/disk_cache/simple/simple_entry_impl.cc ('k') | net/disk_cache/simple/simple_index.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698