Chromium Code Reviews| Index: net/disk_cache/disk_cache.h |
| diff --git a/net/disk_cache/disk_cache.h b/net/disk_cache/disk_cache.h |
| index f71bc81964b929f4dce5596d724c41bf36429279..c3c0a87d6d3f7193fc07c2ff05fdac78101f52b7 100644 |
| --- a/net/disk_cache/disk_cache.h |
| +++ b/net/disk_cache/disk_cache.h |
| @@ -19,6 +19,7 @@ |
| #include "base/time/time.h" |
| #include "net/base/cache_type.h" |
| #include "net/base/completion_callback.h" |
| +#include "net/base/net_errors.h" |
|
gavinp
2017/01/12 16:07:36
Amazing that this wasn't there already!!! Good cat
dullweber
2017/01/12 17:03:15
Oh, that's funny. The include is here because I tr
|
| #include "net/base/net_export.h" |
| namespace base { |
| @@ -149,7 +150,18 @@ class NET_EXPORT Backend { |
| // Calculate the total size of the cache. The return value is the size in |
| // bytes or a net error code. If this method returns ERR_IO_PENDING, |
| // the |callback| will be invoked when the operation completes. |
| - virtual int CalculateSizeOfAllEntries( |
| + virtual int CalculateSizeOfAllEntries(const CompletionCallback& callback) = 0; |
| + |
| + // Calculate the size of all cache entries accessed between |initial_time| and |
| + // |end_time|. |
| + // The return value is the size in bytes or a net error code. A return value |
| + // of ERR_NOT_IMPLEMTED means that there is no efficient way for the backend |
|
gavinp
2017/01/12 16:07:36
typo: ERR_NOT_IMPLEMENTED, isn't it?
dullweber
2017/01/12 17:03:15
Done.
|
| + // to determine the size for a subset of the cache. |
| + // If this method returns ERR_IO_PENDING, the |callback| will be invoked when |
| + // the operation completes. |
| + virtual int CalculateSizeOfEntriesBetween( |
| + base::Time initial_time, |
| + base::Time end_time, |
| const CompletionCallback& callback) = 0; |
|
gavinp
2017/01/12 16:07:35
Does this method need to return a callback? Why no
dullweber
2017/01/12 17:03:15
The CalculateSizeOfAllEntries() method that just r
gavinp
2017/01/12 20:38:35
You've sold me. It's fine as it is.
|
| // Returns an iterator which will enumerate all entries of the cache in an |