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

Unified Diff: net/disk_cache/disk_cache.h

Issue 2626173003: Calculate the size of all cache entries between two points in time. (Closed)
Patch Set: fix unit_tests compilation Created 3 years, 11 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/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

Powered by Google App Engine
This is Rietveld 408576698