Chromium Code Reviews| 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..fa9b891be5d2b78d08a480c11544532d129bb0d9 100644 |
| --- a/net/disk_cache/simple/simple_index.h |
| +++ b/net/disk_cache/simple/simple_index.h |
| @@ -5,7 +5,9 @@ |
| #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ |
| #define NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ |
| +#include <list> |
| #include <map> |
|
gavinp
2013/04/17 07:41:18
While we're here, I believe this isn't needed any
pasko-google - do not use
2013/04/17 19:47:52
Done.
|
| +#include <set> |
| #include <string> |
| #include "base/basictypes.h" |
| @@ -16,6 +18,7 @@ |
| #include "base/memory/scoped_ptr.h" |
| #include "base/memory/weak_ptr.h" |
| #include "base/time.h" |
| +#include "net/base/completion_callback.h" |
| #include "net/base/net_export.h" |
| class Pickle; |
| @@ -102,6 +105,19 @@ 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. |
| + std::set<uint64>* PullEntriesBetween(const base::Time initial_time, |
|
gavinp
2013/04/17 07:41:18
Rather than referencing the definition in |DoomEnt
pasko-google - do not use
2013/04/17 19:47:52
That? Will change? C'mon, backend interface change
|
| + const base::Time end_time); |
| + |
| + // Returns amount of indexed entries. |
|
gavinp
2013/04/17 07:41:18
// Returns number of indexed entries.
pasko-google - do not use
2013/04/17 19:47:52
Done.
|
| + int32 GetEntryCount() const; |
| + |
| private: |
| typedef base::Callback<void(scoped_ptr<EntrySet>)> IndexCompletionCallback; |
| @@ -136,6 +152,9 @@ 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_; |
| + |
| + typedef std::list<net::CompletionCallback> CallbackList; |
|
gavinp
2013/04/17 07:41:18
Take it or leave it suggestion: lose this typedef.
pasko-google - do not use
2013/04/17 19:47:52
Please remind me when we transition to C++11, I'd
|
| + CallbackList initialized_waitlist_; |
|
gavinp
2013/04/17 07:41:18
Naming suggestion: to_run_when_initialized_ (with
pasko-google - do not use
2013/04/17 19:47:52
OK, taking this. I liked how waitlist sounded, it
|
| }; |
| } // namespace disk_cache |